Enum ImageFormats

java.lang.Object
java.lang.Enum<ImageFormats>
com.github.kokorin.jaffree.ffmpeg.ImageFormats
All Implemented Interfaces:
ImageFormat, Serializable, Comparable<ImageFormats>, java.lang.constant.Constable

public enum ImageFormats extends Enum<ImageFormats> implements ImageFormat
Standard ImageFormats used by FrameInput and FrameOutput.
  • Enum Constant Details

    • BGR24

      public static final ImageFormats BGR24
      3-byte format using 1 byte per each color component.
    • ABGR

      public static final ImageFormats ABGR
      4-byte format using 1 byte per each color component and 1 byte for transparency.
  • Method Details

    • values

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

      public static ImageFormats valueOf(String name)
      Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (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 type has no constant with the specified name
      NullPointerException - if the argument is null
    • getPixelFormat

      public String getPixelFormat()
      Specified by:
      getPixelFormat in interface ImageFormat
      Returns:
      pixel format
    • getBytesPerPixel

      public int getBytesPerPixel()
      Specified by:
      getBytesPerPixel in interface ImageFormat
      Returns:
      bytes per pixel
    • getFourCC

      public byte[] getFourCC()
      Returns FOURCC (four character code).
      Specified by:
      getFourCC in interface ImageFormat
      Returns:
      FOURCC
      See Also:
    • toImage

      public BufferedImage toImage(byte[] data, int width, int height)
      Converts byte array to BufferedImage of specified size.
      Specified by:
      toImage in interface ImageFormat
      Parameters:
      data - raw image data
      width - image width
      height - image height
      Returns:
      BufferedImage
    • toBytes

      public byte[] toBytes(BufferedImage image)
      Converts BufferedImage to raw image data.
      Specified by:
      toBytes in interface ImageFormat
      Parameters:
      image - image
      Returns:
      raw data