From patchwork Mon Jul 18 12:42:05 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: 9234551 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 25D426075D for ; Mon, 18 Jul 2016 12:46:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 171E41FFC7 for ; Mon, 18 Jul 2016 12:46:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0BBDC2522B; Mon, 18 Jul 2016 12:46:38 +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 A713B1FFC7 for ; Mon, 18 Jul 2016 12:46:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752012AbcGRMqW (ORCPT ); Mon, 18 Jul 2016 08:46:22 -0400 Received: from mail-lf0-f66.google.com ([209.85.215.66]:35156 "EHLO mail-lf0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751875AbcGRMmW (ORCPT ); Mon, 18 Jul 2016 08:42:22 -0400 Received: by mail-lf0-f66.google.com with SMTP id l89so11230350lfi.2; Mon, 18 Jul 2016 05:42:21 -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=HFyVY71SG/wA5DFlq0ZXzYdIz6HVrERKXtLi+42JAJKGFMqjAvbmR3YeV7SBWS5Tnj NFsjiawWAFWVAENmD3a2eUqzbi6tqJrwnLZQSgViW8ifJYGXuzb9rJADzl9Vrs4D29GO k6cRXCSiFdrbTCfcXPS74HDCuSAQnfS1lG4NoPwWdRimoo9EPJvPwrgFs0O6N0xd4I+m dfOkx4Zk2nM5eWVk7+Fpwn8k9dUkUzT60FSViEgoPnHbeNalxkWzsAYzg95n5VB0bzRs UgykJU0G/7a2eQzXWCBUFR34xkIdBRxDaYBH8AERh/YeENzJllvlBelU7NwIqKLRH/eo WlIg== 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=bIq6xnRaCqNKJJNHo0U4t1Cbm5gJRGnY4vKcQOUlwx/STg0MRRIVR89n/FthFcPMXz LxgQIFtAsY/D4d6f6kzSYTZmxe/YX+5Sp4RAIS0/6Mv9WrCJaZ6PlsacZ44PTIaPrThD QC7BDg+d+q8AV1B6h/zelQylKhPf8qSDvB1J3kYIXbTLDYRWYShVM3x+cXmUzk5n4+SW 3/8kCXvosbDduhdKcYsIduTiAVNtK5COPhvCiS4fpFxpqldcOp4Ysq7Jg1BHmoGPqox6 G4zX+lvLkhcRF+YDrj/f9S1ikfuPLsy9bDb7qiUrQo51K70G1Lwt11i4Sx+LXas0CLCC co7g== X-Gm-Message-State: ALyK8tKGsM2Rk6RLxWLk6TbtUl6I27n3Z7cGK0M1QAXcIDPuMhxmLyPGVy3Svw05c+lzjQ== X-Received: by 10.25.210.75 with SMTP id j72mr11114411lfg.4.1468845740734; Mon, 18 Jul 2016 05:42:20 -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 205sm4571672ljj.47.2016.07.18.05.42.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Jul 2016 05:42:19 -0700 (PDT) From: Ricardo Ribalda Delgado To: Jonathan Corbet , Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Laurent Pinchart , Helen Mae Koike Fornazier , 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 v4 01/12] [media] videodev2.h Add HSV formats Date: Mon, 18 Jul 2016 14:42:05 +0200 Message-Id: <1468845736-19651-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1468845736-19651-1-git-send-email-ricardo.ribalda@gmail.com> References: <1468845736-19651-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 */