public class PCXReader extends ImageReader implements JImageReader
Reader for 8-bit and 24-bit PCX files.
This class does not support EGA (16 color) or CGA .PCX files.
Originally created on April 15, 2010. 24-bit PCX support added March 28, 2011.
availableLocales, ignoreMetadata, input, locale, minIndex, originatingProvider, progressListeners, seekForwardOnly, updateListeners, warningListeners, warningLocales
Constructor and Description |
---|
PCXReader(ImageReaderSpi originatingProvider) |
PCXReader(String string)
Constructor takes a String representation of the PCX file location.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
canReadImage(ImageInputStream iis) |
void |
createBufferedImage()
Creates a BufferedImage from the PCX image.
|
int |
getHeight()
Returns the image's height.
|
int |
getHeight(int imageIndex) |
BufferedImage |
getImage()
Returns the PCX image as a BufferedImage.
|
IIOMetadata |
getImageMetadata(int imageIndex) |
Iterator<ImageTypeSpecifier> |
getImageTypes(int image) |
String |
getMetadataSummary()
Returns a summary of the image's metadata.
|
int |
getNumImages(boolean whatever) |
IIOMetadata |
getStreamMetadata() |
BufferedImage |
getSubimage(int xStart,
int yStart,
int width,
int height)
Returns the subimage of this PCX image.
|
int |
getWidth()
Returns the image's width.
|
int |
getWidth(int imageIndex) |
void |
parse()
Parses the PCX that has been read into the buffer.
|
void |
processFile()
Processes the file supplied at initialization, and stores the image in the reader.
|
BufferedImage |
read(int imageIndex,
ImageReadParam ignored) |
void |
readFile()
Reads the PCX file into the buffer.
|
void |
readFile(ImageInputStream iis)
Reads the PCX file into the buffer.
|
void |
saveExistingPCX(String filename)
Saves a PCX, assuming that we already have a PCX.
|
void |
setColor(int index,
Color color)
Changes the color that was at position index in the palette to
a new color, color.
|
String |
toString() |
abort, abortRequested, addIIOReadProgressListener, addIIOReadUpdateListener, addIIOReadWarningListener, canReadRaster, checkReadParamBandSettings, clearAbortRequest, computeRegions, dispose, getAspectRatio, getAvailableLocales, getDefaultReadParam, getDestination, getFormatName, getImageMetadata, getInput, getLocale, getMinIndex, getNumThumbnails, getOriginatingProvider, getRawImageType, getSourceRegion, getStreamMetadata, getThumbnailHeight, getThumbnailWidth, getTileGridXOffset, getTileGridYOffset, getTileHeight, getTileWidth, hasThumbnails, isIgnoringMetadata, isImageTiled, isRandomAccessEasy, isSeekForwardOnly, processImageComplete, processImageProgress, processImageStarted, processImageUpdate, processPassComplete, processPassStarted, processReadAborted, processSequenceComplete, processSequenceStarted, processThumbnailComplete, processThumbnailPassComplete, processThumbnailPassStarted, processThumbnailProgress, processThumbnailStarted, processThumbnailUpdate, processWarningOccurred, processWarningOccurred, read, readAll, readAll, readAsRenderedImage, readerSupportsThumbnails, readRaster, readThumbnail, readTile, readTileRaster, removeAllIIOReadProgressListeners, removeAllIIOReadUpdateListeners, removeAllIIOReadWarningListeners, removeIIOReadProgressListener, removeIIOReadUpdateListener, removeIIOReadWarningListener, reset, setInput, setInput, setInput, setLocale
public PCXReader(String string)
string
- - A String representing the PCX file location.public PCXReader(ImageReaderSpi originatingProvider)
public void processFile()
JImageReader
processFile
in interface JImageReader
public void readFile()
public void readFile(ImageInputStream iis)
iis
- The ImageInputStream that is being read.public void parse()
public void createBufferedImage()
public BufferedImage getSubimage(int xStart, int yStart, int width, int height)
xStart
- - The x coordinate (in this image) of the leftmost part of the subimage.yStart
- - The y coordinate (in this image) of the uppermost part of the subimage.width
- - The width of the subimage.height
- - The height of the subimage.public BufferedImage getImage()
getImage
in interface JImageReader
public int getWidth()
JImageReader
getWidth
in interface JImageReader
public int getHeight()
JImageReader
getHeight
in interface JImageReader
public String toString()
public void saveExistingPCX(String filename)
filename
- The name of the file, as it should be saved on disk.public void setColor(int index, Color color)
index
- - The index in the palette of the color to be replaced.color
- - The new color.public String getMetadataSummary()
JImageReader
getMetadataSummary
in interface JImageReader
public BufferedImage read(int imageIndex, ImageReadParam ignored)
read
in class ImageReader
public IIOMetadata getImageMetadata(int imageIndex)
getImageMetadata
in class ImageReader
public IIOMetadata getStreamMetadata()
getStreamMetadata
in class ImageReader
public Iterator<ImageTypeSpecifier> getImageTypes(int image)
getImageTypes
in class ImageReader
public int getHeight(int imageIndex)
getHeight
in class ImageReader
public int getWidth(int imageIndex)
getWidth
in class ImageReader
public int getNumImages(boolean whatever)
getNumImages
in class ImageReader
public static boolean canReadImage(ImageInputStream iis)
Copyright © 2020. All rights reserved.