java.lang.Object
org.monte.media.anim.ANIMFrame
org.monte.media.anim.ANIMKeyFrame
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
-
Field Summary
FieldsFields inherited from class org.monte.media.anim.ANIMFrame
BadBitsOP_ByteVertical, BadBitsOP_GeneralDelta, BIT_LongData, BIT_LongInfoOffsets, BIT_OneInfoListForAllPlanes, BIT_RLC, BIT_Vertical, BIT_XOR, colorModel, data -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(AmigaBitmapImage bitmap, ANIMMovieResources track) voidsetCompression(int compression) For possible values seeANIMMovieResources.voidsetData(byte[] data) static intunpackByteRun1(byte[] in, byte[] out) ByteRun1 run decoder.voidunpackVertical(byte[] in, AmigaBitmapImage bm) Vertical run decoder.Methods inherited from class org.monte.media.anim.ANIMFrame
addAudioCommand, cleanUpAudioCommands, getAudioCommands, getBits, getBottomBound, getColorModel, getInterleave, getLeftBound, getOperation, getRelTime, getRightBound, getTopBound, isBidirectional, setAbsTime, setBits, setColorModel, setHeight, setInterleave, setMask, setOperation, setRelTime, setWidth, setX, setY
-
Field Details
-
VDAT_ID
protected static final int VDAT_ID
-
-
Constructor Details
-
ANIMKeyFrame
public ANIMKeyFrame()
-
-
Method Details
-
setData
public void setData(byte[] data) -
setCompression
public void setCompression(int compression) For possible values seeANIMMovieResources. -
decode
-
unpackByteRun1
public static int unpackByteRun1(byte[] in, byte[] out) ByteRun1 run decoder.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; -
unpackVertical
Vertical run decoder.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;
-