28package com.jogamp.nativewindow.util;
30import java.nio.ByteBuffer;
97 private int hashCode = 0;
98 private volatile boolean hashCodeComputed =
false;
113 throws IllegalArgumentException, IndexOutOfBoundsException
123 if(
pixels.limit() < reqBytes ) {
124 throw new IndexOutOfBoundsException(
"Dest buffer has insufficient bytes left, needs "+reqBytes+
": "+
pixels);
140 throws IllegalArgumentException, IndexOutOfBoundsException
142 this(src.getPixelformat(), src.getSize(), src.getStride(), src.isGLOriented(), src.getPixels());
147 if( !hashCodeComputed ) {
148 synchronized (
this) {
149 if( !hashCodeComputed ) {
155 hashCode = ((hash << 5) - hash) +
pixels.hashCode();
156 hashCodeComputed =
true;
Generic PixelRectangle implementation.
int getStride()
Returns stride in byte-size, i.e.
final PixelFormat pixelformat
final DimensionImmutable size
DimensionImmutable getSize()
Returns the size, i.e.
ByteBuffer getPixels()
Returns the pixels.
GenericPixelRect(final PixelFormat pixelformat, final DimensionImmutable size, int strideInBytes, final boolean isGLOriented, final ByteBuffer pixels)
final boolean isGLOriented
PixelFormat getPixelformat()
Returns the PixelFormat.
boolean isGLOriented()
Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left.
GenericPixelRect(final PixelRectangle src)
Copy ctor validating src.
Immutable Dimension Interface, consisting of it's read only components:
Pixel Rectangle identified by it's hashCode().
boolean isGLOriented()
Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left.
DimensionImmutable getSize()
Returns the size, i.e.
ByteBuffer getPixels()
Returns the pixels.
int getStride()
Returns stride in byte-size, i.e.
PixelFormat getPixelformat()
Returns the PixelFormat.