Package com.jogamp.nativewindow.util
Class PixelRectangle.GenericPixelRect
java.lang.Object
com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
- All Implemented Interfaces:
PixelRectangle
- 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.intReturns stride in byte-size, i.e.inthashCode()Computes a hash code over: pixelformat size stride isGLOriented pixelsbooleanReturnstrueif the memory is laid out in OpenGL's coordinate system, origin at bottom left.final StringtoString()
-
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- ifstrideInBytesis invalid.IndexOutOfBoundsException- ifpixelshas insufficient bytes left
-
GenericPixelRect
public GenericPixelRect(PixelRectangle src) throws IllegalArgumentException, IndexOutOfBoundsException Copy ctor validating src.- Parameters:
src-- Throws:
IllegalArgumentException- ifstrideInBytesis invalid.IndexOutOfBoundsException- ifpixelshas insufficient bytes left
-
-
Method Details
-
hashCode
public int hashCode()Description copied from interface:PixelRectangleComputes 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:
hashCodein interfacePixelRectangle- Overrides:
hashCodein classObject
-
getPixelformat
Description copied from interface:PixelRectangleReturns thePixelFormat.- Specified by:
getPixelformatin interfacePixelRectangle
-
getSize
Description copied from interface:PixelRectangleReturns the size, i.e. width and height.- Specified by:
getSizein interfacePixelRectangle
-
getStride
public int getStride()Description copied from interface:PixelRectangleReturns stride in byte-size, i.e. byte count from one line to the next.Must be >=
PixelRectangle.getPixelformat().bytesPerPixel()*PixelRectangle.getSize().getWidth().- Specified by:
getStridein interfacePixelRectangle
-
isGLOriented
public boolean isGLOriented()Description copied from interface:PixelRectangleReturnstrueif the memory is laid out in OpenGL's coordinate system, origin at bottom left. Otherwise returnsfalse, i.e. origin at top left.- Specified by:
isGLOrientedin interfacePixelRectangle
-
getPixels
Description copied from interface:PixelRectangleReturns the pixels.- Specified by:
getPixelsin interfacePixelRectangle
-
toString
- Specified by:
toStringin interfacePixelRectangle- Overrides:
toStringin classObject
-