public interface PixelConverter<T extends java.nio.Buffer,U extends java.nio.Buffer>
| Modifier and Type | Method and Description |
|---|---|
void |
convert(T srcbuf,
int srcoff,
int srcscanelems,
U dstbuf,
int dstoff,
int dstscanelems,
int w,
int h)
Copies a rectangular region of data from the source buffer to the
destination buffer using the following relationship:
|
PixelGetter<T> |
getGetter() |
PixelSetter<U> |
getSetter() |
void convert(T srcbuf, int srcoff, int srcscanelems, U dstbuf, int dstoff, int dstscanelems, int w, int h)
for each xy : 0 <= x,y < w,h {
int srcpos = y * srcscanelems + x * srcelemsperpixel + srcoff;
int dstpos = y * dstscanelems + x * dstelemsperpixel + dstoff;
for each j : 0 <= j < srcelemsperpixel {
load data from srcbuf.get(srcpos + j);
}
convert data to destination pixel format
for each k : 0 <= k < dstelemsperpixel {
store data into dstbuf.put(dstpos + k, pixel data);
}
}
srcbuf - the nio buffer containing the source datasrcoff - the absolute location in the buffer of the first source pixel datasrcscanelems - number of buffer elements between rows of data in the sourcedstbuf - the nio buffer containing the destination datadstoff - the absolute location in the buffer of the first destination pixel datadstscanelems - number of buffer elements between rows of data in the destinationw - the number of pixels to process across before moving to the next rowh - the number of rows of pixels to processPixelGetter<T> getGetter()
PixelSetter<U> getSetter()