Enum Class VideoColorMatrix

java.lang.Object
java.lang.Enum<VideoColorMatrix>
org.freedesktop.gstreamer.video.VideoColorMatrix
All Implemented Interfaces:
Serializable, Comparable<VideoColorMatrix>, Constable, Enumeration

@Generated("org.javagi.JavaGI") public enum VideoColorMatrix extends Enum<VideoColorMatrix> implements Enumeration
The color matrix is used to convert between Y'PbPr and non-linear RGB (R'G'B')
  • Nested Class Summary

    Nested classes/interfaces inherited from class Enum

    Enum.EnumDesc<E>
  • Enum Constant Summary

    Enum Constants
    Enum Constant
    Description
    ITU-R BT.2020 color matrix.
    ITU-R BT.601 color matrix, also SMPTE170M / ITU-R BT1358 525 / ITU-R BT1700 NTSC
    ITU-R BT.709 color matrix, also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
    FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
    identity matrix.
    SMPTE 240M color matrix
    unknown matrix
  • Method Summary

    Modifier and Type
    Method
    Description
    fromIso(int value)
    Converts the value to the GstVideoColorMatrix The matrix coefficients (MatrixCoefficients) value is defined by "ISO/IEC 23001-8 Section 7.3 Table 4" and "ITU-T H.273 Table 4".
    boolean
    Get the coefficients used to convert between Y'PbPr and R'G'B' using matrix.
    static @Nullable Type
    Get the GType of the VideoColorMatrix class.
    int
    Get the numeric value of this enum
    of(int value)
    Create a new VideoColorMatrix for the provided value
    of(MemorySegment address)
    Create a new VideoColorMatrix for the value in the provided memory address.
    int
    Converts GstVideoColorMatrix to the "matrix coefficients" (MatrixCoefficients) value defined by "ISO/IEC 23001-8 Section 7.3 Table 4" and "ITU-T H.273 Table 4".
    Returns the enum constant of this class with the specified name.
    Returns an array containing the constants of this enum class, in the order they are declared.

    Methods inherited from class Object

    getClass, notify, notifyAll, wait, wait, wait
  • Enum Constant Details

    • UNKNOWN

      public static final VideoColorMatrix UNKNOWN
      unknown matrix
    • RGB

      public static final VideoColorMatrix RGB
      identity matrix. Order of coefficients is actually GBR, also IEC 61966-2-1 (sRGB)
    • FCC

      public static final VideoColorMatrix FCC
      FCC Title 47 Code of Federal Regulations 73.682 (a)(20)
    • BT709

      public static final VideoColorMatrix BT709
      ITU-R BT.709 color matrix, also ITU-R BT1361 / IEC 61966-2-4 xvYCC709 / SMPTE RP177 Annex B
    • BT601

      public static final VideoColorMatrix BT601
      ITU-R BT.601 color matrix, also SMPTE170M / ITU-R BT1358 525 / ITU-R BT1700 NTSC
    • SMPTE240M

      public static final VideoColorMatrix SMPTE240M
      SMPTE 240M color matrix
    • BT2020

      public static final VideoColorMatrix BT2020
      ITU-R BT.2020 color matrix. Since: 1.6
  • Method Details

    • values

      public static VideoColorMatrix[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static VideoColorMatrix valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • of

      public static VideoColorMatrix of(int value)
      Create a new VideoColorMatrix for the provided value
      Parameters:
      value - the enum value
      Returns:
      the enum for the provided value
    • getValue

      public int getValue()
      Get the numeric value of this enum
      Specified by:
      getValue in interface Enumeration
      Returns:
      the enum value
    • of

      public static VideoColorMatrix of(MemorySegment address)
      Create a new VideoColorMatrix for the value in the provided memory address.
      Parameters:
      address - the memory address holding a enum value
      Returns:
      the enum for the value in the provided memory address
    • getType

      public static @Nullable Type getType()
      Get the GType of the VideoColorMatrix class.
      Returns:
      the GType
    • fromIso

      public static VideoColorMatrix fromIso(int value)
      Converts the value to the GstVideoColorMatrix The matrix coefficients (MatrixCoefficients) value is defined by "ISO/IEC 23001-8 Section 7.3 Table 4" and "ITU-T H.273 Table 4". "H.264 Table E-5" and "H.265 Table E.5" share the identical values.
      Parameters:
      value - a ITU-T H.273 matrix coefficients value
      Returns:
      the matched GstVideoColorMatrix
      Since:
      1.18
    • getKrKb

      public boolean getKrKb(Out<Double> Kr, Out<Double> Kb)

      Get the coefficients used to convert between Y'PbPr and R'G'B' using matrix.

      When:

        0.0 <= [Y',R',G',B'] <= 1.0)
        (-0.5 <= [Pb,Pr] <= 0.5)
      

      the general conversion is given by:

        Y' = Kr*R' + (1-Kr-Kb)*G' + Kb*B'
        Pb = (B'-Y')/(2*(1-Kb))
        Pr = (R'-Y')/(2*(1-Kr))
      

      and the other way around:

        R' = Y' + Cr*2*(1-Kr)
        G' = Y' - Cb*2*(1-Kb)*Kb/(1-Kr-Kb) - Cr*2*(1-Kr)*Kr/(1-Kr-Kb)
        B' = Y' + Cb*2*(1-Kb)
      
      Parameters:
      Kr - result red channel coefficient
      Kb - result blue channel coefficient
      Returns:
      TRUE if this VideoColorMatrix was a YUV color format and Kr and Kb contain valid values.
      Since:
      1.6
    • toIso

      public int toIso()
      Converts GstVideoColorMatrix to the "matrix coefficients" (MatrixCoefficients) value defined by "ISO/IEC 23001-8 Section 7.3 Table 4" and "ITU-T H.273 Table 4". "H.264 Table E-5" and "H.265 Table E.5" share the identical values.
      Returns:
      The value of ISO/IEC 23001-8 matrix coefficients.
      Since:
      1.18