Top Description Inners Methods
com.jogamp.nativewindow.util

public Interface PixelRectangle

Known Direct Subinterfaces
com.jogamp.newt.Display.PointerIcon
Known Direct Implementers
com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
Imports
java.nio.ByteBuffer

Pixel Rectangle identified by it's hashCode().

The getPixels() are assumed to be immutable.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
PixelRectangle.GenericPixelRect

Generic PixelRectangle implementation

Method Summary

Modifier and TypeMethod and Description
public PixelFormat
public ByteBuffer
getPixels()

Returns the pixels.

public DimensionImmutable
getSize()

Returns the size, i.e. width and height.

public int
getStride()

Returns stride in byte-size, i.e. byte count from one line to the next.

public int
hashCode()

Computes a hash code over:

  • pixelformat
  • size
  • stride
  • isGLOriented
  • pixels
public boolean
isGLOriented()

Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left.

public String

Method Detail

getPixelformatback to summary
public PixelFormat getPixelformat()

Returns the PixelFormat.

getPixelsback to summary
public ByteBuffer getPixels()

Returns the pixels.

getSizeback to summary
public DimensionImmutable getSize()

Returns the size, i.e. width and height.

getStrideback to summary
public int getStride()

Returns stride in byte-size, i.e. byte count from one line to the next.

Must be >= getPixelformat().bytesPerPixel() * getSize().getWidth().

hashCodeback to summary
public int hashCode()

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.

Annotations
@Override
isGLOrientedback to summary
public boolean isGLOriented()

Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left. Otherwise returns false, i.e. origin at top left.

toStringback to summary
public String toString()
Annotations
@Override
com.jogamp.nativewindow.util back to summary

public Class PixelRectangle.GenericPixelRect

extends Object
implements PixelRectangle
Class Inheritance
All Implemented Interfaces
com.jogamp.nativewindow.util.PixelRectangle
Known Direct Subclasses
com.jogamp.opengl.util.PNGPixelRect

Generic PixelRectangle implementation

Field Summary

Modifier and TypeField and Description
private int
private volatile boolean
protected final boolean
protected final PixelFormat
protected final ByteBuffer
protected final DimensionImmutable
protected final int

Constructor Summary

AccessConstructor and Description
public
GenericPixelRect(final PixelFormat pixelformat, final DimensionImmutable size, int
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 to width * bytes-per-pixel.
strideInBytes
,
final boolean isGLOriented, final ByteBuffer pixels)

public
GenericPixelRect(final PixelRectangle src)

Copy ctor validating src.

Method Summary

Modifier and TypeMethod and Description
public PixelFormat
public ByteBuffer
public DimensionImmutable
getSize()

Implements com.jogamp.nativewindow.util.PixelRectangle.getSize.

Returns the size, i.e. width and height.
public int
getStride()

Implements com.jogamp.nativewindow.util.PixelRectangle.getStride.

Returns stride in byte-size, i.e. byte count from one line to the next.
public int
hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.PixelRectangle.hashCode.

Computes a hash code over:

  • pixelformat
  • size
  • stride
  • isGLOriented
  • pixels
public boolean
isGLOriented()

Implements com.jogamp.nativewindow.util.PixelRectangle.isGLOriented.

Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left.
public final String
toString()

Overrides java.lang.Object.toString.

Implements com.jogamp.nativewindow.util.PixelRectangle.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

hashCodeback to summary
private int hashCode
hashCodeComputedback to summary
private volatile boolean hashCodeComputed
isGLOrientedback to summary
protected final boolean isGLOriented
pixelformatback to summary
protected final PixelFormat pixelformat
pixelsback to summary
protected final ByteBuffer pixels
sizeback to summary
protected final DimensionImmutable size
strideInBytesback to summary
protected final int strideInBytes

Constructor Detail

GenericPixelRectback to summary
public GenericPixelRect(final PixelFormat pixelformat, final DimensionImmutable size, int strideInBytes, final boolean isGLOriented, final ByteBuffer pixels) throws IllegalArgumentException, IndexOutOfBoundsException
Parameters
strideInBytes:int

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 to width * bytes-per-pixel.

Exceptions
IllegalArgumentException:
if strideInBytes is invalid.
IndexOutOfBoundsException:
if pixels has insufficient bytes left
GenericPixelRectback to summary
public GenericPixelRect(final PixelRectangle src) throws IllegalArgumentException, IndexOutOfBoundsException

Copy ctor validating src.

Exceptions
IllegalArgumentException:
if strideInBytes is invalid.
IndexOutOfBoundsException:
if pixels has insufficient bytes left

Method Detail

getPixelformatback to summary
public PixelFormat getPixelformat()

Implements com.jogamp.nativewindow.util.PixelRectangle.getPixelformat.

Doc from com.jogamp.nativewindow.util.PixelRectangle.getPixelformat.

Returns the PixelFormat.

Annotations
@Override
getPixelsback to summary
public ByteBuffer getPixels()

Implements com.jogamp.nativewindow.util.PixelRectangle.getPixels.

Doc from com.jogamp.nativewindow.util.PixelRectangle.getPixels.

Returns the pixels.

Annotations
@Override
getSizeback to summary
public DimensionImmutable getSize()

Implements com.jogamp.nativewindow.util.PixelRectangle.getSize.

Doc from com.jogamp.nativewindow.util.PixelRectangle.getSize.

Returns the size, i.e. width and height.

Annotations
@Override
getStrideback to summary
public int getStride()

Implements com.jogamp.nativewindow.util.PixelRectangle.getStride.

Doc from com.jogamp.nativewindow.util.PixelRectangle.getStride.

Returns stride in byte-size, i.e. byte count from one line to the next.

Must be >= getPixelformat().bytesPerPixel() * getSize().getWidth().

Annotations
@Override
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Implements com.jogamp.nativewindow.util.PixelRectangle.hashCode.

Doc from com.jogamp.nativewindow.util.PixelRectangle.hashCode.

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.

Returns:int

Doc from java.lang.Object.hashCode.

a hash code value for this object

Annotations
@Override
isGLOrientedback to summary
public boolean isGLOriented()

Implements com.jogamp.nativewindow.util.PixelRectangle.isGLOriented.

Doc from com.jogamp.nativewindow.util.PixelRectangle.isGLOriented.

Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left. Otherwise returns false, i.e. origin at top left.

Annotations
@Override
toStringback to summary
public final String toString()

Overrides java.lang.Object.toString.

Implements com.jogamp.nativewindow.util.PixelRectangle.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object

Annotations
@Override