public class ANIMKeyFrame extends ANIMFrame
| Modifier and Type | Field and Description |
|---|---|
protected static int |
VDAT_ID |
BadBitsOP_ByteVertical, BadBitsOP_GeneralDelta, BIT_LongData, BIT_LongInfoOffsets, BIT_OneInfoListForAllPlanes, BIT_RLC, BIT_Vertical, BIT_XOR, colorModel, data| Constructor and Description |
|---|
ANIMKeyFrame() |
| Modifier and Type | Method and Description |
|---|---|
void |
decode(BitmapImage bitmap,
ANIMMovieTrack track) |
void |
setCompression(int compression)
For possible values see
ANIMMovieTrack. |
void |
setData(byte[] data) |
static int |
unpackByteRun1(byte[] in,
byte[] out)
ByteRun1 run decoder.
|
void |
unpackVertical(byte[] in,
BitmapImage bm)
Vertical run decoder.
|
addAudioCommand, cleanUpAudioCommands, getAudioCommands, getBits, getBottomBound, getColorModel, getInterleave, getLeftBound, getOperation, getRelTime, getRightBound, getTopBound, isBidirectional, setAbsTime, setBits, setColorModel, setHeight, setInterleave, setMask, setOperation, setRelTime, setWidth, setX, setYpublic void setCompression(int compression)
ANIMMovieTrack.public void decode(BitmapImage bitmap, ANIMMovieTrack track)
public static int unpackByteRun1(byte[] in,
byte[] out)
The run encoding scheme by byteRun1 is best described by pseudo code for the decoder Unpacker (called UnPackBits in the Macintosh toolbox.
UnPacker:
LOOP until produced the desired number of bytes
Read the next source byte into n
SELECT n FROM
[0..127] => copy the next n+1 bytes literally
[-1..-127] => replicate the next byte -n+1 times
-128 => no operation
ENDCASE;
ENDLOOP;
public void unpackVertical(byte[] in,
BitmapImage bm)
Each plane is stored in a separate VDAT chunk.
A VDAT chunk consists of an id, a length, and a body.
struct {
uint16 id; // The 4 ASCII characters "VDAT"
uint16 length,
byte[length] body
}
The body consists of a command list and a data list.
struct {
uint16 cnt; // Command count + 2
uint8[cnt - 2] cmd; // The commands
uint16[] data; // Data words
}
Pseudo code for the unpacker:
UnPacker:
Read cnt;
LOOP cnt - 2 TIMES
Read the next command byte into cmd
SELECT cmd FROM
0 =>
Read the next data word into n
Copy the next n data words literally
1 =>
Read the next data word into n
Replicate the next data word n times
[2..127] =>
Replicate the next data word cmd times
[-1..-128] =>
Copy the next -cmd data words literally
ENDCASE;
IF end of data reached THEN EXIT END;
ENDLOOP;
Copyright © 2014. All Rights Reserved.