public class PNGPixelRect extends PixelRectangle.GenericPixelRect
PixelRectangle.GenericPixelRect
Constructor and Description |
---|
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.
|
PNGPixelRect(PixelRectangle src,
double dpiX,
double dpiY) |
Modifier and Type | Method and Description |
---|---|
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) |
getPixelformat, getPixels, getSize, getStride, hashCode, isGLOriented, toString
public PNGPixelRect(PixelFormat pixelformat, DimensionImmutable size, int strideInBytes, boolean isGLOriented, ByteBuffer pixels, double dpiX, double dpiY)
pixelformat
- size
- strideInBytes
- isGLOriented
- see PixelRectangle.GenericPixelRect.isGLOriented()
.pixels
- dpiX
- dpiY
- public PNGPixelRect(PixelRectangle src, double dpiX, double dpiY)
public static PNGPixelRect read(InputStream in, PixelFormat ddestFmt, boolean destDirectBuffer, int destMinStrideInBytes, boolean destIsGLOriented) throws IOException
Implicitly converts the image to match the desired:
PixelFormat
, see PixelRectangle.GenericPixelRect.getPixelformat()
destStrideInBytes
, see PixelRectangle.GenericPixelRect.getStride()
destIsGLOriented
, see PixelRectangle.GenericPixelRect.isGLOriented()
in
- input streamdestFmt
- desired destination PixelFormat
incl. conversion, maybe null
to use source PixelFormat
destDirectBuffer
- 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
- IOException
public double[] getDpi()
public void write(OutputStream outstream, boolean closeOutstream) throws IOException
IOException
Copyright 2010 JogAmp Community.