java.lang.Object
org.monte.media.anim.ANIMDecoder
- All Implemented Interfaces:
IFFVisitor
Decodes IFF files and adds the data to an ANIMMovieTrack.
- Author:
- Werner Randelshofer, Hausmatt 10, CH-6405 Goldau, Switzerland
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA2024, 60fps (I don't know the real value).static final intDBLNTSC, 58fps, 44:52.static final intDBLPAL, 48fps, 44:44.static final intDefault ID chooses a system dependent screen mode.protected static final intstatic final intEURO36, 73fps, 44:44.static final intEURO72, 69fps, 44:44.protected static final intprotected static final intstatic final intCAMG monitor ID mask.static final intMULTISCAN (VGA), 58fps, 44:44.static final intNTSC, 60fps, 44:52.static final intPAL, 50fps, 44:44.static final intPROTO, 60fps (I don't know the real value).static final intSUPER72, 71fps, 34:40. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voiddecodeANNO(IFFChunk[] chunks, ANIMMovieResources track) protected voiddecodeAUTH(IFFChunk[] chunks, ANIMMovieResources track) protected voiddecodeCCRT(IFFChunk chunk, ANIMMovieResources track) Decodes the color cycling range and timing chunk (ILBM CCRT).protected voiddecodeColorCycling(IFFChunk[] ccrtChunks, IFFChunk[] crngChunks, IFFChunk[] drngChunks, ANIMMovieResources track) Process CRNG and DRNG chunks in the sequence of their location in the file.protected voiddecodeCOPYRIGHT(IFFChunk[] chunks, ANIMMovieResources track) protected voiddecodeCRNG(IFFChunk chunk, ANIMMovieResources track) Decodes the color range cycling (ILBM CRNG).protected voiddecodeDRNG(IFFChunk chunk, ANIMMovieResources track) Decodes the DPaint IV enhanced color cycle chunk (ILBM DRNG)voidenterGroup(IFFChunk chunk) voidleaveGroup(IFFChunk chunk) voidproduce(ANIMMovieResources track, int n, boolean loadAudio) Decodes the stream and produces animation frames into the specified movie track.voidregisterChunks(IFFParser iff, boolean loadAudio) voidvisitChunk(IFFChunk group, IFFChunk chunk)
-
Field Details
-
MONITOR_ID_MASK
public static final int MONITOR_ID_MASKCAMG monitor ID mask.- See Also:
-
DEFAULT_MONITOR_ID
public static final int DEFAULT_MONITOR_IDDefault ID chooses a system dependent screen mode. We always fall back to NTSC OCS with 60fps.The default monitor ID triggers OCS mode! OCS stands for "Original Chip Set". The OCS chip set only had 4 bits per color register. All later chip sets hat 8 bits per color register.
- See Also:
-
NTSC_MONITOR_ID
public static final int NTSC_MONITOR_IDNTSC, 60fps, 44:52.- See Also:
-
PAL_MONITOR_ID
public static final int PAL_MONITOR_IDPAL, 50fps, 44:44.- See Also:
-
MULTISCAN_MONITOR_ID
public static final int MULTISCAN_MONITOR_IDMULTISCAN (VGA), 58fps, 44:44.- See Also:
-
A2024_MONITOR_ID
public static final int A2024_MONITOR_IDA2024, 60fps (I don't know the real value).- See Also:
-
PROTO_MONITOR_ID
public static final int PROTO_MONITOR_IDPROTO, 60fps (I don't know the real value).- See Also:
-
EURO72_MONITOR_ID
public static final int EURO72_MONITOR_IDEURO72, 69fps, 44:44.- See Also:
-
EURO36_MONITOR_ID
public static final int EURO36_MONITOR_IDEURO36, 73fps, 44:44.- See Also:
-
SUPER72_MONITOR_ID
public static final int SUPER72_MONITOR_IDSUPER72, 71fps, 34:40.- See Also:
-
DBLNTSC_MONITOR_ID
public static final int DBLNTSC_MONITOR_IDDBLNTSC, 58fps, 44:52.- See Also:
-
DBLPAL_MONITOR_ID
public static final int DBLPAL_MONITOR_IDDBLPAL, 48fps, 44:44.- See Also:
-
MODE_MASK
protected static final int MODE_MASK- See Also:
-
HAM_MODE
protected static final int HAM_MODE- See Also:
-
EHB_MODE
protected static final int EHB_MODE- See Also:
-
-
Constructor Details
-
ANIMDecoder
-
ANIMDecoder
-
-
Method Details
-
produce
Decodes the stream and produces animation frames into the specified movie track. Reads the n-th ANIM chunk out of the IFF-file.- Parameters:
track- The decoded data is stored in this track.n- The index of the ANIM FORM to be read out of the IFF-FileloadAudio- If this is set to false, audio data will be skipped.- Throws:
IOException
-
registerChunks
-
enterGroup
- Specified by:
enterGroupin interfaceIFFVisitor
-
leaveGroup
- Specified by:
leaveGroupin interfaceIFFVisitor
-
visitChunk
- Specified by:
visitChunkin interfaceIFFVisitor- Throws:
ParseExceptionAbortException
-
decodeCCRT
Decodes the color cycling range and timing chunk (ILBM CCRT).enum { dontCycle = 0, forward = 1, backwards = -1 } ccrtDirection; typedef struct { WORD enum ccrtDirection direction; // 0=don't cycle, 1=forward, -1=backwards UBYTE start; // range lower UBYTE end; // range upper ULONG seconds; // seconds between cycling ULONG microseconds; // msecs between cycling WORD pad; // future exp - store 0 here } ilbmColorCyclingRangeAndTimingChunk;- Throws:
ParseException
-
decodeCRNG
Decodes the color range cycling (ILBM CRNG).#define RNG_NORATE 36 // Dpaint uses this rate to mean non-active set { active = 1, reverse = 2 } crngActive; // A CRange is store in a CRNG chunk. typedef struct { WORD pad1; // reserved for future use; store 0 here * WORD rate; // 60/sec=16384, 30/sec=8192, 1/sec=16384/60=273 WORD set crngActive flags; // bit0 set = active, bit 1 set = reverse UBYTE low; UBYTE high; // lower and upper color registers selected } ilbmColorRegisterRangeChunk;- Throws:
ParseException
-
decodeDRNG
Decodes the DPaint IV enhanced color cycle chunk (ILBM DRNG)The RNG_ACTIVE flag is set when the range is cyclable. A range should only have the RNG _ACTIVE if it:
- contains at least one color register
- has a defined rate
- has more than one color and/or color register
ILBM DRNG DPaint IV enhanced color cycle chunk -------------------------------------------- set { RNG_ACTIVE=1,RNG_DP_RESERVED=4 } drngFlags; /* True color cell * / typedef struct { UBYTE cell; UBYTE r; UBYTE g; UBYTE b; } ilbmDRNGDColor; /* Color register cell * / typedef struct { UBYTE cell; UBYTE index; } ilbmDRNGDIndex; /* DRNG chunk. * / typedef struct { UBYTE min; /* min cell value * / UBYTE max; /* max cell value * / UWORD rate; /* color cycling rate, 16384 = 60 steps/second * / UWORD set drngFlags flags; /* 1=RNG_ACTIVE, 4=RNG_DP_RESERVED * / UBYTE ntrue; /* number of DColorCell structs to follow * / UBYTE ntregs; /* number of DIndexCell structs to follow * / ilbmDRNGDColor[ntrue] trueColorCells; ilbmDRNGDIndex[ntregs] colorRegisterCells; } ilbmDRangeChunk;- Throws:
ParseException
-
decodeColorCycling
protected void decodeColorCycling(IFFChunk[] ccrtChunks, IFFChunk[] crngChunks, IFFChunk[] drngChunks, ANIMMovieResources track) throws ParseException Process CRNG and DRNG chunks in the sequence of their location in the file.- Throws:
ParseException
-
decodeCOPYRIGHT
- Throws:
ParseException
-
decodeAUTH
- Throws:
ParseException
-
decodeANNO
- Throws:
ParseException
-