Class JPEGCodec

All Implemented Interfaces:
Codec

public class JPEGCodec extends AbstractVideoCodec
JPEGCodec encodes a BufferedImage as a byte[] array.

Supported input/output formats:

  • @code VideoFormat} with BufferedImage.class, any width, any height, any depth.
  • VideoFormat with byte[].class, same width and height as input format, depth=24.
Author:
Werner Randelshofer
  • Constructor Details

    • JPEGCodec

      public JPEGCodec()
  • Method Details

    • process

      public int process(Buffer in, Buffer out)
      Description copied from interface: Codec
      Performs the media processing defined by this codec.

      Copies the data from the input buffer into the output buffer.

      Returns:
      A combination of processing flags.
    • setOutputFormat

      public Format setOutputFormat(Format f)
      Description copied from interface: Codec
      Sets the output format. Returns the format that was actually set. This is the closest format that the Codec supports. Returns null if the specified format is not supported and no reasonable match could be found.
      Specified by:
      setOutputFormat in interface Codec
      Overrides:
      setOutputFormat in class AbstractCodec
    • encode

      public int encode(Buffer in, Buffer out)
    • decode

      public int decode(Buffer in, Buffer out)