From patchwork Fri Jul 15 16:13:14 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: 9232275 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 8785D6075D for ; Fri, 15 Jul 2016 16:15:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 77DBF27F94 for ; Fri, 15 Jul 2016 16:15:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6A90B27FA4; Fri, 15 Jul 2016 16:15:02 +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 8D08527F96 for ; Fri, 15 Jul 2016 16:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751914AbcGOQO7 (ORCPT ); Fri, 15 Jul 2016 12:14:59 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:35322 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751424AbcGOQN1 (ORCPT ); Fri, 15 Jul 2016 12:13:27 -0400 Received: by mail-lf0-f68.google.com with SMTP id l89so7295201lfi.2; Fri, 15 Jul 2016 09:13:26 -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=uKy0rWy4mNWnA0Dns/ZdvWNlofwYtt+BeNzxwf/WdTU=; b=WB5LZVQjHpnDntGqBnsUkVSXeKu30fauriZRHp+VBtTvSE+8kIgaopgHk25iqjvgKK YCmzyIzDOHQqAVZERLzmeftEB77x+6kv3/PpglCxu0V1ArW1BYkWonnkr5P0tSd+cKIa hl9w28vw289OQnqStKRA5K6ym0WJ4nsXwP9zC6y8JrI5v8Z558cYW0eJOgdU6VO7NpjV 4AMhcgxaKadDyAvJIveqX/0jEx1CijDt5SBgA20IkMTLNgSW58kFeHlYvSoPlzxo/Ajg 4xFLozokxua2nQsTC+RDIeZHxEY20LFkFRiSVY8xgo75S8qoRZZVB2mmKYaGKjQO9mDu Voqg== 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=uKy0rWy4mNWnA0Dns/ZdvWNlofwYtt+BeNzxwf/WdTU=; b=jT44IWxpwqPKWYrFs2wu0z+5mLPxDAMb2RB+yKSv3PseKKRUtr4kBI4ChBXfpXrzeW pU+4ixtubd9AbOIGByMZSeygJCDaBNDAyDbVjfihl8KcZ4nVG+aXWkG3JUrauE27qAvV VRbga4trqmIkJGz6K950cwudzhqnfuelfCoBChgnsQ4R2LfAz9XWMstdsl5Dw3OPS7ol 4x8chmkSgKDOeG5ISeg7YyQKbJNxUlGC1eoJ2WtS0xe5JTxVxaTMUkxK1CSOKLjK+Qss r3cQvJcw4HJ8DUFgVHE0U9uOHZErkUhk5kO07aMOfrTE76puvjVhtogDQyXuy8vcJnN9 GwZw== X-Gm-Message-State: ALyK8tIH1o2eiZsZQd2XhHSqEgJjelhQnBacYGQZLo5JfHgEtHI7vdndbWX0fAvUp+rkug== X-Received: by 10.46.32.10 with SMTP id g10mr10533845ljg.42.1468599205194; Fri, 15 Jul 2016 09:13:25 -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 j12sm2051234lfb.37.2016.07.15.09.13.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 15 Jul 2016 09:13:23 -0700 (PDT) From: Ricardo Ribalda Delgado To: Mauro 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 v2 1/6] [media] videodev2.h Add HSV formats Date: Fri, 15 Jul 2016 18:13:14 +0200 Message-Id: <1468599199-5902-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468599199-5902-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468599199-5902-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 28e5be2c2eef..4b67ad06efb7 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 */