Class ColorCyclingMemoryImageSource

java.lang.Object
java.awt.image.MemoryImageSource
org.monte.media.ilbm.ColorCyclingMemoryImageSource
All Implemented Interfaces:
ImageProducer

public class ColorCyclingMemoryImageSource extends MemoryImageSource
ColorCyclingMemoryImageSource.
Author:
Werner Randelshofer
  • Constructor Details

    • ColorCyclingMemoryImageSource

      public ColorCyclingMemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off, int scan)
      Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object.
      Parameters:
      w - the width of the rectangle of pixels
      h - the height of the rectangle of pixels
      cm - the specified ColorModel
      pix - an array of pixels
      off - the offset into the array of where to store the first pixel
      scan - the distance from one row of pixels to the next in the array
      See Also:
    • ColorCyclingMemoryImageSource

      public ColorCyclingMemoryImageSource(int w, int h, ColorModel cm, byte[] pix, int off, int scan, Hashtable<?,?> props)
      Constructs an ImageProducer object which uses an array of bytes to produce data for an Image object.
      Parameters:
      w - the width of the rectangle of pixels
      h - the height of the rectangle of pixels
      cm - the specified ColorModel
      pix - an array of pixels
      off - the offset into the array of where to store the first pixel
      scan - the distance from one row of pixels to the next in the array
      props - a list of properties that the ImageProducer uses to process an image
      See Also:
    • ColorCyclingMemoryImageSource

      public ColorCyclingMemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off, int scan)
      Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
      Parameters:
      w - the width of the rectangle of pixels
      h - the height of the rectangle of pixels
      cm - the specified ColorModel
      pix - an array of pixels
      off - the offset into the array of where to store the first pixel
      scan - the distance from one row of pixels to the next in the array
      See Also:
    • ColorCyclingMemoryImageSource

      public ColorCyclingMemoryImageSource(int w, int h, ColorModel cm, int[] pix, int off, int scan, Hashtable<?,?> props)
      Constructs an ImageProducer object which uses an array of integers to produce data for an Image object.
      Parameters:
      w - the width of the rectangle of pixels
      h - the height of the rectangle of pixels
      cm - the specified ColorModel
      pix - an array of pixels
      off - the offset into the array of where to store the first pixel
      scan - the distance from one row of pixels to the next in the array
      props - a list of properties that the ImageProducer uses to process an image
      See Also:
  • Method Details

    • getWidth

      public int getWidth()
    • getHeight

      public int getHeight()
    • getColorModel

      public ColorModel getColorModel()
    • getProperties

      public Hashtable<?,?> getProperties()
    • newPixels

      public void newPixels(byte[] newpix, ColorModel newmodel, int offset, int scansize)
      Overrides:
      newPixels in class MemoryImageSource
    • newPixels

      public void newPixels(int[] newpix, ColorModel newmodel, int offset, int scansize)
      Changes to a new int array to hold the pixels for this image. If the animation flag has been turned on through the setAnimated() method, then the new pixels will be immediately delivered to any ImageConsumers that are currently interested in the data for this image.
      Overrides:
      newPixels in class MemoryImageSource
      Parameters:
      newpix - the new pixel array
      newmodel - the specified ColorModel
      offset - the offset into the array
      scansize - the distance from one row of pixels to the next in the array
      See Also:
    • addColorCycle

      public void addColorCycle(ColorCycle cc)
    • addConsumer

      public void addConsumer(ImageConsumer ic)
      Specified by:
      addConsumer in interface ImageProducer
      Overrides:
      addConsumer in class MemoryImageSource
    • removeConsumer

      public void removeConsumer(ImageConsumer ic)
      Specified by:
      removeConsumer in interface ImageProducer
      Overrides:
      removeConsumer in class MemoryImageSource
    • setAnimated

      public void setAnimated(boolean b)
      Overrides:
      setAnimated in class MemoryImageSource
    • setColorCyclingStarted

      public void setColorCyclingStarted(boolean b)
      Starts or stops color cycling.
    • isColorCyclingStarted

      public boolean isColorCyclingStarted()
      Returns true if color cycling is on.
    • start

      public void start()
      Starts color cycling.
    • stop

      public void stop()
      Stops color cycling.
    • isStarted

      public boolean isStarted()
    • toBufferedImage

      public BufferedImage toBufferedImage()
      Creates a BufferedImage which shares its pixel data with this memory image source.
    • isColorCyclingAvailable

      public boolean isColorCyclingAvailable()
    • putProperties

      public void putProperties(Map<?,?> props)
    • setBlendedColorCycling

      public void setBlendedColorCycling(boolean newValue)
    • isBlendedColorCycling

      public boolean isBlendedColorCycling()