From: robert Date: Mon, 18 Sep 2023 13:29:00 +0000 (+0000) Subject: The CTA-861 standards have been updated to refer to opRGB instead X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bbcb3b50a315e6db802d1e9d9ae2d304a56851cd;p=openbsd The CTA-861 standards have been updated to refer to opRGB instead of AdobeRGB. The official standard is in fact named opRGB, so switch to that. The two old defines referring to ADOBERGB in the public API are put under #ifndef _KERNEL and a comment mentions that they are deprecated. This keeps us in sync with the linux header. ok feinerer@, mpi@, deraadt@ --- diff --git a/sys/sys/videoio.h b/sys/sys/videoio.h index 32d94092a77..f74dd53d9e3 100644 --- a/sys/sys/videoio.h +++ b/sys/sys/videoio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: videoio.h,v 1.18 2023/08/15 08:27:30 miod Exp $ */ +/* $OpenBSD: videoio.h,v 1.19 2023/09/18 13:29:00 robert Exp $ */ /* * Video for Linux Two header file * @@ -1214,8 +1214,8 @@ enum v4l2_colorspace { /* For RGB colorspaces such as produces by most webcams. */ V4L2_COLORSPACE_SRGB = 8, - /* AdobeRGB colorspace */ - V4L2_COLORSPACE_ADOBERGB = 9, + /* opRGB colorspace */ + V4L2_COLORSPACE_OPRGB = 9, /* BT.2020 colorspace, used for UHDTV. */ V4L2_COLORSPACE_BT2020 = 10, @@ -1247,7 +1247,7 @@ enum v4l2_xfer_func { * * V4L2_COLORSPACE_SRGB, V4L2_COLORSPACE_JPEG: V4L2_XFER_FUNC_SRGB * - * V4L2_COLORSPACE_ADOBERGB: V4L2_XFER_FUNC_ADOBERGB + * V4L2_COLORSPACE_OPRGB: V4L2_XFER_FUNC_OPRGB * * V4L2_COLORSPACE_SMPTE240M: V4L2_XFER_FUNC_SMPTE240M * @@ -1258,7 +1258,7 @@ enum v4l2_xfer_func { V4L2_XFER_FUNC_DEFAULT = 0, V4L2_XFER_FUNC_709 = 1, V4L2_XFER_FUNC_SRGB = 2, - V4L2_XFER_FUNC_ADOBERGB = 3, + V4L2_XFER_FUNC_OPRGB = 3, V4L2_XFER_FUNC_SMPTE240M = 4, V4L2_XFER_FUNC_NONE = 5, V4L2_XFER_FUNC_DCI_P3 = 6, @@ -1270,7 +1270,7 @@ enum v4l2_xfer_func { * This depends on the colorspace. */ #define V4L2_MAP_XFER_FUNC_DEFAULT(colsp) \ - ((colsp) == V4L2_COLORSPACE_ADOBERGB ? V4L2_XFER_FUNC_ADOBERGB : \ + ((colsp) == V4L2_COLORSPACE_OPRGB ? V4L2_XFER_FUNC_OPRGB : \ ((colsp) == V4L2_COLORSPACE_SMPTE240M ? V4L2_XFER_FUNC_SMPTE240M : \ ((colsp) == V4L2_COLORSPACE_DCI_P3 ? V4L2_XFER_FUNC_DCI_P3 : \ ((colsp) == V4L2_COLORSPACE_RAW ? V4L2_XFER_FUNC_NONE : \ @@ -1284,7 +1284,7 @@ enum v4l2_ycbcr_encoding { * * V4L2_COLORSPACE_SMPTE170M, V4L2_COLORSPACE_470_SYSTEM_M, * V4L2_COLORSPACE_470_SYSTEM_BG, V4L2_COLORSPACE_SRGB, - * V4L2_COLORSPACE_ADOBERGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 + * V4L2_COLORSPACE_OPRGB and V4L2_COLORSPACE_JPEG: V4L2_YCBCR_ENC_601 * * V4L2_COLORSPACE_REC709 and V4L2_COLORSPACE_DCI_P3: V4L2_YCBCR_ENC_709 * @@ -1353,7 +1353,7 @@ enum v4l2_quantization { /* * The default for R'G'B' quantization is always full range, except * for the BT2020 colorspace. For Y'CbCr the quantization is always - * limited range, except for COLORSPACE_JPEG, SRGB, ADOBERGB, + * limited range, except for COLORSPACE_JPEG, SRGB, OPRGB, * XV601 or XV709: those are full range. */ V4L2_QUANTIZATION_DEFAULT = 0, @@ -1371,9 +1371,20 @@ enum v4l2_quantization { V4L2_QUANTIZATION_LIM_RANGE : \ (((is_rgb_or_hsv) || (ycbcr_enc) == V4L2_YCBCR_ENC_XV601 || \ (ycbcr_enc) == V4L2_YCBCR_ENC_XV709 || (colsp) == V4L2_COLORSPACE_JPEG) || \ - (colsp) == V4L2_COLORSPACE_ADOBERGB || (colsp) == V4L2_COLORSPACE_SRGB ? \ + (colsp) == V4L2_COLORSPACE_OPRGB || (colsp) == V4L2_COLORSPACE_SRGB ? \ V4L2_QUANTIZATION_FULL_RANGE : V4L2_QUANTIZATION_LIM_RANGE)) +/* + * Deprecated names for opRGB colorspace (IEC 61966-2-5) + * + * WARNING: Please don't use these deprecated defines in your code, as + * there is a chance we have to remove them in the future. + */ +#ifndef _KERNEL +#define V4L2_COLORSPACE_ADOBERGB V4L2_COLORSPACE_OPRGB +#define V4L2_XFER_FUNC_ADOBERGB V4L2_XFER_FUNC_OPRGB +#endif + enum v4l2_priority { V4L2_PRIORITY_UNSET = 0, /* not initialized */ V4L2_PRIORITY_BACKGROUND = 1,