From patchwork Thu Aug 18 14:33:27 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: 9288279 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 AD319607FF for ; Thu, 18 Aug 2016 14:35:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9F1AF2922D for ; Thu, 18 Aug 2016 14:35:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 93AD32929F; Thu, 18 Aug 2016 14:35: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 3DE7C2922D for ; Thu, 18 Aug 2016 14:35:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1945967AbcHROft (ORCPT ); Thu, 18 Aug 2016 10:35:49 -0400 Received: from mail-lf0-f67.google.com ([209.85.215.67]:32955 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1768136AbcHROfq (ORCPT ); Thu, 18 Aug 2016 10:35:46 -0400 Received: by mail-lf0-f67.google.com with SMTP id f93so1879401lfi.0; Thu, 18 Aug 2016 07:33:44 -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=Z0v3FD9PTycv5YY9wTB2Rl9E84G1al+Yv5JyOQ2o2DQ=; b=QhDZioANT8nHcZrWwpzmxWxZdA2Vv1nLxwTsDQlV1lwqGZguXb7QCK/i/IU29RUUhC bNuSqdptnMksLDuADtAHXhpKmyMmYq6cNUgKKLMa0gNMIpM9EFSC8oF+rb+Ta+9Pv/HR PTCmc7spoCU02izj4X/kkdsEo32viUn//r+UszH6v5Mr70SCX5riwgfr2eNO3bifJ797 vTljPOBx5MXHXTReRPPrJYoz3HKHnDhT2BSat5oR8pdtu2Y3K54YsIGyA1917QPZtbVR DVxZYKKHinCU/TI4gMbgWHiLTMVRkpf0HNuxbBZyRZkJYKNJB/quxItuWJoL7O7CVKhv 7pVw== 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=Z0v3FD9PTycv5YY9wTB2Rl9E84G1al+Yv5JyOQ2o2DQ=; b=RW5THDl7m9WNMstCnOyF3uieQY/xcikewmemTM7aKAso2O1CkqIjU5gh0CdUk1nLo/ r10m+kneCv2/Vjs4H+0vu32CPbCvVMCWLpVV8FeaEAq/Vv/deQ3a1W0OhXSyJn56T5/X WU1qfGL7bRa7pcRdqGckQ3AS1Rv8wTh/tYtYWHC+Q7Wq/I32kWKZkqC0pvXHea91xQik zZpXYnv8V6rvyCzO1ZVk2hTYc//4muNih0e0sPcjlxCg2D8RgVrjW7Op6wWtW3tRGhdP 09ocTGPeeC3khXxkjj3oERLSxkVENA4I1sRoyXpteByxL93lWXEzmzbPg9el/wcJeDSK B9vw== X-Gm-Message-State: AEkoouudR3iA7BYVNco2udi2y8jjdDG1+8Vzkc7EJhFxpNS614/xjp5wUPNLwIqq9bMPeg== X-Received: by 10.46.71.147 with SMTP id u141mr693524lja.15.1471530823376; Thu, 18 Aug 2016 07:33:43 -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 p21sm389218lfp.4.2016.08.18.07.33.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Aug 2016 07:33:42 -0700 (PDT) From: Ricardo Ribalda Delgado To: Mauro Carvalho Chehab , Hans Verkuil , Markus Heiser , Laurent Pinchart , Helen Mae Koike Fornazier , Antti Palosaari , Philipp Zabel , Shuah Khan , linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Ricardo Ribalda Delgado Subject: [PATCH v5 01/12] [media] videodev2.h Add HSV formats Date: Thu, 18 Aug 2016 16:33:27 +0200 Message-Id: <1471530818-7928-2-git-send-email-ricardo.ribalda@gmail.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1471530818-7928-1-git-send-email-ricardo.ribalda@gmail.com> References: <1471530818-7928-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 51a0fa144392..16b211f7212b 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 8c5468cf43e3..58ed8aedc196 100644 --- a/include/uapi/linux/videodev2.h +++ b/include/uapi/linux/videodev2.h @@ -585,6 +585,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 */