Package com.jogamp.nativewindow.util
Class PixelRectangle.GenericPixelRect
- java.lang.Object
-
- com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
-
- All Implemented Interfaces:
PixelRectangle
- Enclosing interface:
- PixelRectangle
public static class PixelRectangle.GenericPixelRect extends Object implements PixelRectangle
Generic PixelRectangle implementation
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.util.PixelRectangle
PixelRectangle.GenericPixelRect
-
-
Constructor Summary
Constructors Constructor Description GenericPixelRect(PixelFormat pixelformat, DimensionImmutable size, int strideInBytes, boolean isGLOriented, ByteBuffer pixels)GenericPixelRect(PixelRectangle src)Copy ctor validating src.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PixelFormatgetPixelformat()Returns thePixelFormat.ByteBuffergetPixels()Returns the pixels.DimensionImmutablegetSize()Returns the size, i.e.intgetStride()Returns stride in byte-size, i.e.inthashCode()Computes a hash code over: pixelformat size stride isGLOriented pixelsbooleanisGLOriented()Returnstrueif the memory is laid out in OpenGL's coordinate system, origin at bottom left.StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
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
public PixelFormat getPixelformat()
Description copied from interface:PixelRectangleReturns thePixelFormat.- Specified by:
getPixelformatin interfacePixelRectangle
-
getSize
public DimensionImmutable 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
public ByteBuffer getPixels()
Description copied from interface:PixelRectangleReturns the pixels.- Specified by:
getPixelsin interfacePixelRectangle
-
toString
public final String toString()
- Specified by:
toStringin interfacePixelRectangle- Overrides:
toStringin classObject
-
-