Spec-Zone .ru
спецификации, руководства, описания, API
|
public interface PixelReader
Image
or other surface containing pixels.Modifier and Type | Method and Description |
---|---|
int |
getArgb(int x,
int y)
Reads a 32-bit integer representation of the color of a pixel
from the specified coordinates in the surface.
|
Color |
getColor(int x,
int y)
Reads the color of a pixel from the specified coordinates in the
surface and returns the value as a
Color object. |
PixelFormat |
getPixelFormat()
This method returns the
PixelFormat in which the surface
stores its pixels, or a roughly equivalent pixel format into which
it can easily convert its pixels for purposes of reading them. |
void |
getPixels(int x,
int y,
int w,
int h,
WritablePixelFormat<java.nio.ByteBuffer> pixelformat,
byte[] buffer,
int offset,
int scanlineStride)
Reads pixel data from a rectangular region of the surface into the
specified byte array.
|
void |
getPixels(int x,
int y,
int w,
int h,
WritablePixelFormat<java.nio.IntBuffer> pixelformat,
int[] buffer,
int offset,
int scanlineStride)
Reads pixel data from a rectangular region of the surface into the
specified int array.
|
<T extends java.nio.Buffer> |
getPixels(int x,
int y,
int w,
int h,
WritablePixelFormat<T> pixelformat,
T buffer,
int scanlineStride)
Reads pixel data from a rectangular region of the surface into the
specified buffer.
|
PixelFormat getPixelFormat()
PixelFormat
in which the surface
stores its pixels, or a roughly equivalent pixel format into which
it can easily convert its pixels for purposes of reading them.PixelFormat
that best describes the underlying
pixelsint getArgb(int x, int y)
x
- the X coordinate of the pixel color to ready
- the Y coordinate of the pixel color to readINT_ARGB
PixelFormat type.Color getColor(int x, int y)
Color
object.x
- the X coordinate of the pixel color to ready
- the Y coordinate of the pixel color to read<T extends java.nio.Buffer> void getPixels(int x, int y, int w, int h, WritablePixelFormat<T> pixelformat, T buffer, int scanlineStride)
PixelFormat
object and pixel format conversions will be
performed as needed to store the data in the indicated format.
The buffer is assumed to be positioned to the location where the
first pixel data from the image pixel at location (x, y)
will be stored.
Pixel data for a row will be stored in adjacent locations within
the buffer packed as tightly as possible for increasing X
coordinates.
Pixel data for adjacent rows will be stored offset from each other
by the number of buffer data elements defined by
scanlineStride
.x
- the X coordinate of the rectangular region to ready
- the Y coordinate of the rectangular region to readw
- the width of the rectangular region to readh
- the height of the rectangular region to readpixelformat
- the PixelFormat
object defining the format
to store the pixels into bufferbuffer
- a buffer of a type appropriate for the indicated
PixelFormat
objectscanlineStride
- the distance between the pixel data for the
start of one row of data in the buffer to the start of the
next row of data.void getPixels(int x, int y, int w, int h, WritablePixelFormat<java.nio.ByteBuffer> pixelformat, byte[] buffer, int offset, int scanlineStride)
PixelFormat
object and pixel format conversions will be
performed as needed to store the data in the indicated format.
The pixelformat
must be a compatible
PixelFormat<ByteBuffer>
type.
The data for the first pixel at location (x, y)
will be
read into the array index specified by the offset
parameter.
Pixel data for a row will be stored in adjacent locations within
the array packed as tightly as possible for increasing X
coordinates.
Pixel data for adjacent rows will be stored offset from each other
by the number of byte array elements defined by
scanlineStride
.x
- the X coordinate of the rectangular region to ready
- the Y coordinate of the rectangular region to readw
- the width of the rectangular region to readh
- the height of the rectangular region to readpixelformat
- the PixelFormat<ByteBuffer>
object
defining the byte format to store the pixels into bufferbuffer
- a byte array to store the returned pixel dataoffset
- the offset into buffer
to store the first
pixel datascanlineStride
- the distance between the pixel data for the
start of one row of data in the buffer to the start of the
next row of datavoid getPixels(int x, int y, int w, int h, WritablePixelFormat<java.nio.IntBuffer> pixelformat, int[] buffer, int offset, int scanlineStride)
PixelFormat
object and pixel format conversions will be
performed as needed to store the data in the indicated format.
The pixelformat
must be a compatible
PixelFormat<IntBuffer>
type.
The data for the first pixel at location (x, y)
will be
read into the array index specified by the offset
parameter.
Pixel data for a row will be stored in adjacent locations within
the array packed as tightly as possible for increasing X
coordinates.
Pixel data for adjacent rows will be stored offset from each other
by the number of int array elements defined by
scanlineStride
.x
- the X coordinate of the rectangular region to ready
- the Y coordinate of the rectangular region to readw
- the width of the rectangular region to readh
- the height of the rectangular region to readpixelformat
- the PixelFormat<IntBuffer>
object
defining the int format to store the pixels into bufferbuffer
- a int array to store the returned pixel dataoffset
- the offset into buffer
to store the first
pixel datascanlineStride
- the distance between the pixel data for the
start of one row of data in the buffer to the start of the
next row of dataCopyright (c) 2008, 2012, Oracle and/or its affiliates. All rights reserved. Use is subject to