Class ColorCyclingMemoryImageSource
java.lang.Object
java.awt.image.MemoryImageSource
org.monte.media.ilbm.ColorCyclingMemoryImageSource
- All Implemented Interfaces:
ImageProducer
ColorCyclingMemoryImageSource.
- Author:
- Werner Randelshofer
-
Constructor Summary
ConstructorsConstructorDescriptionColorCyclingMemoryImageSource(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.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.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.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. -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidintHashtable<?, ?> intgetWidth()booleanbooleanbooleanReturns true if color cycling is on.booleanvoidnewPixels(byte[] newpix, ColorModel newmodel, int offset, int scansize) voidnewPixels(int[] newpix, ColorModel newmodel, int offset, int scansize) Changes to a new int array to hold the pixels for this image.voidputProperties(Map<?, ?> props) voidvoidsetAnimated(boolean b) voidsetBlendedColorCycling(boolean newValue) voidsetColorCyclingStarted(boolean b) Starts or stops color cycling.voidstart()Starts color cycling.voidstop()Stops color cycling.Creates a BufferedImage which shares its pixel data with this memory image source.Methods inherited from class java.awt.image.MemoryImageSource
isConsumer, newPixels, newPixels, newPixels, requestTopDownLeftRightResend, setFullBufferUpdates, startProduction
-
Constructor Details
-
ColorCyclingMemoryImageSource
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 pixelsh- the height of the rectangle of pixelscm- the specifiedColorModelpix- an array of pixelsoff- the offset into the array of where to store the first pixelscan- 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 pixelsh- the height of the rectangle of pixelscm- the specifiedColorModelpix- an array of pixelsoff- the offset into the array of where to store the first pixelscan- the distance from one row of pixels to the next in the arrayprops- a list of properties that theImageProduceruses to process an image- See Also:
-
ColorCyclingMemoryImageSource
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 pixelsh- the height of the rectangle of pixelscm- the specifiedColorModelpix- an array of pixelsoff- the offset into the array of where to store the first pixelscan- 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 pixelsh- the height of the rectangle of pixelscm- the specifiedColorModelpix- an array of pixelsoff- the offset into the array of where to store the first pixelscan- the distance from one row of pixels to the next in the arrayprops- a list of properties that theImageProduceruses to process an image- See Also:
-
-
Method Details
-
getWidth
public int getWidth() -
getHeight
public int getHeight() -
getColorModel
-
getProperties
-
newPixels
- Overrides:
newPixelsin classMemoryImageSource
-
newPixels
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:
newPixelsin classMemoryImageSource- Parameters:
newpix- the new pixel arraynewmodel- the specifiedColorModeloffset- the offset into the arrayscansize- the distance from one row of pixels to the next in the array- See Also:
-
addColorCycle
-
addConsumer
- Specified by:
addConsumerin interfaceImageProducer- Overrides:
addConsumerin classMemoryImageSource
-
removeConsumer
- Specified by:
removeConsumerin interfaceImageProducer- Overrides:
removeConsumerin classMemoryImageSource
-
setAnimated
public void setAnimated(boolean b) - Overrides:
setAnimatedin classMemoryImageSource
-
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
Creates a BufferedImage which shares its pixel data with this memory image source. -
isColorCyclingAvailable
public boolean isColorCyclingAvailable() -
putProperties
-
setBlendedColorCycling
public void setBlendedColorCycling(boolean newValue) -
isBlendedColorCycling
public boolean isBlendedColorCycling()
-