Copyright 2011-01-06 Werner Randelshofer

ch.randelshofer.media.ilbm
Class CRNGColorCycle

java.lang.Object
  extended by ch.randelshofer.media.ilbm.ColorCycle
      extended by ch.randelshofer.media.ilbm.CRNGColorCycle
All Implemented Interfaces:
java.lang.Cloneable

public class CRNGColorCycle
extends ColorCycle

Implements CRNG and CCRT color cycling for an IFF ILBM image.

This class supports CRNG and CCRT color cycling as published in AMIGA ROM Kernel Reference Manual: Devices, Third Edition, Addison-Wesley, Reading ISBN 0-201-56775-X

 //ILBM CRNG Color range cycling
 //--------------------------------------------

 #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;
 
 ILBM CCRT Color cycling range and timing
 --------------------------------------------
 /
 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 * /
 LONG  seconds;    /* seconds between cycling * /
 LONG  microseconds; /* msecs between cycling * /
 WORD  pad;        /* future exp - store 0 here * /
 } ilbmColorCyclingAndTimingChunk;

 

Version:
1.1 2010-08-03 Added support for blended color cycles.
1.0.1 2010-11-08 Fixed color cycling rate.
1.0 2009-12-23 Created.
Author:
Werner Randelshofer

Field Summary
 
Fields inherited from class ch.randelshofer.media.ilbm.ColorCycle
isActive, isBlended, rate, timeScale
 
Constructor Summary
CRNGColorCycle(int rate, int timeScale, int low, int high, boolean isActive, boolean isReverse, boolean isEHB)
           
 
Method Summary
 void doBlendedCycle(int[] rgbs, long time)
           
 void doCycle(int[] rgbs, long time)
           
 void doHardCycle(int[] rgbs, long time)
           
 int getHigh()
           
 int getLow()
           
 boolean isReverse()
           
 
Methods inherited from class ch.randelshofer.media.ilbm.ColorCycle
clone, getRate, getTimeScale, isActive, isBlended, setBlended
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CRNGColorCycle

public CRNGColorCycle(int rate,
                      int timeScale,
                      int low,
                      int high,
                      boolean isActive,
                      boolean isReverse,
                      boolean isEHB)
Method Detail

isReverse

public boolean isReverse()

getLow

public int getLow()

getHigh

public int getHigh()

doCycle

public void doCycle(int[] rgbs,
                    long time)
Specified by:
doCycle in class ColorCycle

doBlendedCycle

public void doBlendedCycle(int[] rgbs,
                           long time)

doHardCycle

public void doHardCycle(int[] rgbs,
                        long time)

Copyright 2011-01-06 Werner Randelshofer