Package com.jogamp.opengl.util
Class PNGPixelRect
java.lang.Object
com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
com.jogamp.opengl.util.PNGPixelRect
- All Implemented Interfaces:
PixelRectangle
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.jogamp.nativewindow.util.PixelRectangle
PixelRectangle.GenericPixelRect -
Constructor Summary
ConstructorsConstructorDescriptionPNGPixelRect(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) -
Method Summary
Modifier and TypeMethodDescriptiondouble[]getDpi()Returns the dpi of the image.static PNGPixelRectread(InputStream in, PixelFormat ddestFmt, boolean destDirectBuffer, int destMinStrideInBytes, boolean destIsGLOriented) Reads a PNG image from the specified InputStream.static voidwrite(PixelFormat pixelformat, DimensionImmutable size, int strideInPixels, boolean isGLOriented, IntBuffer pixels, double dpiX, double dpiY, OutputStream outstream, boolean closeOutstream) voidwrite(OutputStream outstream, boolean closeOutstream) Methods inherited from class com.jogamp.nativewindow.util.PixelRectangle.GenericPixelRect
getPixelformat, getPixels, getSize, getStride, hashCode, isGLOriented, toString
-
Constructor Details
-
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- seePixelRectangle.GenericPixelRect.isGLOriented().pixels-dpiX-dpiY-
-
PNGPixelRect
-
-
Method Details
-
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:
PixelFormat, seePixelRectangle.GenericPixelRect.getPixelformat()destStrideInBytes, seePixelRectangle.GenericPixelRect.getStride()destIsGLOriented, seePixelRectangle.GenericPixelRect.isGLOriented()
- Parameters:
in- input streamdestFmt- desired destinationPixelFormatincl. conversion, maybenullto use sourcePixelFormatdestDirectBuffer- 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
- 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
-