net.sourceforge.jiu.data
Class MemoryPaletted8Image
- ByteChannelImage, IntegerImage, Paletted8Image, PalettedImage, PalettedIntegerImage, PixelImage
public class MemoryPaletted8Image
This class stores a paletted image with one byte per sample in memory.
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.
|
Class | getImageType()- If there is a single interface or class that describes the image data type
of this class, the
java.lang.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.
|
String | getTypeDescription()
|
void | setPalette(Palette palette)- Sets this image's palette to a new value.
|
checkPositionAndNumber, clear, clear, clear, clear, createCompatibleImage, createCopy, getAllocatedMemory, getBitsPerPixel, getByteSample, getByteSample, getByteSamples, getHeight, getMaxSample, getNumChannels, getSample, getSample, getSamples, getWidth, putByteSample, putByteSample, putByteSamples, putSample, putSample, putSamples |
maxSampleValue
private int maxSampleValue
palette
private Palette palette
This image's palette.
MemoryPaletted8Image
public MemoryPaletted8Image(int width,
int height) Create an image of byte channels.
Image data will be completely in memory, so memory requirements are
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 positive
MemoryPaletted8Image
public MemoryPaletted8Image(int width,
int height,
Palette palette)
checkPalette
public static void checkPalette(Palette palette)
getImageType
public Class getImageType()
If there is a single interface or class that describes the image data type
of this class, the
java.lang.Class object associated with that
interface (or class) is returned (or
null otherwise).
This
java.lang.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
getMaxSample
public int getMaxSample(int channel)
Returns the maximum value for one of the image's channels.
The minimum value is always 0.
- getMaxSample in interface IntegerImage
- getMaxSample in interface MemoryByteChannelImage
channel - zero-based index of the channel, from 0 to getNumChannels() - 1
- maximum allowed sample value
getTypeDescription
public String getTypeDescription()