|
Copyright 2011-01-06 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectch.randelshofer.media.quicktime.AppleRLEEncoder
public class AppleRLEEncoder
Implements the run length encoding of the Apple QuickTime Animation (RLE) format.
An RLE-encoded frame has the following format:
Header:
uint32 chunkSize
uint16 header 0x0000 => decode entire image
0x0008 => starting line and number of lines follows
if header==0x0008 {
uint16 startingLine at which to begin updating frame
uint16 reserved 0x0000
uint16 numberOfLines to update
uint16 reserved 0x0000
}
n-bytes compressed lines
The first 4 bytes defines the chunk length. This field also carries some
other unknown flags, since at least one of the high bits is sometimes set.2 bytes starting line at which to begin updating frame 2 bytes unknown 2 bytes the number of lines to update 2 bytes unknownIf the header is 0x0000, then the decode begins from the first line and continues through the entire height of the image.
1 byte skip code 1 byte RLE code n bytes pixel data 1 byte RLE code n bytes pixel dataAfter the skip byte is the first RLE code, which is a single signed byte. The RLE code can have the following meanings:
The pixel data has the following format:
xrrrrrgg gggbbbbb. Pixel data is
rendered to the output frame one pixel at a time.rrrrrrrr gggggggg bbbbbbbb. Pixel data is rendered to the output
frame one pixel at a time.aaaaaaaa rrrrrrrr gggggggg bbbbbbbb. Pixel data is rendered to the
output frame one pixel at a time.
| Constructor Summary | |
|---|---|
AppleRLEEncoder()
|
|
| Method Summary | |
|---|---|
void |
writeDelta16(javax.imageio.stream.ImageOutputStream out,
short[] data,
short[] prev,
int offset,
int length,
int step)
Encodes a 16-bit delta frame. |
void |
writeDelta24(javax.imageio.stream.ImageOutputStream out,
int[] data,
int[] prev,
int offset,
int length,
int step)
Encodes a 24-bit delta frame. |
void |
writeDelta32(javax.imageio.stream.ImageOutputStream out,
int[] data,
int[] prev,
int offset,
int length,
int step)
Encodes a 32-bit delta frame. |
void |
writeKey16(javax.imageio.stream.ImageOutputStream out,
short[] data,
int offset,
int length,
int step)
Encodes a 16-bit key frame. |
void |
writeKey24(javax.imageio.stream.ImageOutputStream out,
int[] data,
int offset,
int length,
int step)
Encodes a 24-bit key frame. |
void |
writeKey32(javax.imageio.stream.ImageOutputStream out,
int[] data,
int offset,
int length,
int step)
Encodes a 32-bit key frame. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AppleRLEEncoder()
| Method Detail |
|---|
public void writeKey16(javax.imageio.stream.ImageOutputStream out,
short[] data,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
public void writeDelta16(javax.imageio.stream.ImageOutputStream out,
short[] data,
short[] prev,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.prev - The image data of the previous frame.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
public void writeKey24(javax.imageio.stream.ImageOutputStream out,
int[] data,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
public void writeDelta24(javax.imageio.stream.ImageOutputStream out,
int[] data,
int[] prev,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.prev - The image data of the previous frame.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
public void writeKey32(javax.imageio.stream.ImageOutputStream out,
int[] data,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
public void writeDelta32(javax.imageio.stream.ImageOutputStream out,
int[] data,
int[] prev,
int offset,
int length,
int step)
throws java.io.IOException
out - The output stream. Must be set to Big-Endian.data - The image data.prev - The image data of the previous frame.offset - The offset to the first pixel in the data array.length - The width of the image in data elements.step - The number to add to offset to get to the next scanline.
java.io.IOException
|
Copyright 2011-01-06 Werner Randelshofer | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||