Package com.jogamp.nativewindow.util
Class PixelRectangle.GenericPixelRect
java.lang.Object
com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
- All Implemented Interfaces:
PixelRectangle
- Direct Known Subclasses:
PNGPixelRect
- Enclosing interface:
- PixelRectangle
Generic PixelRectangle implementation
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.util.PixelRectangle
PixelRectangle.GenericPixelRect
-
Constructor Summary
ConstructorsConstructorDescriptionGenericPixelRect
(PixelFormat pixelformat, DimensionImmutable size, int strideInBytes, boolean isGLOriented, ByteBuffer pixels) Copy ctor validating src. -
Method Summary
Modifier and TypeMethodDescriptionReturns thePixelFormat
.Returns the pixels.getSize()
Returns the size, i.e.int
Returns stride in byte-size, i.e.int
hashCode()
Computes a hash code over: pixelformat size stride isGLOriented pixelsboolean
Returnstrue
if the memory is laid out in OpenGL's coordinate system, origin at bottom left.final String
toString()
-
Constructor Details
-
GenericPixelRect
public GenericPixelRect(PixelFormat pixelformat, DimensionImmutable size, int strideInBytes, boolean isGLOriented, ByteBuffer pixels) throws IllegalArgumentException, IndexOutOfBoundsException - Parameters:
pixelformat
-size
-strideInBytes
- stride in byte-size, i.e. byte count from one line to the next. If not zero, value must be >=width * bytes-per-pixel
. If zero, stride is set towidth * bytes-per-pixel
.isGLOriented
-pixels
-- Throws:
IllegalArgumentException
- ifstrideInBytes
is invalid.IndexOutOfBoundsException
- ifpixels
has insufficient bytes left
-
GenericPixelRect
public GenericPixelRect(PixelRectangle src) throws IllegalArgumentException, IndexOutOfBoundsException Copy ctor validating src.- Parameters:
src
-- Throws:
IllegalArgumentException
- ifstrideInBytes
is invalid.IndexOutOfBoundsException
- ifpixels
has insufficient bytes left
-
-
Method Details
-
hashCode
public int hashCode()Description copied from interface:PixelRectangle
Computes a hash code over:
- pixelformat
- size
- stride
- isGLOriented
- pixels
The hashCode shall be computed only once with first call and stored for later retrieval to enhance performance.
- Specified by:
hashCode
in interfacePixelRectangle
- Overrides:
hashCode
in classObject
-
getPixelformat
Description copied from interface:PixelRectangle
Returns thePixelFormat
.- Specified by:
getPixelformat
in interfacePixelRectangle
-
getSize
Description copied from interface:PixelRectangle
Returns the size, i.e. width and height.- Specified by:
getSize
in interfacePixelRectangle
-
getStride
public int getStride()Description copied from interface:PixelRectangle
Returns stride in byte-size, i.e. byte count from one line to the next.Must be >=
PixelRectangle.getPixelformat()
.bytesPerPixel()
*PixelRectangle.getSize()
.getWidth()
.- Specified by:
getStride
in interfacePixelRectangle
-
isGLOriented
public boolean isGLOriented()Description copied from interface:PixelRectangle
Returnstrue
if the memory is laid out in OpenGL's coordinate system, origin at bottom left. Otherwise returnsfalse
, i.e. origin at top left.- Specified by:
isGLOriented
in interfacePixelRectangle
-
getPixels
Description copied from interface:PixelRectangle
Returns the pixels.- Specified by:
getPixels
in interfacePixelRectangle
-
toString
- Specified by:
toString
in interfacePixelRectangle
- Overrides:
toString
in classObject
-