Top Description Fields Constructors Methods
org.apache.pdfbox.tools.imageio

pack-priv final Class TIFFUtil

extends Object
Class Inheritance
Imports
org.apache.commons.logging.Log, .LogFactory, javax.imageio.ImageWriteParam, javax.imageio.metadata.IIOInvalidTreeException, .IIOMetadata, .IIOMetadataNode, java.awt.image.BufferedImage, org.w3c.dom.NodeList

Used by ImageIOUtil to write TIFF files.
Author
Tilman Hausherr

Field Summary

Modifier and TypeField and Description
private static final Log

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private static IIOMetadataNode
createAsciiField(int number, String name, String val)

private static IIOMetadataNode
createLongField(int number, String name, long val)

private static IIOMetadataNode
createRationalField(int number, String name, int numerator, int denominator)

private static IIOMetadataNode
createShortField(int tiffTagNumber, String name, int val)

public static void
setCompressionType(ImageWriteParam
ImageIO write parameter to update
param
,
BufferedImage
buffered image used to decide compression type
image
)

Sets the ImageIO parameter compression type based on the given image.

pack-priv static void
updateMetadata(IIOMetadata
ImageIO metadata
metadata
,
BufferedImage
buffered image which will be written
image
,
int
image dots per inch
dpi
)

Updates the given ImageIO metadata with Sun's custom TIFF tags, as described in the org.apache.xmlgraphics.image.writer.imageio.ImageIOTIFFImageWriter sources, the com.sun.media.imageio.plugins.tiff package javadoc and the TIFF specification.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

LOGback to summary
private static final Log LOG

Constructor Detail

TIFFUtilback to summary
private TIFFUtil()

Method Detail

createAsciiFieldback to summary
private static IIOMetadataNode createAsciiField(int number, String name, String val)
createLongFieldback to summary
private static IIOMetadataNode createLongField(int number, String name, long val)
createRationalFieldback to summary
private static IIOMetadataNode createRationalField(int number, String name, int numerator, int denominator)
createShortFieldback to summary
private static IIOMetadataNode createShortField(int tiffTagNumber, String name, int val)
setCompressionTypeback to summary
public static void setCompressionType(ImageWriteParam param, BufferedImage image)

Sets the ImageIO parameter compression type based on the given image.

Parameters
param:ImageWriteParam

ImageIO write parameter to update

image:BufferedImage

buffered image used to decide compression type

updateMetadataback to summary
pack-priv static void updateMetadata(IIOMetadata metadata, BufferedImage image, int dpi) throws IIOInvalidTreeException

Updates the given ImageIO metadata with Sun's custom TIFF tags, as described in the org.apache.xmlgraphics.image.writer.imageio.ImageIOTIFFImageWriter sources, the com.sun.media.imageio.plugins.tiff package javadoc and the TIFF specification.

Parameters
metadata:IIOMetadata

ImageIO metadata

image:BufferedImage

buffered image which will be written

dpi:int

image dots per inch

Exceptions
IIOInvalidTreeException:
if something goes wrong