javax.media.nativewindow.util
Class PixelRectangle.GenericPixelRect

java.lang.Object
  extended by javax.media.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 javax.media.nativewindow.util.PixelRectangle
PixelRectangle.GenericPixelRect
 
Constructor Summary
PixelRectangle.GenericPixelRect(PixelFormat pixelformat, DimensionImmutable size, int strideInBytes, boolean isGLOriented, ByteBuffer pixels)
           
PixelRectangle.GenericPixelRect(PixelRectangle src)
          Copy ctor validating src.
 
Method Summary
 PixelFormat getPixelformat()
          Returns the PixelFormat.
 ByteBuffer getPixels()
          Returns the pixels.
 DimensionImmutable getSize()
          Returns the size, i.e.
 int getStride()
          Returns stride in byte-size, i.e.
 int hashCode()
           Computes a hash code over: pixelformat size stride isGLOriented pixels
 boolean isGLOriented()
          Returns true if the memory is laid out in OpenGL's coordinate system, origin at bottom left.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PixelRectangle.GenericPixelRect

public PixelRectangle.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 to width * bytes-per-pixel.
isGLOriented -
pixels -
Throws:
IllegalArgumentException - if strideInBytes is invalid.
IndexOutOfBoundsException - if pixels has insufficient bytes left

PixelRectangle.GenericPixelRect

public PixelRectangle.GenericPixelRect(PixelRectangle src)
                                throws IllegalArgumentException,
                                       IndexOutOfBoundsException
Copy ctor validating src.

Parameters:
src -
Throws:
IllegalArgumentException - if strideInBytes is invalid.
IndexOutOfBoundsException - if pixels has insufficient bytes left
Method Detail

hashCode

public int hashCode()
Description copied from interface: PixelRectangle

Computes a hash code over:

The hashCode shall be computed only once with first call and stored for later retrieval to enhance performance.

Specified by:
hashCode in interface PixelRectangle
Overrides:
hashCode in class Object

getPixelformat

public PixelFormat getPixelformat()
Description copied from interface: PixelRectangle
Returns the PixelFormat.

Specified by:
getPixelformat in interface PixelRectangle

getSize

public DimensionImmutable getSize()
Description copied from interface: PixelRectangle
Returns the size, i.e. width and height.

Specified by:
getSize in interface PixelRectangle

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 interface PixelRectangle

isGLOriented

public boolean isGLOriented()
Description copied from interface: PixelRectangle
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.

Specified by:
isGLOriented in interface PixelRectangle

getPixels

public ByteBuffer getPixels()
Description copied from interface: PixelRectangle
Returns the pixels.

Specified by:
getPixels in interface PixelRectangle

toString

public final String toString()
Specified by:
toString in interface PixelRectangle
Overrides:
toString in class Object


Copyright 2010 JogAmp Community.