@@ -811,6 +811,40 @@ class OIIO_API ImageSpec {
811811 deep = other.deep ;
812812 }
813813
814+ // / Set the "oiio:CICP" attribute to the given values. The `pri`, `tc`, `mtx`,
815+ // / and `vfr` values are the CICP parameters, which are used to describe
816+ // / aspects of the color encoding of the image, as defined in ITU-T H.273.
817+ // /
818+ // / @param pri
819+ // / An integer representing the color primaries.
820+ // / @param tc
821+ // / An integer representing the transfer characteristics.
822+ // / @param mtx
823+ // / An integer representing the matrix coefficients. RGB encodings
824+ // / typically use 0 (identity matrix).
825+ // / @param vfr
826+ // / An integer indicating whether the image is "full range" (Typically
827+ // / true of RGB encodings)
828+ // /
829+ // / @version 3.0
830+ void set_cicp (int pri, int trc, int mtx=0 , int vfr=1 );
831+ // / Set the "oiio:CICP" attribute to the given values. The `cicp` string
832+ // / is a comma-delimeted list of integers representing the CICP parameters.
833+ // / The `cicp` string should be in the format "pri,tc,mtx,vfr", where
834+ // / `pri`, `trc`, `mtx`, and `vfr` are integers representing the color
835+ // / primaries, transfer characteristics, matrix coefficients, and
836+ // / video full range flag, respectively. If the `cicp` string is empty,
837+ // / the "oiio:CICP" attribute will be removed from the `ImageSpec`.
838+ // / The `cicp` string may also contain commas (",") without any
839+ // / integer value specified beforehand, in which case the
840+ // / corresponding CICP parameter will fall back to its current value,
841+ // / or to the default value (of {0, 0, 0, 1}) if there is no current value.
842+ // / For example, `",,,0"` would set the "video full range flag" to 0 to
843+ // / indicate a "narrow range" encoding, while keeping the other three
844+ // / parameters unchanged.
845+ // / @param cicp
846+ void set_cicp (string_view cicp);
847+
814848 // / Set the metadata to presume that color space is `name` (or to assume
815849 // / nothing about the color space if `name` is empty). The core operation
816850 // / is to set the "oiio:ColorSpace" attribute, but it also removes or
@@ -2157,6 +2191,9 @@ class OIIO_API ImageOutput {
21572191 // / Does this format allow 0x0 sized images, i.e. an image file
21582192 // / with metadata only and no pixels?
21592193 // /
2194+ // / - `"cicp"` :
2195+ // / Does this format support embedding CICP metadata?
2196+ // /
21602197 // / This list of queries may be extended in future releases. Since this
21612198 // / can be done simply by recognizing new query strings, and does not
21622199 // / require any new API entry points, addition of support for new
@@ -3366,6 +3403,22 @@ OIIO_API void set_colorspace(ImageSpec& spec, string_view name);
33663403OIIO_API void set_colorspace_rec709_gamma (ImageSpec& spec, float gamma);
33673404
33683405
3406+
3407+ // /// Set the spec's metadata to reflect a custom set of CICP values.
3408+ // /// The core operation is to set the "oiio:CICP" attribute to an
3409+ // /// uint8[4] array. Currently, the CICP attribute must be
3410+ // /// manually maintained by the user; but OCIO-2.5 will offer
3411+ // /// a way for config authors to specify CICP values for a
3412+ // /// color space, and it will be possible to use this function
3413+ // /// in ImageBufAlgos that mutate "oiio:ColorSpace".
3414+ // ///
3415+ // /// @version 3.0
3416+ // OIIO_API void set_cicp(ImageSpec& spec, int transfer_characteristic,
3417+ // int color_primaries, int matrix_coefficients,
3418+ // int video_full_range_flag);
3419+
3420+
3421+
33693422// / Are the two named color spaces equivalent, based on the default color
33703423// / config in effect?
33713424// /
0 commit comments