public class TIFFImageWriter extends ImageWriter
Modifier and Type | Field and Description |
---|---|
(package private) int |
bitDepth |
(package private) char[] |
bitsPerSample |
(package private) ByteOrder |
byteOrder |
(package private) TIFFColorConverter |
colorConverter |
(package private) int |
compression |
static int[] |
compressionNumbers
Compression tag values for known compression types.
|
static String[] |
compressionTypes
Known TIFF compression types.
|
(package private) TIFFCompressor |
compressor |
private static boolean |
DEBUG |
static int |
DEFAULT_BYTES_PER_STRIP |
(package private) static String |
EXIF_JPEG_COMPRESSION_TYPE |
(package private) long |
headerPosition |
(package private) RenderedImage |
image |
(package private) TIFFImageMetadata |
imageMetadata |
(package private) ImageTypeSpecifier |
imageType |
private boolean |
inReplacePixelsNest |
(package private) boolean |
isBilevel |
static boolean[] |
isCompressionLossless
Lossless flag for known compression types.
|
(package private) boolean |
isImageSimple |
private boolean |
isInsertingEmpty |
(package private) boolean |
isInverted |
(package private) boolean |
isRescaling |
(package private) boolean |
isTiled |
private boolean |
isWritingEmpty |
(package private) boolean |
isWritingSequence |
(package private) int |
nativePhotometricInterpretation |
(package private) long |
nextIFDPointerPos |
(package private) long |
nextSpace |
(package private) int |
numBands |
(package private) ImageWriteParam |
param |
(package private) int |
periodX |
(package private) int |
periodY |
(package private) int |
photometricInterpretation |
(package private) int |
pixelsDone |
(package private) int |
predictor |
private TIFFImageReader |
reader |
private long[] |
replacePixelsByteCounts |
private long |
replacePixelsByteCountsPosition |
private int |
replacePixelsIndex |
private Object |
replacePixelsLock |
private TIFFImageMetadata |
replacePixelsMetadata |
private long |
replacePixelsOffsetsPosition |
private Rectangle |
replacePixelsRegion |
private long[] |
replacePixelsTileOffsets |
(package private) int |
sampleFormat |
(package private) int[] |
sampleSize |
(package private) byte[][] |
scale |
(package private) byte[] |
scale0 |
(package private) byte[][] |
scaleh |
(package private) byte[][] |
scalel |
(package private) int |
scalingBitDepth |
(package private) int[] |
sourceBands |
(package private) int |
sourceHeight |
(package private) int |
sourceWidth |
(package private) int |
sourceXOffset |
(package private) int |
sourceYOffset |
(package private) ImageOutputStream |
stream |
(package private) TIFFStreamMetadata |
streamMetadata |
static String[] |
TIFFCompressionTypes
Supported TIFF compression types.
|
(package private) int |
tileLength |
(package private) int |
tilesAcross |
(package private) int |
tilesDown |
(package private) int |
tileWidth |
(package private) int |
totalPixels |
availableLocales, locale, originatingProvider, output, progressListeners, warningListeners, warningLocales
Constructor and Description |
---|
TIFFImageWriter(ImageWriterSpi originatingProvider) |
Modifier and Type | Method and Description |
---|---|
boolean |
canInsertEmpty(int imageIndex) |
boolean |
canInsertImage(int imageIndex) |
boolean |
canReplacePixels(int imageIndex) |
boolean |
canWriteEmpty() |
boolean |
canWriteSequence() |
private void |
checkParamsEmpty(ImageTypeSpecifier imageType,
int width,
int height,
List thumbnails) |
IIOMetadata |
convertImageMetadata(IIOMetadata inData,
ImageTypeSpecifier imageType,
ImageWriteParam param) |
private TIFFImageMetadata |
convertNativeImageMetadata(IIOMetadata inData)
Converts a native
com_sun_media_imageio_plugins_tiff_image_1.0 tree to a
TIFFImageMetadata object. |
private TIFFImageMetadata |
convertStandardImageMetadata(IIOMetadata inData)
Converts a standard
javax_imageio_1.0 tree to a
TIFFImageMetadata object. |
IIOMetadata |
convertStreamMetadata(IIOMetadata inData,
ImageWriteParam param) |
void |
dispose() |
void |
endInsertEmpty() |
void |
endReplacePixels() |
void |
endWriteEmpty() |
void |
endWriteSequence() |
private boolean |
equals(int[] s0,
int[] s1) |
IIOMetadata |
getDefaultImageMetadata(ImageTypeSpecifier imageType,
ImageWriteParam param) |
IIOMetadata |
getDefaultStreamMetadata(ImageWriteParam param) |
ImageWriteParam |
getDefaultWriteParam() |
private void |
initializeScaleTables(int[] sampleSize) |
private void |
insert(int imageIndex,
IIOImage image,
ImageWriteParam param,
boolean writeData) |
private boolean |
isEncodingEmpty() |
private void |
locateIFD(int imageIndex,
long[] ifdpos,
long[] ifd) |
void |
prepareInsertEmpty(int imageIndex,
ImageTypeSpecifier imageType,
int width,
int height,
IIOMetadata imageMetadata,
List thumbnails,
ImageWriteParam param) |
void |
prepareReplacePixels(int imageIndex,
Rectangle region) |
void |
prepareWriteEmpty(IIOMetadata streamMetadata,
ImageTypeSpecifier imageType,
int width,
int height,
IIOMetadata imageMetadata,
List thumbnails,
ImageWriteParam param) |
void |
prepareWriteSequence(IIOMetadata streamMetadata) |
private TIFFIFD |
readIFD(int imageIndex) |
void |
replacePixels(Raster raster,
ImageWriteParam param) |
void |
replacePixels(RenderedImage image,
ImageWriteParam param) |
void |
reset() |
void |
setOutput(Object output) |
(package private) void |
setupMetadata(ColorModel cm,
SampleModel sm,
int destWidth,
int destHeight)
Sets up the output metadata adding, removing, and overriding fields
as needed.
|
private Raster |
subsample(Raster raster,
int[] sourceBands,
int subOriginX,
int subOriginY,
int subPeriodX,
int subPeriodY,
int dstOffsetX,
int dstOffsetY,
Rectangle target) |
void |
write(IIOMetadata sm,
IIOImage iioimage,
ImageWriteParam p) |
private void |
write(IIOMetadata sm,
IIOImage iioimage,
ImageWriteParam p,
boolean writeHeader,
boolean writeData) |
private void |
writeHeader() |
void |
writeInsert(int imageIndex,
IIOImage image,
ImageWriteParam param) |
private int |
writeTile(Rectangle tileRect,
TIFFCompressor compressor) |
void |
writeToSequence(IIOImage image,
ImageWriteParam param) |
static int |
XToTileX(int x,
int tileGridXOffset,
int tileWidth)
Converts a pixel's X coordinate into a horizontal tile index
relative to a given tile grid layout specified by its X offset
and tile width.
|
static int |
YToTileY(int y,
int tileGridYOffset,
int tileHeight)
Converts a pixel's Y coordinate into a vertical tile index
relative to a given tile grid layout specified by its Y offset
and tile height.
|
abort, abortRequested, addIIOWriteProgressListener, addIIOWriteWarningListener, canRemoveImage, canReplaceImageMetadata, canReplaceStreamMetadata, canWriteRasters, clearAbortRequest, getAvailableLocales, getLocale, getNumThumbnailsSupported, getOriginatingProvider, getOutput, getPreferredThumbnailSizes, processImageComplete, processImageProgress, processImageStarted, processThumbnailComplete, processThumbnailProgress, processThumbnailStarted, processWarningOccurred, processWarningOccurred, processWriteAborted, removeAllIIOWriteProgressListeners, removeAllIIOWriteWarningListeners, removeIIOWriteProgressListener, removeIIOWriteWarningListener, removeImage, replaceImageMetadata, replaceStreamMetadata, setLocale, write, write
private static final boolean DEBUG
static final String EXIF_JPEG_COMPRESSION_TYPE
public static final int DEFAULT_BYTES_PER_STRIP
public static final String[] TIFFCompressionTypes
public static final String[] compressionTypes
public static final boolean[] isCompressionLossless
public static final int[] compressionNumbers
ImageOutputStream stream
long headerPosition
RenderedImage image
ImageTypeSpecifier imageType
ByteOrder byteOrder
ImageWriteParam param
TIFFCompressor compressor
TIFFColorConverter colorConverter
TIFFStreamMetadata streamMetadata
TIFFImageMetadata imageMetadata
int sourceXOffset
int sourceYOffset
int sourceWidth
int sourceHeight
int[] sourceBands
int periodX
int periodY
int bitDepth
int numBands
int tileWidth
int tileLength
int tilesAcross
int tilesDown
int[] sampleSize
int scalingBitDepth
boolean isRescaling
boolean isBilevel
boolean isImageSimple
boolean isInverted
boolean isTiled
int nativePhotometricInterpretation
int photometricInterpretation
char[] bitsPerSample
int sampleFormat
byte[][] scale
byte[] scale0
byte[][] scaleh
byte[][] scalel
int compression
int predictor
int totalPixels
int pixelsDone
long nextIFDPointerPos
long nextSpace
boolean isWritingSequence
private boolean isInsertingEmpty
private boolean isWritingEmpty
private Object replacePixelsLock
private int replacePixelsIndex
private TIFFImageMetadata replacePixelsMetadata
private long[] replacePixelsTileOffsets
private long[] replacePixelsByteCounts
private long replacePixelsOffsetsPosition
private long replacePixelsByteCountsPosition
private Rectangle replacePixelsRegion
private boolean inReplacePixelsNest
private TIFFImageReader reader
public TIFFImageWriter(ImageWriterSpi originatingProvider)
public static int XToTileX(int x, int tileGridXOffset, int tileWidth)
If tileWidth < 0
, the results of this method
are undefined. If tileWidth == 0
, an
ArithmeticException
will be thrown.
ArithmeticException
- If tileWidth == 0
.public static int YToTileY(int y, int tileGridYOffset, int tileHeight)
If tileHeight < 0
, the results of this method
are undefined. If tileHeight == 0
, an
ArithmeticException
will be thrown.
ArithmeticException
- If tileHeight == 0
.public ImageWriteParam getDefaultWriteParam()
getDefaultWriteParam
in class ImageWriter
public void setOutput(Object output)
setOutput
in class ImageWriter
public IIOMetadata getDefaultStreamMetadata(ImageWriteParam param)
getDefaultStreamMetadata
in class ImageWriter
public IIOMetadata getDefaultImageMetadata(ImageTypeSpecifier imageType, ImageWriteParam param)
getDefaultImageMetadata
in class ImageWriter
public IIOMetadata convertStreamMetadata(IIOMetadata inData, ImageWriteParam param)
convertStreamMetadata
in interface ImageTranscoder
convertStreamMetadata
in class ImageWriter
public IIOMetadata convertImageMetadata(IIOMetadata inData, ImageTypeSpecifier imageType, ImageWriteParam param)
convertImageMetadata
in interface ImageTranscoder
convertImageMetadata
in class ImageWriter
private TIFFImageMetadata convertStandardImageMetadata(IIOMetadata inData) throws IIOInvalidTreeException
javax_imageio_1.0
tree to a
TIFFImageMetadata
object.inData
- The metadata object.TIFFImageMetadata
or null
if
the standard tree derived from the input object is null
.IllegalArgumentException
- if inData
is
null
or does not support the standard metadata format.IIOInvalidTreeException
- if inData
generates an
invalid standard metadata tree.private TIFFImageMetadata convertNativeImageMetadata(IIOMetadata inData) throws IIOInvalidTreeException
com_sun_media_imageio_plugins_tiff_image_1.0
tree to a
TIFFImageMetadata
object.inData
- The metadata object.TIFFImageMetadata
or null
if
the native tree derived from the input object is null
.IllegalArgumentException
- if inData
is
null
or does not support the native metadata format.IIOInvalidTreeException
- if inData
generates an
invalid native metadata tree.void setupMetadata(ColorModel cm, SampleModel sm, int destWidth, int destHeight) throws IIOException
cm
- The ColorModel
of the image being written.sm
- The SampleModel
of the image being written.destWidth
- The width of the written image after subsampling.destHeight
- The height of the written image after subsampling.IIOException
private int writeTile(Rectangle tileRect, TIFFCompressor compressor) throws IOException
tileRect
- The area to be written which might be outside the image.IOException
private boolean equals(int[] s0, int[] s1)
private void initializeScaleTables(int[] sampleSize)
public void write(IIOMetadata sm, IIOImage iioimage, ImageWriteParam p) throws IOException
write
in class ImageWriter
IOException
private void writeHeader() throws IOException
IOException
private void write(IIOMetadata sm, IIOImage iioimage, ImageWriteParam p, boolean writeHeader, boolean writeData) throws IOException
IOException
public boolean canWriteSequence()
canWriteSequence
in class ImageWriter
public void prepareWriteSequence(IIOMetadata streamMetadata) throws IOException
prepareWriteSequence
in class ImageWriter
IOException
public void writeToSequence(IIOImage image, ImageWriteParam param) throws IOException
writeToSequence
in class ImageWriter
IOException
public void endWriteSequence() throws IOException
endWriteSequence
in class ImageWriter
IOException
public boolean canInsertImage(int imageIndex) throws IOException
canInsertImage
in class ImageWriter
IOException
private void locateIFD(int imageIndex, long[] ifdpos, long[] ifd) throws IOException
IOException
public void writeInsert(int imageIndex, IIOImage image, ImageWriteParam param) throws IOException
writeInsert
in class ImageWriter
IOException
private void insert(int imageIndex, IIOImage image, ImageWriteParam param, boolean writeData) throws IOException
IOException
private boolean isEncodingEmpty()
public boolean canInsertEmpty(int imageIndex) throws IOException
canInsertEmpty
in class ImageWriter
IOException
public boolean canWriteEmpty() throws IOException
canWriteEmpty
in class ImageWriter
IOException
private void checkParamsEmpty(ImageTypeSpecifier imageType, int width, int height, List thumbnails)
public void prepareInsertEmpty(int imageIndex, ImageTypeSpecifier imageType, int width, int height, IIOMetadata imageMetadata, List thumbnails, ImageWriteParam param) throws IOException
prepareInsertEmpty
in class ImageWriter
IOException
public void prepareWriteEmpty(IIOMetadata streamMetadata, ImageTypeSpecifier imageType, int width, int height, IIOMetadata imageMetadata, List thumbnails, ImageWriteParam param) throws IOException
prepareWriteEmpty
in class ImageWriter
IOException
public void endInsertEmpty() throws IOException
endInsertEmpty
in class ImageWriter
IOException
public void endWriteEmpty() throws IOException
endWriteEmpty
in class ImageWriter
IOException
private TIFFIFD readIFD(int imageIndex) throws IOException
IOException
public boolean canReplacePixels(int imageIndex) throws IOException
canReplacePixels
in class ImageWriter
IOException
public void prepareReplacePixels(int imageIndex, Rectangle region) throws IOException
prepareReplacePixels
in class ImageWriter
IOException
private Raster subsample(Raster raster, int[] sourceBands, int subOriginX, int subOriginY, int subPeriodX, int subPeriodY, int dstOffsetX, int dstOffsetY, Rectangle target)
public void replacePixels(RenderedImage image, ImageWriteParam param) throws IOException
replacePixels
in class ImageWriter
IOException
public void replacePixels(Raster raster, ImageWriteParam param) throws IOException
replacePixels
in class ImageWriter
IOException
public void endReplacePixels() throws IOException
endReplacePixels
in class ImageWriter
IOException
public void reset()
reset
in class ImageWriter
public void dispose()
dispose
in class ImageWriter
Copyright © 2017 Open Microscopy Environment