Class FrameFormat

  • All Implemented Interfaces:
    AutoCloseable

    public final class FrameFormat
    extends Object
    implements AutoCloseable
    FrameFormat class Note: close() must be called in order to release underlying resources held by the object.
    • Method Detail

      • createFourCCFormat

        public static FrameFormat createFourCCFormat​(char ch1,
                                                     char ch2,
                                                     char ch3,
                                                     char ch4,
                                                     int width,
                                                     int height,
                                                     int stride)
        Creates FrameFormat instance from FourCCFormat
        Parameters:
        ch1 - First character of the FourCC
        ch2 - Second character of the FourCC
        ch3 - Third character of the FourCC
        ch4 - Fourth character of the FourCC
        width - Width of the frame, in pixels
        height - Height of the frame, in pixels
        stride - Width of the frame, in bytes
        Returns:
        A FrameFormat instance
      • createRGBFormat

        public static FrameFormat createRGBFormat​(int bitsPerPixel,
                                                  int width,
                                                  int height,
                                                  int stride)
        Creates FrameFormat instance from RGB format
        Parameters:
        bitsPerPixel - Number of bits describing each pixel
        width - Width of the frame, in pixels
        height - Height of the frame, in pixels
        stride - Width of the frame, in bytes
        Returns:
        A FrameFormat instance
      • getFourCCAsString

        public String getFourCCAsString()
        Gets the image format's FOURCC as ASCII string
        Returns:
        The FOURCC format code as ASCII string
      • getFourCCAsInt

        public int getFourCCAsInt()
        Gets the image format's FOURCC as integer value
        Returns:
        The FOURCC format code as a integer
      • getHeight

        public int getHeight()
        Gets the image format's pixel height.
        Returns:
        The image pixel height.
      • getWidth

        public int getWidth()
        Gets the image format's pixel width.
        Returns:
        The image pixel width.
      • getStride

        public int getStride()
        Gets the image format's pixel stride.
        Returns:
        The image pixel stride.
      • getBitsPerPixel

        public int getBitsPerPixel()
        Gets the image format's bits per pixel value.
        Returns:
        The image's bits per pixel value.
      • setBitsPerPixel

        public void setBitsPerPixel​(int value)
        Sets the image format's bits per pixel value.
        Parameters:
        value - The image's bits per pixel value.
      • getProperties

        public PropertyCollection getProperties()
        Gets the collection of additional FrameFormat properties
        Returns:
        A property collection instance
      • getHandle

        public SafeHandle getHandle()
        Gets the internal native handle. TODO This is internal use only
        Returns:
        A SafeHandle instance
      • close

        public void close()
        Explicitly frees any external resource attached to the object
        Specified by:
        close in interface AutoCloseable