From patchwork Sat Jul 16 10:41:48 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: 9233113 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 87D92608A7 for ; Sat, 16 Jul 2016 10:42:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 79C2026252 for ; Sat, 16 Jul 2016 10:42:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6E2792656B; Sat, 16 Jul 2016 10:42:44 +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 C6B9526252 for ; Sat, 16 Jul 2016 10:42:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751568AbcGPKmI (ORCPT ); Sat, 16 Jul 2016 06:42:08 -0400 Received: from mail-lf0-f68.google.com ([209.85.215.68]:33046 "EHLO mail-lf0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751430AbcGPKmF (ORCPT ); Sat, 16 Jul 2016 06:42:05 -0400 Received: by mail-lf0-f68.google.com with SMTP id f93so8370851lfi.0; Sat, 16 Jul 2016 03:42:03 -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=ibbQjlUPJNJAd1/eAZzFCYN0MQVX+Ke08p4gPZjrsu+0nsS34X/0WhMIVn/1/ON2BR FYwROh1nSQ0aUP6AAtKUAiRNNohIe9/j5u6iAEG96RubmUZhROM54388A/f2naUCFJ03 MDpLQ/p4tvMhucbEBPU8lU6A106j9eLGKSNL52UGeMq4HKz4+LvC/WtAngymHF8hwDnN HtrmtJE50ncoLP8pJJfE2Wooa2O8iKIhSgZLdmEbPMOB+2fgQkVnQZLqi1EaoCN2Y7Hn cbkkCDlqDkPUlaKAJ7QL7pKI+YxDHdvmK406detZtKiZLRvzFcgURvBZqtP4aGjdjO/o 0nSg== 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=aGX9nMlbW9TQ3Kt16nqIxMLpT7wz0e8xtLzNBUkZCKeXSEqJz8QYWoZCGgCuYogckC ot2Mq0v9Qg6EqpeZv9ZkLUSEnmb+aOWSDFCvWRK6Yd+qoDUt9Hvh6PZk7THXPbGyvsjM M6dRNFk738g0FDOXp1pYFiqupyGBa8/k6U7xu6RU7eE/jK/p2G2sdzO3CAwaM8oZ4DBY 51ApVeKGWLTKnT5IIWgdzRpEB/3Kkeuop8Y5jziq94GvytPMasSnGRzj7PZgyM4IveFu 75nmJtI+Sb6PGBgPUdb6EEB7VX3IVNoRS9SXVQxnhBNBeTGdAlxfvh+syOH+9bNqNv98 zMpQ== X-Gm-Message-State: ALyK8tIFLxbLCGFUs2pNA7bTXXeq1+uhtlsVM7M8bV1unXkMhc+WKkKOb7jBHpI+MqfJwA== X-Received: by 10.25.153.203 with SMTP id b194mr2947537lfe.185.1468665723002; Sat, 16 Jul 2016 03:42:03 -0700 (PDT) Received: from localhost.localdomain (x1-6-74-44-01-e3-62-1a.cpe.webspeed.dk. [80.167.115.215]) by smtp.gmail.com with ESMTPSA id f22sm1779457lji.13.2016.07.16.03.42.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Jul 2016 03:42:01 -0700 (PDT) From: Ricardo Ribalda Delgado To: Jonathan Corbet , Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Helen Mae Koike Fornazier , Laurent Pinchart , Antti Palosaari , Philipp Zabel , Shuah Khan , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v3 1/9] [media] videodev2.h Add HSV formats Date: Sat, 16 Jul 2016 12:41:48 +0200 Message-Id: <1468665716-10178-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468665716-10178-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468665716-10178-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 */