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, putSamples
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clear, clear, getByteSample, getByteSample, getByteSamples, putByteSample, putByteSample, putByteSamples
clear, clear, getSample, getSample, getSamples, putSample, putSample, putSamples
createCopy, getBitsPerPixel, getHeight, getNumChannels, getWidth
private 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)
PixelImage
createCompatibleImage
in interface PixelImage
createCompatibleImage
in class MemoryByteChannelImage
width
- the horizontal resolution of the new imageheight
- the vertical resolution of the new imagepublic long getAllocatedMemory()
PixelImage
getAllocatedMemory
in interface PixelImage
getAllocatedMemory
in class MemoryByteChannelImage
public java.lang.Class getImageType()
PixelImage
Class
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 PixelImage
public int getMaxSample(int channel)
IntegerImage
0
.getMaxSample
in interface IntegerImage
getMaxSample
in class MemoryByteChannelImage
channel
- zero-based index of the channel, from 0
to PixelImage.getNumChannels()
- 1
public Palette getPalette()
getPalette
in interface PalettedImage
setPalette(net.sourceforge.jiu.data.Palette)
public java.lang.String getTypeDescription()
public void setPalette(Palette palette)
setPalette
in interface PalettedImage
palette
- the new palette for this imagegetPalette()