Skip to contentSkip to conversation

v4l2-ctl: Show HSV encodings names

PATCH New Ricardo Ribalda Delgado 1 participant 1 message Nov 15, 2016 Media (V4L/DVB)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 v4l2-ctl: Show HSV encodings names

Add HSV encoding names to v4l2-ctl. I.e.

Format Video Capture:

	Width/Height      : 640/360
	Pixel Format      : 'HSV3'
	Field             : None
	Bytes per Line    : 1920
	Size Image        : 691200
	Colorspace        : sRGB

Transfer Function : Default
YCbCr/HSV Encoding: Hue 0 - 179
Quantization : Default
Flags :

---
 utils/v4l2-ctl/v4l2-ctl.cpp | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
utils/v4l2-ctl/v4l2-ctl.cpp +5 -1
index 8a2b3e6d186e..fe398233e28c 100644
@@ -451,6 +451,10 @@ static std::string ycbcr_enc2s(int val)
 		return "BT.2020 Constant Luminance";
 	case V4L2_YCBCR_ENC_SMPTE240M:
 		return "SMPTE 240M";
+	case V4L2_HSV_ENC_180:
+		return "Hue 0 - 179";
+	case V4L2_HSV_ENC_256:
+		return "Hue 0 - 255";
 	default:
 		return "Unknown (" + num2s(val) + ")";
 	}
@@ -532,7 +536,7 @@ void printfmt(const struct v4l2_format &vfmt)
 		printf("\tSize Image        : %u\n", vfmt.fmt.pix.sizeimage);
 		printf("\tColorspace        : %s\n", colorspace2s(vfmt.fmt.pix.colorspace).c_str());
 		printf("\tTransfer Function : %s\n", xfer_func2s(vfmt.fmt.pix.xfer_func).c_str());
-		printf("\tYCbCr Encoding    : %s\n", ycbcr_enc2s(vfmt.fmt.pix.ycbcr_enc).c_str());
+		printf("\tYCbCr/HSV Encoding: %s\n", ycbcr_enc2s(vfmt.fmt.pix.ycbcr_enc).c_str());
 		printf("\tQuantization      : %s\n", quantization2s(vfmt.fmt.pix.quantization).c_str());
 		if (vfmt.fmt.pix.priv == V4L2_PIX_FMT_PRIV_MAGIC)
 			printf("\tFlags             : %s\n", pixflags2s(vfmt.fmt.pix.flags).c_str());
Signature · 1 line
2.10.2