Reads and writes SGI RGB/RGBA images.
Written from Paul Bourke's adaptation of the SGI specification.
| Modifier and Type | Class and Description |
|---|---|
| pack-priv static class |
| Modifier and Type | Field and Description |
|---|---|
| private byte[] | |
| private int | |
| private final SGIImage. | |
| private static final int | |
| private int | |
| private int[] | |
| private int[] | |
| private byte[] | |
| private byte[] |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public static SGIImage | createFromData(final int width, final int height, final boolean hasAlpha, final byte[] data)
Creates an SGIImage from the specified data in either RGB or RGBA format. |
| private void | |
| public byte[] | getData()
Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D. |
| public int | |
| public int | |
| private void | |
| public int | |
| private static byte | imgref(final byte[] i, final int x, final int y, final int z, final int xs, final int ys, final int zs)
|
| public static boolean | isSGIImage(InputStream in)
Deprecated
rather call
Determines from the magic number whether the given InputStream points to
an SGI RGB image.
ImageType#getFileSuffix(InputStream)
|
| private void | |
| public static SGIImage | |
| public static SGIImage | |
| private byte[] | |
| private void | rgbatorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] a, final byte[] dest, final int lptr)
|
| private void | |
| public String | |
| public void | |
| public void | |
| private void | writeHeader(final DataOutputStream stream, final int xsize, final int ysize, final int zsize, final boolean rle)
|
| private void | writeImage(final File file, byte[] data, final int xsize, final int ysize, final int zsize, final boolean yflip)
|
| data | back to summary |
|---|---|
| private byte[] data | |
| format | back to summary |
|---|---|
| private int format | |
| header | back to summary |
|---|---|
| private final SGIImage. | |
| MAGIC | back to summary |
|---|---|
| private static final int MAGIC | |
| rleEnd | back to summary |
|---|---|
| private int rleEnd | |
| rowSize | back to summary |
|---|---|
| private int[] rowSize | |
| rowStart | back to summary |
|---|---|
| private int[] rowStart | |
| tmpData | back to summary |
|---|---|
| private byte[] tmpData | |
| tmpRead | back to summary |
|---|---|
| private byte[] tmpRead | |
| SGIImage | back to summary |
|---|---|
| private SGIImage(final SGIImage. | |
| bwtorgba | back to summary |
|---|---|
| private void bwtorgba(final byte[] b, final byte[] dest, final int lptr) | |
| createFromData | back to summary |
|---|---|
| public static SGIImage createFromData(final int width, final int height, final boolean hasAlpha, final byte[] data) Creates an SGIImage from the specified data in either RGB or RGBA format. | |
| decodeImage | back to summary |
|---|---|
| private void decodeImage(final DataInputStream in) throws IOException | |
| getData | back to summary |
|---|---|
| public byte[] getData() Returns the raw data for this texture in the correct (bottom-to-top) order for calls to glTexImage2D. | |
| getFormat | back to summary |
|---|---|
| public int getFormat() Returns the OpenGL format for this texture; e.g. GL.GL_RGB or GL.GL_RGBA. | |
| getHeight | back to summary |
|---|---|
| public int getHeight() Returns the height of the image. | |
| getRow | back to summary |
|---|---|
| private void getRow(final byte[] buf, final int y, final int z) | |
| getWidth | back to summary |
|---|---|
| public int getWidth() Returns the width of the image. | |
| imgref | back to summary |
|---|---|
| private static byte imgref(final byte[] i, final int x, final int y, final int z, final int xs, final int ys, final int zs) | |
| isSGIImage | back to summary |
|---|---|
| public static boolean isSGIImage(InputStream in) throws IOException
Deprecated rather call Determines from the magic number whether the given InputStream points to an SGI RGB image. The given InputStream must return true from markSupported() and support a minimum of two bytes of read-ahead.
| |
| latorgba | back to summary |
|---|---|
| private void latorgba(final byte[] b, final byte[] a, final byte[] dest, final int lptr) | |
| read | back to summary |
|---|---|
| public static SGIImage read(final String filename) throws IOException Reads an SGI image from the specified file. | |
| read | back to summary |
|---|---|
| public static SGIImage read(final InputStream in) throws IOException Reads an SGI image from the specified InputStream. | |
| readAll | back to summary |
|---|---|
| private byte[] readAll(final DataInputStream in) throws IOException | |
| rgbatorgba | back to summary |
|---|---|
| private void rgbatorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] a, final byte[] dest, final int lptr) | |
| rgbtorgba | back to summary |
|---|---|
| private void rgbtorgba(final byte[] r, final byte[] g, final byte[] b, final byte[] dest, final int lptr) | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |
| write | back to summary |
|---|---|
| public void write(final String filename, final boolean flipVertically) throws IOException Writes this SGIImage to the specified file name. If flipVertically is set, outputs the scanlines from top to bottom rather than the default bottom to top order. | |
| write | back to summary |
|---|---|
| public void write(final File file, final boolean flipVertically) throws IOException Writes this SGIImage to the specified file. If flipVertically is set, outputs the scanlines from top to bottom rather than the default bottom to top order. | |
| writeHeader | back to summary |
|---|---|
| private void writeHeader(final DataOutputStream stream, final int xsize, final int ysize, final int zsize, final boolean rle) throws IOException | |
| writeImage | back to summary |
|---|---|
| private void writeImage(final File file, byte[] data, final int xsize, final int ysize, final int zsize, final boolean yflip) throws IOException | |
| Modifier and Type | Field and Description |
|---|---|
| pack-priv byte | |
| pack-priv int | |
| pack-priv short | |
| pack-priv int | |
| pack-priv String | |
| pack-priv short | |
| pack-priv int | |
| pack-priv int | |
| pack-priv byte | |
| pack-priv short | |
| pack-priv short | |
| pack-priv short |
| Access | Constructor and Description |
|---|---|
| pack-priv | |
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public String |
| bpc | back to summary |
|---|---|
| pack-priv byte bpc | |
| colormap | back to summary |
|---|---|
| pack-priv int colormap | |
| dimension | back to summary |
|---|---|
| pack-priv short dimension | |
| dummy | back to summary |
|---|---|
| pack-priv int dummy | |
| imagename | back to summary |
|---|---|
| pack-priv String imagename | |
| magic | back to summary |
|---|---|
| pack-priv short magic | |
| pixmax | back to summary |
|---|---|
| pack-priv int pixmax | |
| pixmin | back to summary |
|---|---|
| pack-priv int pixmin | |
| storage | back to summary |
|---|---|
| pack-priv byte storage | |
| xsize | back to summary |
|---|---|
| pack-priv short xsize | |
| ysize | back to summary |
|---|---|
| pack-priv short ysize | |
| zsize | back to summary |
|---|---|
| pack-priv short zsize | |
| Header | back to summary |
|---|---|
| pack-priv Header() | |
| Header | back to summary |
|---|---|
| pack-priv Header(final DataInputStream in) throws IOException | |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object. | |