net.sourceforge.jiu.data
Interface PixelImage
- BilevelImage, ByteChannelImage, Gray16Image, Gray8Image, GrayIntegerImage, IntegerImage, Paletted8Image, PalettedIntegerImage, RGB24Image, RGB48Image, RGBImage, RGBIntegerImage, ShortChannelImage
- BufferedRGB24Image, MemoryBilevelImage, MemoryByteChannelImage, MemoryGray16Image, MemoryGray8Image, MemoryPaletted8Image, MemoryRGB24Image, MemoryRGB48Image, MemoryShortChannelImage
public interface PixelImage
The base interface for all image data types in JIU.
These image data classes and interfaces share the following properties:
- They are made up of a rectangular grid of pixels (color dots) and
have a fixed width (horizontal number of pixels) and height
(vertical number of pixels).
- Coordinates to access pixels in the image are defined to run from 0 to
WIDTH - 1 in horizontal direction from left to right and in vertical
direction from 0 to HEIGHT - 1 (from top to bottom).
- They have one or more channels. A pixel at a given position is made up
of the samples (primitive values) of all the channels at that
position.
A pixel can thus be considered a vector (in the mathematical sense) of one or more samples.
Each channel has the same width and height.
PixelImage | createCompatibleImage(int width, int height) - Creates an instance of the same class as this one, with width and height
given by the arguments.
|
PixelImage | createCopy() - Creates an new image object that will be of the same type as this one,
with the same image data, using entirely new resources.
|
long | getAllocatedMemory() - Returns the number of bytes that were dynamically allocated for
this image object.
|
int | getBitsPerPixel() - Returns the number of bits per pixel of this image.
|
int | getHeight() - Returns the vertical resolution of the image in pixels.
|
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 | getNumChannels() - Returns the number of channels in this image.
|
int | getWidth() - Returns the horizontal resolution of the image in pixels.
|
createCompatibleImage
public PixelImage createCompatibleImage(int width,
int height)
Creates an instance of the same class as this one, with width and height
given by the arguments.
width
- the horizontal resolution of the new imageheight
- the vertical resolution of the new image
createCopy
public PixelImage createCopy()
Creates an new image object that will be of the same type as this one,
with the same image data, using entirely new resources.
getAllocatedMemory
public long getAllocatedMemory()
Returns the number of bytes that were dynamically allocated for
this image object.
- allocated memory in bytes
getBitsPerPixel
public int getBitsPerPixel()
Returns the number of bits per pixel of this image.
That is the number of bits per sample for all channels of this image.
Does not include any transparency channels.
getHeight
public int getHeight()
Returns the vertical resolution of the image in pixels.
Must be one or larger.
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
.
getNumChannels
public int getNumChannels()
Returns the number of channels in this image.
Must be one or larger.
getWidth
public int getWidth()
Returns the horizontal resolution of the image in pixels.
Must be one or larger.