|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Extends the PixelImage
interface to access image data as int
values.
Image types based on byte
, char
, short
and int
will work with this interface.
long
will not.
Using this interface provides a nice way of accessing a large variety of
image types, but for performance reasons it might be preferable to use
one of the class-specific access methods that get or put several values
at a time, e.g. getByteSamples in ByteChannelImage
.
Method Summary | |
void |
clear(int newValue)
Sets all samples in the first channel to the argument value. |
void |
clear(int channelIndex,
int newValue)
Sets all samples of the channelIndex 'th channel to newValue . |
int |
getMaxSample(int channel)
Returns the maximum value for one of the image's channels. |
int |
getSample(int x,
int y)
Returns one sample of the first channel (index 0). |
int |
getSample(int channel,
int x,
int y)
Returns one sample, specified by its channel index and location. |
void |
getSamples(int channelIndex,
int x,
int y,
int w,
int h,
int[] dest,
int destOffs)
Copies a number of samples from this image to an int[] object.
|
void |
putSample(int x,
int y,
int newValue)
This method sets one sample of the first channel (index 0) to a new value. |
void |
putSample(int channel,
int x,
int y,
int newValue)
This method sets one sample to a new value. |
void |
putSamples(int channel,
int x,
int y,
int w,
int h,
int[] src,
int srcOffset)
Copies a number of samples from an int[] array to this image.
|
Methods inherited from interface net.sourceforge.jiu.data.PixelImage |
createCompatibleImage, createCopy, getAllocatedMemory, getBitsPerPixel, getHeight, getImageType, getNumChannels, getWidth |
Method Detail |
public void clear(int newValue)
clear(0, newValue);
:
public void clear(int channelIndex, int newValue)
channelIndex
'th channel to newValue
.
public int getMaxSample(int channel)
0
.
channel
- zero-based index of the channel, from 0
to PixelImage.getNumChannels()
- 1
public int getSample(int x, int y)
getSample(0, x, y);
.
x
- the horizontal position of the sample, from 0
to PixelImage.getWidth()
- 1
y
- the vertical position of the sample, from 0
to PixelImage.getHeight()
- 1
public int getSample(int channel, int x, int y)
channel
- the number of the channel, from 0
to PixelImage.getNumChannels()
- 1
x
- the horizontal position of the sample, from 0
to PixelImage.getWidth()
- 1
y
- the vertical position of the sample, from 0
to PixelImage.getHeight()
- 1
public void getSamples(int channelIndex, int x, int y, int w, int h, int[] dest, int destOffs)
int[]
object.
A rectangular part of one channel is copied.
The channel index is given by - the upper left corner of
that rectangle is given by the point x / y.
Width and height of that rectangle are given by w and h.
Each sample will be stored as one int
value dest,
starting at index destOffs.
channelIndex
- zero-based index of the channel from which data is to be copied (valid values: 0 to PixelImage.getNumChannels()
- 1)x
- horizontal position of upper left corner of the rectangle to be copiedy
- vertical position of upper left corner of the rectangle to be copiedw
- width of rectangle to be copiedh
- height of rectangle to be copieddest
- int array to which the samples will be copieddestOffs
- int index into the dest array for the position to which the samples will be copiedpublic void putSample(int x, int y, int newValue)
putSample(0, x, y)
.
The sample location is given by the spatial coordinates, x and y.
x
- the horizontal position of the sample, from 0
to PixelImage.getWidth()
- 1
y
- the vertical position of the sample, from 0
to PixelImage.getHeight()
- 1
newValue
- the new value of the samplepublic void putSample(int channel, int x, int y, int newValue)
channel
- the number of the channel, from 0
to PixelImage.getNumChannels()
- 1
x
- the horizontal position of the sample, from 0
to PixelImage.getWidth()
- 1
y
- the vertical position of the sample, from 0
to PixelImage.getHeight()
- 1
newValue
- the new value of the samplepublic void putSamples(int channel, int x, int y, int w, int h, int[] src, int srcOffset)
int[]
array to this image.
A rectangular part of one channel is copied - the upper left corner of
that rectangle is given by the point x / y.
Width and height of that rectangle are given by w and h.
Each sample will be stored as one int
value src,
starting at index srcOffset.
channel
- int (from 0 to getNumChannels() - 1) to indicate the channel to which data is copiedx
- horizontal position of upper left corner of the rectangle to be copiedy
- vertical position of upper left corner of the rectangle to be copiedw
- width of rectangle to be copiedh
- height of rectangle to be copiedsrc
- int array from which the samples will be copiedsrcOffset
- int index into the src array for the position from which the samples will be copied
|
JIU 0.12.0 Homepage | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |