public class RawCodec extends AbstractVideoCodec
RawCodec encodes a BufferedImage as a byte[] array.
This codec does not encode the color palette of an image. This must be done separately.
The pixels of a frame are written row by row from top to bottom and from the left to the right.
Supported input formats:
VideoFormat onlyWith BufferedImage.class, any width, any height,
depth=4.
VideoFormat onlyWith byte[].class, same width and height as input
format, depth=4.
inputFormat, inputFormats, name, outputFormat, outputFormatsCODEC_FAILED, CODEC_INPUT_NOT_CONSUMED, CODEC_OK, CODEC_OUTPUT_NOT_FILLED| Constructor and Description |
|---|
RawCodec() |
| Modifier and Type | Method and Description |
|---|---|
int |
process(Buffer in,
Buffer out)
Performs the media processing defined by this codec.
|
void |
writeKey16(OutputStream out,
short[] data,
int width,
int height,
int offset,
int scanlineStride)
Encodes a 24-bit key frame.
|
void |
writeKey24(OutputStream out,
BufferedImage image)
Encodes a 24-bit key frame.
|
void |
writeKey24(OutputStream out,
int[] data,
int width,
int height,
int offset,
int scanlineStride)
Encodes a 24-bit key frame.
|
void |
writeKey32(OutputStream out,
int[] data,
int width,
int height,
int offset,
int scanlineStride)
Encodes a 24-bit key frame.
|
void |
writeKey8(OutputStream out,
byte[] data,
int width,
int height,
int offset,
int scanlineStride)
Encodes an 8-bit key frame.
|
copyImage, getARGB32, getBufferedImage, getIndexed8, getRGB15, getRGB16, getRGB24, writeInt24, writeInt24LE, writeInts24, writeInts24LEgetInputFormat, getInputFormats, getName, getOutputFormat, getOutputFormats, reset, setInputFormat, setOutputFormat, toStringpublic void writeKey8(OutputStream out, byte[] data, int width, int height, int offset, int scanlineStride) throws IOException
out - The output stream.data - The image data.width - The width of the image in data elements.height - The height of the image in data elements.offset - The offset to the first pixel in the data array.scanlineStride - The number to append to offset to get to the next scanline.IOExceptionpublic void writeKey16(OutputStream out, short[] data, int width, int height, int offset, int scanlineStride) throws IOException
out - The output stream.data - The image data.width - The width of the image in data elements.height - The height of the image in data elements.offset - The offset to the first pixel in the data array.scanlineStride - The number to append to offset to get to the next scanline.IOExceptionpublic void writeKey24(OutputStream out, int[] data, int width, int height, int offset, int scanlineStride) throws IOException
out - The output stream.data - The image data.width - The width of the image in data elements.height - The height of the image in data elements.offset - The offset to the first pixel in the data array.scanlineStride - The number to append to offset to get to the next scanline.IOExceptionpublic void writeKey32(OutputStream out, int[] data, int width, int height, int offset, int scanlineStride) throws IOException
out - The output stream.data - The image data.width - The width of the image in data elements.height - The height of the image in data elements.offset - The offset to the first pixel in the data array.scanlineStride - The number to append to offset to get to the next scanline.IOExceptionpublic void writeKey24(OutputStream out, BufferedImage image) throws IOException
out - The output stream.image - The image.IOExceptionCopyright © 2014. All Rights Reserved.