|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectloci.formats.FormatHandler
loci.formats.FormatReader
loci.formats.PictReader
PictReader is the file format reader for Apple PICT files. Most of this code was adapted from the PICT readers in JIMI (http://java.sun.com/products/jimi/index.html), ImageMagick (http://www.imagemagick.org), and Java QuickDraw.
| Field Summary | |
protected byte[] |
bytes
Pixel bytes. |
protected int |
height
Height of the image. |
protected RandomAccessFile |
in
Current file. |
protected boolean |
little
Flag indicating whether current file is little endian. |
protected short[][] |
lookup
Color lookup table for palette color images. |
protected int |
pictState
Image state. |
protected int |
pt
Pointer into the array of bytes representing the file. |
protected LegacyQTReader |
qtReader
Helper reader in case this one fails. |
protected int |
rowBytes
Number of bytes in a row of pixel data (variable). |
protected int |
state
Decoder state. |
protected Vector |
strips
Vector of byte arrays representing individual rows. |
protected boolean |
versionOne
Whether or not the file is PICT v1. |
protected int |
width
Width of the image. |
| Fields inherited from class loci.formats.FormatReader |
DEBUG, DEBUG_LEVEL, metadata, ome |
| Fields inherited from class loci.formats.FormatHandler |
chooser, currentId, filters, format, suffixes |
| Constructor Summary | |
PictReader()
Constructs a new PICT reader. |
|
| Method Summary | |
void |
close()
Closes any open files. |
Dimension |
getDimensions(byte[] stuff)
Get the dimensions of a PICT file from the first 4 bytes after header. |
int |
getImageCount(String id)
Determines the number of images in the given PICT file. |
protected void |
initFile(String id)
Initializes the given PICT file. |
boolean |
isThisType(byte[] block)
Checks if the given block is a valid header for a PICT file. |
static void |
main(String[] args)
|
BufferedImage |
open(String id,
int no)
Obtains the specified image from the given PICT file. |
BufferedImage |
openBytes(byte[] pix)
Open a PICT image from an array of bytes (used by OpenlabReader). |
| Methods inherited from class loci.formats.FormatReader |
createFilters, getMetadata, getMetadataValue, getOMENode, open, testRead |
| Methods inherited from class loci.formats.FormatHandler |
getFileChooser, getFileFilters, getFormat, getSuffixes, isThisType |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected RandomAccessFile in
protected boolean little
protected byte[] bytes
protected int width
protected int height
protected int rowBytes
protected int state
protected int pictState
protected int pt
protected Vector strips
protected boolean versionOne
protected short[][] lookup
protected LegacyQTReader qtReader
| Constructor Detail |
public PictReader()
| Method Detail |
public boolean isThisType(byte[] block)
isThisType in class FormatReader
public int getImageCount(String id)
throws FormatException,
IOException
getImageCount in class FormatReaderFormatException
IOException
public BufferedImage open(String id,
int no)
throws FormatException,
IOException
open in class FormatReaderFormatException
IOException
public void close()
throws FormatException,
IOException
close in class FormatReaderFormatException
IOException
protected void initFile(String id)
throws FormatException,
IOException
initFile in class FormatReaderFormatException
IOException
public Dimension getDimensions(byte[] stuff)
throws FormatException
FormatException
public BufferedImage openBytes(byte[] pix)
throws FormatException
FormatException
public static void main(String[] args)
throws FormatException,
IOException
FormatException
IOException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||