From patchwork Fri Jul 15 15:16:51 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ricardo Ribalda Delgado X-Patchwork-Id: 9232221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2EA2160865 for ; Fri, 15 Jul 2016 15:18:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 20A3127CCB for ; Fri, 15 Jul 2016 15:18:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1509327FA4; Fri, 15 Jul 2016 15:18:57 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B63D127CCB for ; Fri, 15 Jul 2016 15:18:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751350AbcGOPSy (ORCPT ); Fri, 15 Jul 2016 11:18:54 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:33926 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751181AbcGOPRC (ORCPT ); Fri, 15 Jul 2016 11:17:02 -0400 Received: by mail-lf0-f66.google.com with SMTP id l69so2695155lfg.1; Fri, 15 Jul 2016 08:17:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=esILVDWh9zMbzNI14yg6rc25e2uwVcR8Wf5tcDu2Am4=; b=oFzUBgL6eMU0FSboXQ/SW28okOz+FDl3LDUGC8bjIztEp/0XzgXrqQE/yxlLa3F6xU 3HnqtKZpdrnOH1equGngzVd3u8SGrA6L0Ahr/ULm6vWndRGTLAWN1sNfLfpVSDABnwjv k7SpuEXyIS1DNY8plP8mdPqsNTksSXUZZZWox47JBH6+N9ndxZWHlMKSffd2lGJ7Uv7s +uWflXeupwUQMYWTRtxQ79he1/6xT6kVrO7KGO6IqyhwAXoSToKbMuFp+0Ybc0pQbbNC vp23r4bI4ESC2kX+4lGI8NXwnip8qZb3rIGJZDQNs0r+vDq5eNgrpj+mdB/iHunXgepg DCkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=esILVDWh9zMbzNI14yg6rc25e2uwVcR8Wf5tcDu2Am4=; b=T20Rz89CdTfG51RZoBEXwXoAZUkCGIGfPaw/M2fUwKkkXG3HZO0+BzdIiibd6+w+6O Ljzi+cLlQHU5inGyupN/2ohK/Mo8dhR1UnV3iLjSoZTsSeRiNWRyOrZaxbESZhrmBNRx yEzIX31vnmklDEkREnylgxvKLRjJjf2mB11e+C9fVpERirNNFNENqYRSxNWXe4/Wr8w8 WOE5QaPeNgRMm54EKl1so/xEy+o5X7V8MhZ/mSTPraRUHBbGoqzdYJUWcZYdqMmocylG 5qAH5IbSREaSreFOx25vDO5+ceuLuRx8cKHA623KKFYMX3L350hxHWiPjssDej1Xgs5q Og+A== X-Gm-Message-State: ALyK8tIWINY8lS0Hf+c/qHK1MRI/re8J30A6OfgT6LVRIKuwFYnlMNKHXSYI3i2tS6DqWA== X-Received: by 10.25.89.10 with SMTP id n10mr11059237lfb.89.1468595820678; Fri, 15 Jul 2016 08:17:00 -0700 (PDT) Received: from neopili.qtec.com (cpe.xe-3-0-1-778.vbrnqe10.dk.customer.tdc.net. [80.197.57.18]) by smtp.gmail.com with ESMTPSA id 62sm2041745ljj.3.2016.07.15.08.16.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 08:16:59 -0700 (PDT) From: Ricardo Ribalda Delgado To: auro Carvalho Chehab , Hans Verkuil , Laurent Pinchart , Sakari Ailus , Antti Palosaari , Guennadi Liakhovetski , Helen Mae Koike Fornazier , Philipp Zabel , Shuah Khan , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH 1/6] [media] videodev2.h Add HSV formats Date: Fri, 15 Jul 2016 17:16:51 +0200 Message-Id: <1468595816-31272-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468595816-31272-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468595816-31272-1-git-send-email-ricardo.ribalda@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- drivers/media/v4l2-core/v4l2-ioctl.c | 2 ++ include/uapi/linux/videodev2.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/drivers/media/v4l2-core/v4l2-ioctl.c b/drivers/media/v4l2-core/v4l2-ioctl.c index f899bf1c5fc0..54670cd59212 100644 --- a/drivers/media/v4l2-core/v4l2-ioctl.c +++ b/drivers/media/v4l2-core/v4l2-ioctl.c @@ -1238,6 +1238,8 @@ static void v4l_fill_fmtdesc(struct v4l2_fmtdesc *fmt) 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; diff --git a/include/uapi/linux/videodev2.h b/include/uapi/linux/videodev2.h index 724f43e69d03..c7fb760386cf 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -580,6 +580,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 */