video-color: add Adobe RGB primaries and transfer function
authorWim Taymans <wtaymans@redhat.com>
Thu, 21 Jan 2016 09:45:40 +0000 (10:45 +0100)
committerWim Taymans <wtaymans@redhat.com>
Thu, 21 Jan 2016 09:45:40 +0000 (10:45 +0100)
gst-libs/gst/video/video-color.c
gst-libs/gst/video/video-color.h

index 519962d..f973349 100644 (file)
@@ -282,7 +282,9 @@ static const GstVideoColorPrimariesInfo color_primaries[] = {
   {GST_VIDEO_COLOR_PRIMARIES_FILM, WP_C, 0.681, 0.319, 0.243, 0.692, 0.145,
       0.049},
   {GST_VIDEO_COLOR_PRIMARIES_BT2020, WP_D65, 0.708, 0.292, 0.170, 0.797, 0.131,
-      0.046}
+      0.046},
+  {GST_VIDEO_COLOR_PRIMARIES_ADOBERGB, WP_D65, 0.64, 0.33, 0.21, 0.71, 0.15,
+      0.06}
 };
 
 /**
@@ -459,6 +461,9 @@ gst_video_color_transfer_encode (GstVideoTransferFunction func, gdouble val)
       else
         res = 1.0993 * pow (val, 0.45) - 0.0993;
       break;
+    case GST_VIDEO_TRANSFER_ADOBERGB:
+      res = pow (val, 1.0 / 2.19921875);
+      break;
   }
   return res;
 }
@@ -544,6 +549,9 @@ gst_video_color_transfer_decode (GstVideoTransferFunction func, gdouble val)
       else
         res = pow ((val + 0.0993) / 1.0993, 1.0 / 0.45);
       break;
+    case GST_VIDEO_TRANSFER_ADOBERGB:
+      res = pow (val, 2.19921875);
+      break;
   }
   return res;
 }
index 99fa017..ecee0d3 100644 (file)
@@ -88,6 +88,7 @@ gboolean gst_video_color_matrix_get_Kr_Kb (GstVideoColorMatrix matrix, gdouble *
  * @GST_VIDEO_TRANSFER_BT2020_12: Gamma 2.2 curve with a linear segment in the lower
  *                                range. Used for BT.2020 with 12 bits per
  *                                component. Since: 1.6.
+ * @GST_VIDEO_TRANSFER_ADOBERGB: Gamma 2.19921875. Since: 1.8
  *
  * The video transfer function defines the formula for converting between
  * non-linear RGB (R'G'B') and linear RGB
@@ -104,7 +105,8 @@ typedef enum {
   GST_VIDEO_TRANSFER_GAMMA28,
   GST_VIDEO_TRANSFER_LOG100,
   GST_VIDEO_TRANSFER_LOG316,
-  GST_VIDEO_TRANSFER_BT2020_12
+  GST_VIDEO_TRANSFER_BT2020_12,
+  GST_VIDEO_TRANSFER_ADOBERGB
 } GstVideoTransferFunction;
 
 gdouble      gst_video_color_transfer_encode (GstVideoTransferFunction func, gdouble val);
@@ -120,6 +122,7 @@ gdouble      gst_video_color_transfer_decode (GstVideoTransferFunction func, gdo
  * @GST_VIDEO_COLOR_PRIMARIES_SMPTE240M: SMPTE240M primaries
  * @GST_VIDEO_COLOR_PRIMARIES_FILM: Generic film
  * @GST_VIDEO_COLOR_PRIMARIES_BT2020: BT2020 primaries. Since: 1.6.
+ * @GST_VIDEO_COLOR_PRIMARIES_ADOBERGB: Adobe RGB primaries. Since: 1.8
  *
  * The color primaries define the how to transform linear RGB values to and from
  * the CIE XYZ colorspace.
@@ -132,7 +135,8 @@ typedef enum {
   GST_VIDEO_COLOR_PRIMARIES_SMPTE170M,
   GST_VIDEO_COLOR_PRIMARIES_SMPTE240M,
   GST_VIDEO_COLOR_PRIMARIES_FILM,
-  GST_VIDEO_COLOR_PRIMARIES_BT2020
+  GST_VIDEO_COLOR_PRIMARIES_BT2020,
+  GST_VIDEO_COLOR_PRIMARIES_ADOBERGB
 } GstVideoColorPrimaries;
 
 /**