| From fdec9a137cfcdffccefec32dcb9b7e1ae7565f0e Mon Sep 17 00:00:00 2001 |
| From: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> |
| Date: Thu, 18 Aug 2016 11:33:27 -0300 |
| Subject: [PATCH 157/299] [media] videodev2.h Add HSV formats |
| |
| These formats store the color information of the image |
| in a geometrical representation. The colors are mapped into a |
| cylinder, where the angle is the HUE, the height is the VALUE |
| and the distance to the center is the SATURATION. This is a very |
| useful format for image segmentation algorithms. |
| |
| Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> |
| Acked-by: Hans Verkuil <hans.verkuil@cisco.com> |
| Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com> |
| (cherry picked from commit 66b2ab271afc0888b87a44dc946cc68067ba0985) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ |
| include/uapi/linux/videodev2.h | 4 ++++ |
| 2 files changed, 6 insertions(+) |
| |
| --- a/drivers/media/v4l2-core/v4l2-ioctl.c |
| +++ b/drivers/media/v4l2-core/v4l2-ioctl.c |
| @@ -1239,6 +1239,8 @@ static void v4l_fill_fmtdesc(struct v4l2 |
| case V4L2_PIX_FMT_TM6000: descr = "A/V + VBI Mux Packet"; break; |
| case V4L2_PIX_FMT_CIT_YYVYUY: descr = "GSPCA CIT YYVYUY"; break; |
| case V4L2_PIX_FMT_KONICA420: descr = "GSPCA KONICA420"; break; |
| + case V4L2_PIX_FMT_HSV24: descr = "24-bit HSV 8-8-8"; break; |
| + case V4L2_PIX_FMT_HSV32: descr = "32-bit XHSV 8-8-8-8"; break; |
| case V4L2_SDR_FMT_CU8: descr = "Complex U8"; break; |
| case V4L2_SDR_FMT_CU16LE: descr = "Complex U16LE"; break; |
| case V4L2_SDR_FMT_CS8: descr = "Complex S8"; break; |
| --- a/include/uapi/linux/videodev2.h |
| +++ b/include/uapi/linux/videodev2.h |
| @@ -586,6 +586,10 @@ struct v4l2_pix_format { |
| #define V4L2_PIX_FMT_SRGGB12 v4l2_fourcc('R', 'G', '1', '2') /* 12 RGRG.. GBGB.. */ |
| #define V4L2_PIX_FMT_SBGGR16 v4l2_fourcc('B', 'Y', 'R', '2') /* 16 BGBG.. GRGR.. */ |
| |
| +/* HSV formats */ |
| +#define V4L2_PIX_FMT_HSV24 v4l2_fourcc('H', 'S', 'V', '3') |
| +#define V4L2_PIX_FMT_HSV32 v4l2_fourcc('H', 'S', 'V', '4') |
| + |
| /* compressed formats */ |
| #define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ |
| #define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ |