Class AbstractTiffImageWriter
- java.lang.Object
-
- org.apache.commons.imaging.formats.tiff.write.AbstractTiffImageWriter
-
- Direct Known Subclasses:
TiffImageWriterLossless,TiffImageWriterLossy
public abstract class AbstractTiffImageWriter extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description protected java.nio.ByteOrderbyteOrderprivate static intMAX_PIXELS_FOR_RGB
-
Constructor Summary
Constructors Constructor Description AbstractTiffImageWriter()AbstractTiffImageWriter(java.nio.ByteOrder byteOrder)
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private voidapplyPredictor(int width, int bytesPerSample, byte[] b)private booleancheckForActualAlpha(java.awt.image.BufferedImage src)Check an image to see if any of its pixels are non-opaque.private voidcombineUserExifIntoFinalExif(TiffOutputSet userExif, TiffOutputSet outputSet)private byte[][]getStrips(java.awt.image.BufferedImage src, int samplesPerPixel, int bitsPerSample, int rowsPerStrip)protected static intimageDataPaddingLength(int dataLength)protected TiffOutputSummaryvalidateDirectories(TiffOutputSet outputSet)abstract voidwrite(java.io.OutputStream os, TiffOutputSet outputSet)voidwriteImage(java.awt.image.BufferedImage src, java.io.OutputStream os, TiffImagingParameters params)protected voidwriteImageFileHeader(AbstractBinaryOutputStream bos)protected voidwriteImageFileHeader(AbstractBinaryOutputStream bos, long offsetToFirstIFD)
-
-
-
Field Detail
-
MAX_PIXELS_FOR_RGB
private static final int MAX_PIXELS_FOR_RGB
- See Also:
- Constant Field Values
-
byteOrder
protected final java.nio.ByteOrder byteOrder
-
-
Method Detail
-
imageDataPaddingLength
protected static int imageDataPaddingLength(int dataLength)
-
applyPredictor
private void applyPredictor(int width, int bytesPerSample, byte[] b)
-
checkForActualAlpha
private boolean checkForActualAlpha(java.awt.image.BufferedImage src)
Check an image to see if any of its pixels are non-opaque.- Parameters:
src- a valid image- Returns:
- true if at least one non-opaque pixel is found.
-
combineUserExifIntoFinalExif
private void combineUserExifIntoFinalExif(TiffOutputSet userExif, TiffOutputSet outputSet) throws ImagingException
- Throws:
ImagingException
-
getStrips
private byte[][] getStrips(java.awt.image.BufferedImage src, int samplesPerPixel, int bitsPerSample, int rowsPerStrip)
-
validateDirectories
protected TiffOutputSummary validateDirectories(TiffOutputSet outputSet) throws ImagingException
- Throws:
ImagingException
-
write
public abstract void write(java.io.OutputStream os, TiffOutputSet outputSet) throws java.io.IOException, ImagingException- Throws:
java.io.IOExceptionImagingException
-
writeImage
public void writeImage(java.awt.image.BufferedImage src, java.io.OutputStream os, TiffImagingParameters params) throws ImagingException, java.io.IOException- Throws:
ImagingExceptionjava.io.IOException
-
writeImageFileHeader
protected void writeImageFileHeader(AbstractBinaryOutputStream bos) throws java.io.IOException
- Throws:
java.io.IOException
-
writeImageFileHeader
protected void writeImageFileHeader(AbstractBinaryOutputStream bos, long offsetToFirstIFD) throws java.io.IOException
- Throws:
java.io.IOException
-
-