public class MemoryPaletted8Image extends MemoryByteChannelImage implements Paletted8Image
ByteChannelImage,
IntegerImage,
Palette| Modifier and Type | Field and Description |
|---|---|
private int |
maxSampleValue |
private Palette |
palette
This image's palette.
|
| Constructor and Description |
|---|
MemoryPaletted8Image(int width,
int height)
Create an image of byte channels.
|
MemoryPaletted8Image(int width,
int height,
Palette palette) |
| Modifier and Type | Method and Description |
|---|---|
static void |
checkPalette(Palette palette) |
PixelImage |
createCompatibleImage(int width,
int height)
Creates an instance of the same class as this one, with width and height
given by the arguments.
|
long |
getAllocatedMemory()
Returns the number of bytes that were dynamically allocated for
this image object.
|
java.lang.Class |
getImageType()
If there is a single interface or class that describes the image data type
of this class, the
Class object associated with that
interface (or class) is returned (or null otherwise). |
int |
getMaxSample(int channel)
Returns the maximum value for one of the image's channels.
|
Palette |
getPalette()
Returns this image's palette.
|
java.lang.String |
getTypeDescription() |
void |
setPalette(Palette palette)
Sets this image's palette to a new value.
|
checkPositionAndNumber, clear, clear, clear, clear, createCopy, getBitsPerPixel, getByteSample, getByteSample, getByteSamples, getHeight, getNumChannels, getSample, getSample, getSamples, getWidth, putByteSample, putByteSample, putByteSamples, putSample, putSample, putSamplesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclear, clear, getByteSample, getByteSample, getByteSamples, putByteSample, putByteSample, putByteSamplesclear, clear, getSample, getSample, getSamples, putSample, putSample, putSamplescreateCopy, getBitsPerPixel, getHeight, getNumChannels, getWidthprivate Palette palette
private int maxSampleValue
public MemoryPaletted8Image(int width,
int height)
width * height * numChannels bytes.
Note that the data will not be initialized, so you should not assume
anything about its content.width - the horizontal resolution, must be non-zero and positiveheight - the vertical resolution, must be non-zero and positivejava.lang.IllegalArgumentException - if any of the parameters are smaller than 1public MemoryPaletted8Image(int width,
int height,
Palette palette)
public static void checkPalette(Palette palette)
public PixelImage createCompatibleImage(int width, int height)
PixelImagecreateCompatibleImage in interface PixelImagecreateCompatibleImage in class MemoryByteChannelImagewidth - the horizontal resolution of the new imageheight - the vertical resolution of the new imagepublic long getAllocatedMemory()
PixelImagegetAllocatedMemory in interface PixelImagegetAllocatedMemory in class MemoryByteChannelImagepublic java.lang.Class getImageType()
PixelImageClass object associated with that
interface (or class) is returned (or null otherwise).
This Class object, if available for two image objects,
can be used to find out if they are compatible.
Example: MemoryGray8Image returns
net.sourceforge.jiu.data.Gray8Image.class.getImageType in interface PixelImagepublic int getMaxSample(int channel)
IntegerImage0.getMaxSample in interface IntegerImagegetMaxSample in class MemoryByteChannelImagechannel - zero-based index of the channel, from 0 to PixelImage.getNumChannels() - 1public Palette getPalette()
getPalette in interface PalettedImagesetPalette(net.sourceforge.jiu.data.Palette)public java.lang.String getTypeDescription()
public void setPalette(Palette palette)
setPalette in interface PalettedImagepalette - the new palette for this imagegetPalette()