com.jogamp.opengl.util
Class PNGPixelRect
java.lang.Object
javax.media.nativewindow.util.PixelRectangle.GenericPixelRect
com.jogamp.opengl.util.PNGPixelRect
- All Implemented Interfaces:
- PixelRectangle
public class PNGPixelRect
- extends PixelRectangle.GenericPixelRect
|
Method Summary |
double[] |
getDpi()
Returns the dpi of the image. |
static PNGPixelRect |
read(InputStream in,
PixelFormat ddestFmt,
boolean destDirectBuffer,
int destMinStrideInBytes,
boolean destIsGLOriented)
Reads a PNG image from the specified InputStream. |
void |
write(OutputStream outstream,
boolean closeOutstream)
|
static void |
write(PixelFormat pixelformat,
DimensionImmutable size,
int strideInPixels,
boolean isGLOriented,
IntBuffer pixels,
double dpiX,
double dpiY,
OutputStream outstream,
boolean closeOutstream)
|
PNGPixelRect
public PNGPixelRect(PixelFormat pixelformat,
DimensionImmutable size,
int strideInBytes,
boolean isGLOriented,
ByteBuffer pixels,
double dpiX,
double dpiY)
- Creates a PNGPixelRect from data supplied by the end user. Shares
data with the passed ByteBuffer.
- Parameters:
pixelformat - size - strideInBytes - isGLOriented - see PixelRectangle.GenericPixelRect.isGLOriented().pixels - dpiX - dpiY -
PNGPixelRect
public PNGPixelRect(PixelRectangle src,
double dpiX,
double dpiY)
read
public static PNGPixelRect read(InputStream in,
PixelFormat ddestFmt,
boolean destDirectBuffer,
int destMinStrideInBytes,
boolean destIsGLOriented)
throws IOException
- Reads a PNG image from the specified InputStream.
Implicitly converts the image to match the desired:
- Parameters:
in - input streamdestFmt - desired destination PixelFormat incl. conversion, maybe null to use source PixelFormatdestDirectBuffer - if true, using a direct NIO buffer, otherwise an array backed bufferdestMinStrideInBytes - used if greater than PNG's stride, otherwise using PNG's stride. Stride is width * bytes-per-pixel.destIsGLOriented -
- Returns:
- the newly created PNGPixelRect instance
- Throws:
IOException
getDpi
public double[] getDpi()
- Returns the dpi of the image.
write
public void write(OutputStream outstream,
boolean closeOutstream)
throws IOException
- Throws:
IOException
write
public static void write(PixelFormat pixelformat,
DimensionImmutable size,
int strideInPixels,
boolean isGLOriented,
IntBuffer pixels,
double dpiX,
double dpiY,
OutputStream outstream,
boolean closeOutstream)
throws IOException
- Throws:
IOException
Copyright 2010 JogAmp Community.