diff --git a/src/main/java/mil/nga/tiff/FieldTagType.java b/src/main/java/mil/nga/tiff/FieldTagType.java index d0b9391..32ed287 100644 --- a/src/main/java/mil/nga/tiff/FieldTagType.java +++ b/src/main/java/mil/nga/tiff/FieldTagType.java @@ -4,247 +4,1767 @@ import java.util.Map; /** - * Field Tag Types - * + * Field Tag Types. + * * @author osbornb */ public enum FieldTagType { + /** + * Artist. + * + *
Person who created the image. + * + *
Some older TIFF files used this tag for storing Copyright information. + * + *
Source: TIFF 6 specification. + */ Artist(315, false), + /** + * Bits per sample. + * + *
Number of bits per component. This is an array field, where + * the number of elements is equal to the number of samples per pixel. + * The number of bits may be different in each component. + * + *
Source: TIFF 6 specification. + */ BitsPerSample(258, true), + /** + * Cell Length. + * + *
The length of the dithering or halftoning matrix used to create a + * dithered or halftoned bilevel file. This field should only be present + * if Threshholding = 2. + * + *
Source: TIFF 6 specification. + */ CellLength(265, false), + /** + * Cell Width. + * + *
The width of the dithering or halftoning matrix used to create a + * dithered or halftoned bilevel file. This field should only be present + * if Threshholding = 2. + * + *
Source: TIFF 6 specification. + */ CellWidth(264, false), - ColorMap(320, false), - - Compression(259, false), - + /** + * Palette colour map (ColorMap). + * + *
A colour map for palette color images. + * + *
This field defines a Red-Green-Blue color map (often called a + * lookup table) for palette-color images. In a palette-color image, a + * pixel value is used to index into an RGB lookup table. For example, + * a palette-color pixel having a value of 0 would be displayed + * according to the 0th Red, Green, Blue triplet. + * + *
In a TIFF ColorMap, all the Red values come first, followed by the + * Green values, then the Blue values. The number of values for each + * color is 2**BitsPerSample. Therefore, the ColorMap field for an + * 8-bit palette-color image would have 3 * 256 values. That is, this + * is an array field. + * + *
The width of each value is 16 bits, as implied by the type of + * SHORT. 0 represents the minimum intensity, and 65535 represents the + * maximum intensity. Black is represented by 0,0,0, and white by + * 65535, 65535, 65535. + * + *
As of Adobe PageMaker 6.0 TIFF Technical Notes (1995), ColorMap + * can contain the color map for any color space. The number of + * components in the ColorMap depends on the color space: for RGB and + * CIELab images there are 3 components, for CMYK there are 4 + * components, etc. + * + *
No default. ColorMap must be included in all palette-color images. + * + *
Source: TIFF 6 specification and Adobe PageMaker 6.0 TIFF + * Technical Notes (1995). + * + * @see PhotometricInterpretation + */ + ColorMap(320, true), + + /** + * Compression. + * + *
Compression scheme used on the image data. + * + *
Source: TIFF 6 specification. + */ + Compression(259, false), + + /** + * Copyright. + * + *
Copyright notice. + * + *
Copyright notice of the person or organization that claims the + * copyright to the image. The complete copyright statement should be + * listed in this field including any dates and statements of claims. + * For example, “Copyright, John Smith, 19xx. All rights reserved.” + * + *
Source: TIFF 6 specification. + */ Copyright(33432, false), + /** + * Date Time. + * + *
Date and time of image creation. + * + *
The format is: {@code YYYY:MM:DD HH:MM:SS}, with hours like those + * on a 24-hour clock, and one space character between the date and the + * time. The length of the string, including the terminating NUL, is + * 20 bytes. + * + *
Source: TIFF 6 specification. + */ DateTime(306, false), + /** + * Extra Samples. + * + *
Description of extra components. + * + *
Specifies that each pixel has m extra components whose + * interpretation is defined by one of the values listed below. When + * this field is used, the {@link SamplesPerPixel} field has a value + * greater than the {@link PhotometricInterpretation} field suggests. + * + *
{@code ExtraSamples} is typically used to include non-colour + * information, such as opacity, in an image. The possible values for + * each item in the field's value are: + * + *
Source: TIFF 6 specification. + */ ExtraSamples(338, true), + /** + * Fill Order. + * + *
The logical order of bits within a byte. + * + *
1 = pixels are arranged within a byte such that pixels with lower + * column values are stored in the higher-order bits of the byte. + * + *
2 = pixels are arranged within a byte such that pixels with lower + * column values are stored in the lower-order bits of the byte. + * + *
Source: TIFF 6 specification. + */ FillOrder(266, false), + /** + * Free byte counts. + * + *
For each string of contiguous unused bytes in a TIFF file, the + * number of bytes in the string. + * + *
Not recommended for general interchange. + * + *
Source: TIFF 6 specification. + * + * @see FreeOffsets + */ FreeByteCounts(289, false), + /** + * Free Offsets. + * + *
For each string of contiguous unused bytes in a TIFF file, the + * byte offset of the string. + * + *
Not recommended for general interchange. + * + *
Source: TIFF 6 specification. + * + * @see FreeByteCounts + */ FreeOffsets(288, false), + /** + * Gray Response Curve. + * + *
For grayscale data, the optical density of each possible pixel value. + * + *
Source: TIFF 6 specification. + * + * @see GrayResponseUnit + * @see PhotometricInterpretation + */ GrayResponseCurve(291, false), + /** + * Gray Response Unit. + * + *
The precision of the information contained in the + * {@link GrayResponseCurve}. + * + *
Because optical density is specified in terms of fractional + * numbers, this field is necessary to interpret the stored integer + * information. For example, if {@code GrayScaleResponseUnits} is set + * to 4 (ten-thousandths of a unit), and a {@link GrayResponseCurve} + * number for gray level 4 is 3455, then the resulting actual value is + * 0.3455. + * + *
Optical densitometers typically measure densities within the + * range of 0.0 to 2.0. + * + *
Source: TIFF 6 specification. + * + * @see GrayResponseCurve + */ GrayResponseUnit(290, false), + /** + * Host Computer. + * + *
The computer and/or operating system in use at the time of image + * creation. + * + *
Source: TIFF 6 specification. + * + * @see Make + * @see Model + * @see Software + */ HostComputer(316, false), + /** + * Image Description. + * + *
A string that describes the subject of the image. + * + *
For example, a user may wish to attach a comment such as + * “1988 company picnic” to an image. + * + *
Source: TIFF 6 specification. + */ ImageDescription(270, false), - ImageLength(257, false), - - ImageWidth(256, false), - + /** + * Image Width. + * + *
The number of columns in the image, i.e. the number of pixels per row. + * + *
Source: TIFF 6 specification. + */ + ImageWidth(256, false), + + /** + * Image Length. + * + *
The number of rows of pixels in the image. + * + *
Source: TIFF 6 specification. + */ + ImageLength(257, false), + + /** + * Make. + * + *
The scanner manufacturer. + * + *
Manufacturer of the scanner, video digitizer, or other type of + * equipment used to generate the image. Synthetic images should not + * include this field. + * + *
Source: TIFF 6 specification. + * + * @see Model + * @see Software + */ Make(271, false), - MaxSampleValue(281, false), - + /** + * Maximum Sample Value. + * + *
The maximum component value used. + * + *
This field is not to be used to affect the visual appearance of + * an image when it is displayed or printed. Nor should this field + * affect the interpretation of any other field; it is used only for + * statistical purposes. + * + *
This is an array field, where the number of elements is equal to + * the number of samples per pixel (i.e. number of components). + * + *
Default is 2**(BitsPerSample) - 1. + * + *
Source: TIFF 6 specification. + * + * @see MinSampleValue + */ + MaxSampleValue(281, true), + + /** + * Minimum Sample Value. + * + *
The minimum component value used. + * + *
This field is not to be used to affect the visual appearance of + * an image when it is displayed or printed. Nor should this field + * affect the interpretation of any other field; it is used only for + * statistical purposes. + * + *
This is an array field, where the number of elements is equal to + * the number of samples per pixel (i.e. number of components). + * + *
Default is 0. + * + *
Source: TIFF 6 specification. + * + * @see MaxSampleValue + */ MinSampleValue(280, false), + /** + * Model. + * + *
The scanner model name or number. + * + *
The model name or number of the scanner, video digitizer, or + * other type of equipment used to generate the image. + * + *
Source: TIFF 6 specification. + * + * @see Make + * @see Software + */ Model(272, false), + /** + * New Subfile Type. + * + *
A general indication of the kind of data contained in this + * subfile. + * + *
Replaces the old {@link SubfileType} field, due to limitations in + * the definition of that field. {@code NewSubfileType} is mainly useful + * when there are multiple subfiles in a single TIFF file. + * + *
This field is made up of a set of 32 flag bits. See TIFF 6 + * specification for the interpretation. + * + *
Source: TIFF 6 specification. + */ NewSubfileType(254, false), + /** + * Orientation. + * + *
The orientation of the image with respect to the rows and columns. + * + *
Default is 1. + * + *
Source: TIFF 6 specification. + */ Orientation(274, false), + /** + * Photometric Interpretation. + * + *
The color space of the image data. + * + *
Source: TIFF 6 specification and TIFF Technical Notes (2002). + */ PhotometricInterpretation(262, false), + /** + * Planar Configuration. + * + *
How the components of each pixel are stored. + * + *
1 = Chunky format. The component values for each pixel are stored + * contiguously. The order of the components within the pixel is + * specified by {@link PhotometricInterpretation}. For example, for RGB + * data, the data is stored as {@code RGBRGBRGB...} + * + *
2 = Planar format. The components are stored in separate + * "component planes". + * + *
If {@link SamplesPerPixel} is 1, {@code PlanarConfiguration} is + * irrelevant, and need not be included. + * + *
Default is 1. + * + *
Source: TIFF 6 specification. + * + * @see BitsPerSample + * @see SamplesPerPixel + */ PlanarConfiguration(284, false), + /** + * Resolution Unit. + * + *
The unit of measurement for {@link XResolution} and + * {@link YResolution}. + * + *
1 = No absolute unit of measurement. Used for images that may have + * a non-square aspect ratio, but no meaningful absolute dimensions. + * + *
2 = Inch. (Default) + * + *
3 = Centimetre. + * + *
Source: TIFF 6 specification. + */ ResolutionUnit(296, false), + /** + * Rows Per Strip. + * + *
The number of rows in each strip (except possibly the last strip). + * + *
For example, if ImageLength is 24, and RowsPerStrip is 10, then + * there are 3 strips, with 10 rows in the first strip, 10 rows in the + * second strip, and 4 rows in the third strip. The data in the last + * strip is not padded with 6 extra rows of dummy data. + * + *
Source: TIFF 6 specification. + */ RowsPerStrip(278, false), + /** + * Samples Per Pixel. + * + *
The number of components per pixel. + * + *
{@code SamplesPerPixel} is usually 1 for bilevel, + * grayscale, and palette-colour images. + * + *
{@code SamplesPerPixel} is usually 3 for RGB images. + * + *
Default = 1. + * + *
Source: TIFF 6 specification. + * + * @see BitsPerSample + * @see PhotometricInterpretation + * @see ExtraSamples + */ SamplesPerPixel(277, false), + /** + * Software. + * + *
Name and version number of the software package(s) used to create + * the image. + * + *
Source: TIFF 6 specification. + * + * @see Make + * @see Model + */ Software(305, false), + /** + * Strip Byte Counts. + * + *
For each strip, the number of bytes in the strip after compression. + * + *
This tag is required for Baseline TIFF files. There is no default. + * + *
Source: TIFF 6 specification. + * + * @see StripOffsets + * @see RowsPerStrip + * @see TileOffsets + * @see TileByteCounts + */ StripByteCounts(279, true), + /** + * Strip Offsets. + * + *
For each strip, the byte offset of that strip. + * + *
The offset is specified with respect to the beginning of the TIFF + * file. Note that this implies that each strip has a location + * independent of the locations of other strips. This feature may be + * useful for editing applications. This required field is the only way + * for a reader to find the image data. (Unless TileOffsets is used; see + * TileOffsets.) + * + *
No default. + * + *
Source: TIFF 6 specification. + * + * @see StripByteCounts + * @see RowsPerStrip + * @see TileOffsets + * @see TileByteCounts + */ StripOffsets(273, true), + /** + * Subfile Type. + * + *
A general indication of the kind of data contained in this + * subfile. + * + *
Currently defined values are: + *
Note that several image types may be found in a single TIFF file, + * with each subfile described by its own IFD. + * + *
No default. + * + *
This field is deprecated. The {@link NewSubfileType} field should + * be used instead. + * + *
Source: TIFF 6 specification. + */ SubfileType(255, false), + /** + * Threshholding. + * + *
For black and white TIFF files that represent shades of gray, the + * technique used to convert from gray to black and white pixels. This + * is an enumeration value. + * + *
Source: TIFF 6 specification. + * + * @see CellLength + * @see CellWidth + */ Threshholding(263, false), + /** + * X Resolution. + * + *
The number of pixels per {@link ResolutionUnit} in the + * {@link ImageWidth} direction. + * + *
It is not mandatory that the image be actually displayed or + * printed at the size implied by this parameter. It is up to the + * application to use this information as it wishes. + * + *
No default. + * + *
Source: TIFF 6 specification. + * + * @see YResolution + * @see ResolutionUnit + */ XResolution(282, false), + /** + * Y Resolution. + * + *
The number of pixels per {@link ResolutionUnit} in the + * {@link ImageLength} direction. + * + *
No default. + * + *
Source: TIFF 6 specification. + * + * @see XResolution + * @see ResolutionUnit + */ YResolution(283, false), // TIFF Extended + /** + * Bad Fax Lines. + * + *
The number of "bad" scan lines encountered by the facsimile device + * during reception. A "bad" scanline is defined as a scanline that, + * when decoded, comprises an incorrect number of pixels. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ BadFaxLines(326, false), + /** + * Clean Fax Data(327). + * + *
Indicates if "bad" lines encountered during reception are stored + * in the data, or if "bad" lines have been replaced by the receiver. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ CleanFaxData(327, false), - ClipPath(343, false), - + /** + * ClipPath. + * + *
A TIFF ClipPath is intended to mirror the essentials of + * PostScript’s path creation functionality, so that the operators + * listed below can be easily translated into PostScript, and + * conversely, any PostScript path can be represented as a TIFF + * ClipPath. + * + *
Source: Adobe PageMaker 6.0 TIFF Technical Notes (1995) + */ + ClipPath(343, true), + + /** + * Consecutive Bad Fax Lines. + * + *
Maximum number of consecutive "bad" scanlines received. The + * {@link BadFaxLines} field indicates only the quantity of bad lines. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ ConsecutiveBadFaxLines(328, false), - Decode(433, false), - - DefaultImageColor(434, false), - + /** + * Decode. + * + *
Describes how to map image sample values into the range of values + * appropriate for the current color space. In general, the values are + * taken in pairs and specify the minimum and maximum output value for + * each color component. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ + Decode(433, true), + + /** + * Default Image Color. + * + *
In areas where no image data is available, a default color is + * needed to specify the color value. If the {@link StripByteCounts} value + * for a strip is 0, then the color for that strip must be defined by a + * default image color. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ + DefaultImageColor(434, true), + + /** + * Document Name. + * + *
The name of the document from which this image was scanned. + * + *
Source: TIFF 6 specification. + * + * @see PageName + */ DocumentName(269, false), - DotRange(336, false), - - HalftoneHints(321, false), - + /** + * Dot Range. + * + *
The component values that correspond to a 0% dot and 100% dot. + * {@code DotRange[0]} corresponds to a 0% dot, and {@code DotRange[1]} + * corresponds to a 100% dot. + * + *
Source: TIFF 6 specification. + */ + DotRange(336, true), + + /** + * Halftone Hints. + * + *
The purpose of the {@code HalftoneHints} field is to convey to + * the halftone function the range of gray levels within a + * colorimetrically-specified image that should retain tonal detail. + * The field contains two values of sixteen bits each and, therefore, is + * contained wholly within the field itself; no offset is required. + * The first word specifies the highlight gray level which should be + * halftoned at the lightest printable tint of the final output device. + * The second word specifies the shadow gray level which should be + * halftoned at the darkest printable tint of the final output device. + * Portions of the image which are whiter than the highlight gray level + * will quickly, if not immediately, fade to specular highlights. There + * is no default value specified, since the highlight and shadow gray + * levels are a function of the subject matter of a particular image. + * + *
Source: TIFF 6 specification. + */ + HalftoneHints(321, true), + + /** + * Indexed. + * + *
Indexed images are images where the “pixels” do not represent + * color values, but rather an index (usually 8-bit) into a separate + * color table, the {@link ColorMap}. ColorMap is required for an + * Indexed image. + * + *
The {@link PhotometricInterpretation} type of PaletteColor may + * still be used, and is equivalent to specifying an RGB image with the + * Indexed flag set, a suitable ColorMap, and SamplesPerPixel = 1. + * + *
Source: Adobe PageMaker 6.0 TIFF Technical Notes (1995) + */ Indexed(346, false), + /** + * JPEG Tables. + * + *
{@code JPEGTables} provides default JPEG quantization and/or + * Huffman tables which are used whenever a segment datastream does not + * contain its own tables. + * + *
This is associated with new JPEG (Compression = 7) encoding. + * + *
Source: TIFF Technical Note 2 (1995). + */ JPEGTables(347, false), + /** + * Page Name. + * + *
The name of the page from which this image was scanned. + * + *
Source: TIFF 6 specification. + * + * @see DocumentName + */ PageName(285, false), - PageNumber(297, false), - + /** + * Page Number. + * + *
The page number of the page from which this image was scanned. + * + *
This field is used to specify page numbers of a multiple page + * (e.g. facsimile) document. There are always two values. + * {@code PageNumber[0]} is the page number; {@code PageNumber[1]} is + * the total number of pages in the document. If + * {@code PageNumber[1]} is 0, the total number of pages in the document + * is not available. + * + *
Pages need not appear in numerical order. + * + *
The first page is numbered 0 (zero). + * + *
Source: TIFF 6 specification. + */ + PageNumber(297, true), + + /** + * Predictor. + * + *
A predictor is a mathematical operator that is applied to the + * image data before an encoding scheme is applied. + * + * The possible values are: + *
Source: TIFF 6 specification and TIFF Technical Note 3. + */ Predictor(317, false), - PrimaryChromaticities(319, false), - - ReferenceBlackWhite(532, false), - + /** + * Primary Chromaticities. + * + *
The chromaticities of the primaries of the image. This is the + * chromaticity for each of the primaries when it has its + * {@code ReferenceWhite} value and the other primaries have their + * {@code ReferenceBlack} values. These values are described using the + * 1931 CIE xy chromaticity diagram and only the chromaticities are + * specified. These values can correspond to the chromaticities of the + * phosphors of a monitor, the filter set and light source combination + * of a scanner or the imaging model of a rendering package. + * The ordering is {@code red[x], red[y], green[x], green[y], blue[x], + * blue[y]}. + * + *
For example the CCIR Recommendation 709 primaries are: + * + *
640/1000, 330/1000, + *
300/1000, 600/1000, + *
150/1000, 60/1000 + * + *
Source: TIFF 6 specification. + */ + PrimaryChromaticities(319, true), + + /** + * Reference Black White. + * + *
Specifies a pair of headroom and footroom image data values + * (codes) for each pixel component. The first component code within a + * pair is associated with ReferenceBlack, and the second is associated + * with ReferenceWhite. The ordering of pairs is the same as those for + * pixel components of the {@link PhotometricInterpretation} type. + * ReferenceBlackWhite can be applied to images with a + * {@link PhotometricInterpretation} value of {@code RGB} or + * {@code YCbCr}. {@code ReferenceBlackWhite} is not used with other + * {@link PhotometricInterpretation} values. + * + *
Source: TIFF 6 specification. + */ + ReferenceBlackWhite(532, true), + + /** + * Sample Format. + * + *
This field specifies how to interpret each data sample in a pixel. + * + * Possible values are: + *
Note that the {@code SampleFormat} field does not specify the + * size of data samples; this is still done by the + * {@link BitsPerSample} field. + * + *
Source: TIFF 6 specification. + */ SampleFormat(339, true), - SMinSampleValue(340, false), - - SMaxSampleValue(341, false), - + /** + * Minimum Sample Value. + * + *
This field specifies the minimum sample value. Note that a value + * should be given for each data sample - this is an array field. That + * is, if the image has 3 {@link SamplesPerPixel}, 3 values must be + * specified. + * + *
The default for {@code SMinSampleValue} and {@code SMaxSampleValue} + * is the full range of the data type. + * + *
Source: TIFF 6 specification. + */ + SMinSampleValue(340, true), + + /** + * Maximum Sample Value. + * + *
This field specifies the maximum sample value. Note that a value + * should be given for each data sample - this is an array field. That + * is, if the image has 3 {@link SamplesPerPixel}, 3 values must be + * specified. + * + *
The default for {@code SMinSampleValue} and {@code SMaxSampleValue} + * is the full range of the data type. + * + *
Source: TIFF 6 specification. + */ + SMaxSampleValue(341, true), + + /** + * Strip Row Counts. + * + *
The number of scanlines stored in a strip. MRC allows each fax + * strip to store a different number of scanlines. For strips with more + * than one layer there is a maximum strip size of 256 scanlines or full + * page size. The 256 maximum SHOULD be used unless the capability to + * receive longer strips has been negotiated. This field replaces + * {@link RowsPerStrip} for IFDs with variable-sized strips. + * + *
Source: RFC 2301 File Format for Internet Fax. + */ StripRowCounts(559, true), - SubIFDs(330, false), - + /** + * SubIFDs. + * + *
Each value is an offset (from the beginning of the TIFF file, as + * always) to a child IFD. Child images provide extra information for + * the parent image - such as a subsampled version of the parent image. + * + *
TIFF data type 13, {@code IFD} is otherwise identical to LONG, + * but is only used to point to other valid IFDs. + * + *
Source: Adobe PageMaker 6.0 TIFF Technical Notes (1995) + */ + SubIFDs(330, true), + + /** + * T4 Options. + * + *
This field is made up of a set of 32 flag bits and is used + * with {@link Compression} value of {@code 3}. See TIFF 6.0 + * specification. + * + *
Source: TIFF 6 specification. + */ T4Options(292, false), + /** + * T6 Options. + * + *
This field is made up of a set of 32 flag bits and is used + * with {@link Compression} value of {@code 4}. See TIFF 6.0 + * specification. + * + *
Source: TIFF 6 specification. + */ T6Options(293, false), + /** + * Tile Byte Counts. + * + *
For each tile, the number of (compressed) bytes in that tile. + * + *
See {@link TileOffsets} for a description of how the byte counts + * are ordered. + * + *
Source: TIFF 6 specification. + * + * @see TileWidth + * @see TileLength + * @see TileOffsets + */ TileByteCounts(325, true), + /** + * Tile Length. + * + *
The tile length (height) in pixels. This is the number of rows in + * each tile. {@code TileLength} must be a multiple of 16 for + * compatibility with compression schemes such as JPEG. + * + *
Replaces {@link RowsPerStrip} in tiled TIFF files. + * + *
Source: TIFF 6 specification. + * + * @see TileWidth + * @see TileOffsets + * @see TileByteCounts + */ TileLength(323, false), + /** + * Tile Offsets. + * + *
For each tile, the byte offset of that tile, as compressed and + * stored on disk. The offset is specified with respect to the + * beginning of the TIFF file. Note that this implies that each tile + * has a location independent of the locations of other tiles. + * + *
Offsets are ordered left-to-right and top-to-bottom. For + * {@link PlanarConfiguration} of {@code 2}, the offsets for the first + * component plane are stored first, followed by all the offsets for + * the second component plane, and so on. + * + *
Source: TIFF 6 specification. + * + * @see TileWidth + * @see TileLength + * @see TileByteCounts + */ TileOffsets(324, true), + /** + * Tile Width. + * + *
The tile width in pixels. This is the number of columns in each + * tile. + * + *
{@code TileWidth} and {@link ImageWidth} together determine the + * number of tiles that span the width of the image. + * + *
{@code TileWidth} must be a multiple of 16. This restriction + * improves performance in some graphics environments and enhances + * compatibility with compression schemes such as JPEG. + * + *
Tiles need not be square. + * + *
Source: TIFF 6 specification. + * + * @see TileLength + * @see TileOffsets + * @see TileByteCounts + */ TileWidth(322, false), - TransferFunction(301, false), - - WhitePoint(318, false), - + /** + * Transfer Function. + * + *
Describes a transfer function for the image in tabular style. + * Pixel components can be gamma-compensated, companded, non-uniformly + * quantized, or coded in some other way. The {@code TransferFunction} + * maps the pixel components from a non-linear {@link BitsPerSample} + * (e.g. 8-bit) form into a 16-bit linear form without a perceptible + * loss of accuracy. + * + *
See TIFF 6 Specification for calculations. + * + *
Source: TIFF 6 specification. + */ + TransferFunction(301, true), + + /** + * White Point. + * + *
The chromaticity of the white point of the image. This is the + * chromaticity when each of the primaries has its ReferenceWhite value. + * The value is described using the 1931 CIE xy chromaticity diagram + * and only the chromaticity is specified. This value can correspond to + * the chromaticity of the alignment white of a monitor, the filter set + * and light source combination of a scanner or the imaging model of a + * rendering package. There are always two values. The ordering is + * {@code white[x], white[y]}. + * + *
For example, the CIE Standard Illuminant D65 used by CCIR + * Recommendation 709 and Kodak PhotoYCC is {@code 3127/10000,3290/10000}. + * + *
Source: TIFF 6 specification. + */ + WhitePoint(318, true), + + /** + * X Clip Path Units. + * + *
The number of units that span the width of the image, in terms of + * integer {@link ClipPath} coordinates. + * + *
All horizontal ClipPath coordinates will be divided by this value + * in order to get a number that is (usually) between 0.0 and 1.0, where + * 0.0 represents the left side of the image and 1.0 represents the + * right side of the image. + * + *
Required for every TIFF ClipPath. + * + *
Source: Adobe PageMaker 6.0 TIFF Technical Notes (1995) + */ XClipPathUnits(344, false), + /** + * X Position. + * + *
X position of the image. + * + *
The X offset in {@link ResolutionUnit}s of the left side of the + * image, with respect to the left side of the page. + * + *
No default. + * + *
Source: TIFF 6 specification. + * + * @see YPosition + */ XPosition(286, false), - YCbCrCoefficients(529, false), - + /** + * YCbCr Coefficients. + * + *
The transformation from RGB to YCbCr image data. The + * transformation is specified as three rational values that represent + * the coefficients used to compute luminance, Y. + * + *
The three rational coefficient values are the proportions of red, + * green, and blue respectively in luminance, Y. See TIFF 6 + * specification for calculations. + * + *
Source: TIFF 6 specification. + */ + YCbCrCoefficients(529, true), + + /** + * YCbCr Positioning. + * + *
Specifies the positioning of subsampled chrominance components + * relative to luminance samples. See TIFF 6 Specification. + * + *
Source: TIFF 6 specification. + */ YCbCrPositioning(531, false), - YCbCrSubSampling(530, false), - + /** + * YCbCr SubSampling. + * + *
Specifies the subsampling factors used for the chrominance + * components of a YCbCr image. The two fields of this field, + * {@code YCbCrSubsampleHoriz} and {@code YCbCrSubsampleVert}, specify + * the horizontal and vertical subsampling factors respectively. + * + * The two fields of this field are defined as follows: + * + *
Short 0: YCbCr SubsampleHoriz: + *
Short 1: YCbCrSubsampleVert: + *
Both Cb and Cr have the same subsampling ratio. + * + *
Source: TIFF 6 specification. + */ + YCbCrSubSampling(530, true), + + /** + * Y Clip Path Units. + * + *
The number of units that span the height of the image, in terms + * of integer {@link ClipPath} coordinates. + * + *
All vertical ClipPath coordinates will be divided by this value + * in order to get a number that is (usually) between 0.0 and 1.0, + * where 0.0 represents the top of the image and 1.0 represents the + * bottom of the image. + * + *
Optional. Default is {@code YClipPathUnits} = + * {@link XClipPathUnits}. + * + *
Source: Adobe PageMaker 6.0 TIFF Technical Notes (1995) + */ YClipPathUnits(345, false), + /** + * Y Position. + * + *
Y position of the image. + * + *
The Y offset in {@link ResolutionUnit}s of the top of the image, + * with respect to the top of the page. In the TIFF coordinate scheme, + * the positive Y direction is down, so that {@code YPosition} is + * always positive. + * + *
No default. + * + *
Source: TIFF 6 specification. + * + * @see XPosition + */ YPosition(287, false), // JPEG + /** + * JPEG Process. + * + *
This Field indicates the JPEG process used to produce the compressed data. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGProc(512, false), + /** + * JPEG Interchange Format. + * + *
This Field indicates whether a JPEG interchange format bitstream + * is present in the TIFF file. If a JPEG interchange format bitstream + * is present, then this Field points to the Start of Image (SOI) marker + * code. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGInterchangeFormat(513, false), + /** + * JPEG Interchange Format Length. + * + *
This Field indicates the length in bytes of the JPEG interchange + * format bitstream. This Field is useful for extracting the JPEG + * interchange format bitstream without parsing the bitstream. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGInterchangeFormatLength(514, false), + /** + * JPEG Restart Interval. + * + *
This Field indicates the length of the restart interval used in + * the compressed image data. The restart interval is defined as the + * number of Minimum Coded Units (MCUs) between restart markers. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGRestartInterval(515, false), + /** + * JPEG Lossless Predictors. + * + *
This Field points to a list of lossless predictor-selection + * values, one per component. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGLosslessPredictors(517, true), + /** + * JPEG Point Transforms. + * + *
This Field points to a list of point transform values, one per + * component. This Field is relevant only for lossless processes. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGPointTransforms(518, true), + /** + * JPEG Quantization Tables. + * + *
This Field points to a list of offsets to the quantization tables, + * one per component. Each table consists of 64 BYTES (one for each DCT + * coefficient in the 8x8 block). The quantization tables are stored in + * zigzag order. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGQTables(519, true), + /** + * JPEG DC Tables. + * + *
This Field points to a list of offsets to the DC Huffman tables + * or the lossless Huffman tables, one per component. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGDCTables(520, true), + /** + * JPEG AC Tables. + * + *
This Field points to a list of offsets to the Huffman AC tables, + * one per component. + * + *
Source: TIFF 6 specification. + * + *
This is associated with "Old JPEG" process, which is discouraged as + * of TIFF Technical Note 2 (1995). + */ JPEGACTables(521, true), // EXIF + /** + * Aperture Value. + * + *
The lens aperture. The unit is the APEX (Additive System of + * Photographic Exposure) value. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ ApertureValue(37378, false), + /** + * Color Space. + * + *
The color space information tag (ColorSpace) is always recorded + * as the color space specifier. Normally sRGB (=1) is used to define + * the color space based on the PC monitor conditions and environment. + * If a color space other than sRGB is used, Uncalibrated (=FFFF.H) is + * set. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ ColorSpace(40961, false), + /** + * Date Time Digitized. + * + *
The date and time when the image was stored as digital data. If, + * for example, an image was captured by a digital still camera (DSC) + * and at the same time the file was recorded, then the + * {@link DateTimeOriginal} and {@code DateTimeDigitized} will have the + * same contents. + * + *
The format is "YYYY:MM:DD HH:MM:SS" with time shown in + * 24-hour format, and the date and time separated by one blank + * character [20.H]. When the date and time are unknown, all the + * character spaces except colons (":") should be filled with blank + * characters, or else the field should be filled with blank characters. + * The character string length is 20 Bytes including NULL for + * termination. When the field is left blank, it is treated as unknown. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ DateTimeDigitized(36868, false), - DateTimeOriginal(36867, false), - + /** + * Date Time Original. + * + *
The date and time when the original image data was generated. For + * a digital still camera (DSC) the date and time the picture was taken + * are recorded. + * + *
The format is "YYYY:MM:DD HH:MM:SS" with time shown in + * 24-hour format, and the date and time separated by one blank + * character [20.H]. When the date and time are unknown, all the + * character spaces except colons (":") should be filled with blank + * characters, or else the field should be filled with blank characters. + * The character string length is 20 Bytes including NULL for + * termination. When the field is left blank, it is treated as unknown. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ + DateTimeOriginal(36867, true), + + /** + * Exif IFD Pointer. + * + *
A pointer to the Exif IFD. The Exif IFD has the same structure as + * that of the IFD specified in TIFF. However, it does not contain + * image data as in the case of TIFF. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ ExifIFD(34665, false), - ExifVersion(36864, false), - + /** + * Exif Version. + * + *
The version of the Exif standard supported. Nonexistence of this + * field is taken to mean nonconformance to the standard. Conformance + * to version 2.32 would be indicated by "0232", while version 3.0 + * would be indicated by "0300” as 4-byte ASCII. Since the type is + * UNDEFINED, it shall not be terminated with NULL. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ + ExifVersion(36864, true), + + /** + * Exposure Time. + * + *
Exposure time, given in seconds (sec). + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ ExposureTime(33434, false), + /** + * File Source. + * + *
Indicates the image source. If a digital still camera recorded + * the image, this tag value always shall be set to 3. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0". + */ FileSource(41728, false), + /** + * Flash. + * + *
This tag indicates the status of flash when the image was shot. + * Bit 0 indicates the flash firing status, bits 1 and 2 indicate the + * flash return status, bits 3 and 4 indicate the flash mode, bit 5 + * indicates whether the flash function is present, and bit 6 indicates + * "red eye" mode. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ Flash(37385, false), + /** + * Flashpix Version. + * + *
The Flashpix format version supported by a FPXR file. If the FPXR + * function supports Flashpix format Ver. 1.0, this is indicated + * similarly to {@link ExifVersion} by recording "0100" as 4-byte ASCII. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + * + */ FlashpixVersion(40960, false), + /** + * F Number. + * + *
The F number (aka. focal ration, f-ratio or f-stop). + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ FNumber(33437, false), - ImageUniqueID(42016, false), - + /** + * Image Unique ID. + * + *
This tag indicates an identifier assigned uniquely to each image. + * It shall be recorded as an ASCII string in hexadecimal notation + * equivalent to 128-bit fixed length UUID compliant with + * ISO/IEC 9834-8. The UUID shall be UUID Version 1 or Version 4, and + * UUID Version 4 is recommended. This ID shall be assigned at the time + * of shooting the image, and the recorded ID shall not be updated or + * erased by any subsequent editing. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ + ImageUniqueID(42016, true), + + /** + * Light source. + * + *
The kind of light source. This is an enumerated value. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ LightSource(37384, false), - MakerNote(37500, false), - + /** + * Maker Note. + * + *
A tag for manufacturers of Exif/DCF writers to record any desired + * information. The contents are up to the manufacturer, but this tag + * shall not be used for any other than its intended purpose. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ + MakerNote(37500, true), + + /** + * Shutter Speed Value. + * + *
Shutter speed. The unit is the APEX (Additive System of + * Photographic Exposure) value. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ ShutterSpeedValue(37377, false), - UserComment(37510, false), - - // IPTC - + /** + * User Comment. + * + *
A tag for Exif users to freely write keywords or comments on the image + * besides those in ImageDescription, and without the character code + * limitations of the ImageDescription tag. + * + *
The first eight bytes indicate the character code. + * + *
Source: JEITA CP-3451F / CIPA DC-008-2023 "Exchangeable image + * file format for digital still cameras: Exif Version 3.0" + */ + UserComment(37510, true), + + // IPTC + + /** + * IPTC (International Press Telecommunications Council) metadata. + * + *
Source: TIFF Tag Reference site + */ IPTC(33723, false), // ICC + /** + * International Color Consortium (ICC) profile. + * + *
An ICC device profile is embedded, in its entirety, as a single + * TIFF field or Image File Directory (IFD) entry in the IFD containing + * the corresponding image data. An IFD should contain no more than one + * embedded profile. A TIFF file may contain more than one image, and + * so, more than one IFD. Each IFD may have its own embedded profile. + * Note, however, that Baseline TIFF readers are not required to read + * any IFDs beyond the first one. + * + *
Source:ICC Technical Note 10-2021 "Embedding ICC profiles" + */ ICCProfile(34675, false), // XMP + /** + * Extensible Metadata Platform (XMP). + * + *
XMP packet. + * + *
Source: XMP Specification Part 3 - Storage in Files (January 2020). + */ XMP(700, false), // GDAL + /** + * GDAL additional metadata. + * + *
GDAL will use standard TIFF tags where applicable. Other non + * standard metadata items can be stored in a TIFF file created with the + * default profile {@code GDALGeoTIFF}. Those metadata items are grouped + * together into a XML string stored in the non standard + * {@code TIFFTAG_GDAL_METADATA} ASCII tag (code 42112). + * + *
Source: GDAL GeoTIFF web page + */ GDAL_METADATA(42112, false), + /** + * GDAL no data value. + * + *
GDAL stores band {@code nodata} value in the non standard + * TIFFTAG_GDAL_NODATA ASCII tag (code 42113) for files created with the + * default profile {@code GDALGeoTIFF}. + * + *
Note that all bands must use the same nodata value. + * + *
Source: GDAL GeoTIFF web page + */ GDAL_NODATA(42113, false), // Photoshop + /** + * Photoshop. + * + *
Collection of Photoshop 'Image Resource Blocks'. + * + *
Source: TIFF Tag Reference site + * and XMP Specification Part 3 - Storage in Files (January 2020). + */ Photoshop(34377, false), // GeoTiff - ModelPixelScale(33550, false), - - ModelTiepoint(33922, false), - - ModelTransformation(34264, false), - - GeoKeyDirectory(34735, false), - - GeoDoubleParams(34736, false), - - GeoAsciiParams(34737, false); + /** + * Model Pixel Scale. + * + *
Provided for defining exact affine transformations between raster + * and model space. GeoTIFF files may use either {@code ModelPixelScale} + * or {@link ModelTransformation}, but shall never use both within the + * same TIFF image directory. + * + *
Specifies the size of raster pixel spacing in the model space + * units, when the raster space can be embedded in the model space + * coordinate reference system without rotation, and consists of the + * following 3 values: {@code (ScaleX, ScaleY, ScaleZ)} where + * {@code ScaleX} and {@code ScaleY} give the horizontal spacing of + * raster pixels in the 2 directions. The {@code ScaleZ} is primarily + * used to map the pixel value of a digital elevation model into the + * correct Z-scale (in other words a Z-Scaling factor) and so for most + * other purposes this value should be zero (since most model spaces + * are 2-D, with Z=0). + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard". + * + * @see ModelTiepoint + */ + ModelPixelScale(33550, true), + + /** + * Model Tie Points. + * + *
For most common applications, the transformation between raster + * and model space may be defined with a set of raster-to-model + * tiepoints and scaling parameters. + * + *
Tiepoints are specified 6 values for each tiepoint, and there + * can be an arbitrary number of tie points, stored as + * {@code (...,I,J,K, X,Y,Z...)}, where where {@code (I,J,K)} is the + * point at location {@code (I,J)} in raster space with pixel-value + * {@code K}, and {@code (X,Y,Z)} is a vector in model space. In most + * cases the model space is only two-dimensional, in which case both + * {@code K} and {@code Z} should be set to zero; this third dimension + * is provided in anticipation of support for 3D digital elevation + * models and vertical coordinate systems. + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard". + * + * @see ModelPixelScale + */ + ModelTiepoint(33922, true), + + /** + * Model Transformation. + * + *
This tag may be used to specify the 16 element transformation + * matrix between the raster space (and its dependent pixel-value space) + * and the (possibly 3D) model space. + * + *
This matrix tag should not be used if the {@link ModelTiepoint} + * and the {@link ModelPixelScale} are used. + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard". + */ + ModelTransformation(34264, true), + + /** + * GeoKey Directory. + * + *
The tag is an array of unsigned SHORT values, which are primarily + * grouped into blocks of 4. The first 4 values are special, and contain + * GeoKey directory header information. + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard". + * + * @see GeoDoubleParams + * @see GeoAsciiParams + */ + GeoKeyDirectory(34735, true), + + /** + * GeoKey floating point parameters. + * + *
This tag is used to store all of the DOUBLE valued GeoKeys, + * referenced by the {@code GeoKeyDirectoryTag}. The meaning of any + * value of this double array is determined from the + * {@code GeoKeyDirectoryTag} reference pointing to it. FLOAT values + * should first be converted to DOUBLE and stored here. + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard". + * + * @see GeoKeyDirectory + * @see GeoAsciiParams + */ + GeoDoubleParams(34736, true), + + /** + * GeoKey ASCII parameters. + * + *
This tag is used to store all of the ASCII valued GeoKeys, + * referenced by the {@code GeoKeyDirectoryTag}. Since keys use offsets + * into tags, any special comments may be placed at the beginning of + * this tag. For the most part, the only keys that are ASCII valued are + * "Citation" keys, giving documentation and references for obscure + * projections, datums, etc. + * + *
Source: OGC 19-008r4 "OGC GeoTIFF Standard".
+ *
+ * @see GeoKeyDirectory
+ * @see GeoDoubleParams
+ */
+ GeoAsciiParams(34737, true);
/**
* Tag id
@@ -258,7 +1778,7 @@ public enum FieldTagType {
/**
* Constructor
- *
+ *
* @param id
* tag id
* @param array
@@ -271,7 +1791,7 @@ private FieldTagType(int id, boolean array) {
/**
* Is this field an array type
- *
+ *
* @return true if array type
*/
public boolean isArray() {
@@ -280,7 +1800,7 @@ public boolean isArray() {
/**
* Get the tag id
- *
+ *
* @return tag id
*/
public int getId() {
@@ -303,7 +1823,7 @@ public int getId() {
/**
* Get a field tag type by id
- *
+ *
* @param id
* tag id
* @return field tag type
diff --git a/src/main/java/mil/nga/tiff/FieldType.java b/src/main/java/mil/nga/tiff/FieldType.java
index a2a551d..bb98b1b 100644
--- a/src/main/java/mil/nga/tiff/FieldType.java
+++ b/src/main/java/mil/nga/tiff/FieldType.java
@@ -4,7 +4,7 @@
import mil.nga.tiff.util.TiffException;
/**
- * Field Types
+ * Field Types.
*
* @author osbornb
*/
diff --git a/src/main/java/mil/nga/tiff/FileDirectory.java b/src/main/java/mil/nga/tiff/FileDirectory.java
index f8db6ce..7ce0660 100644
--- a/src/main/java/mil/nga/tiff/FileDirectory.java
+++ b/src/main/java/mil/nga/tiff/FileDirectory.java
@@ -22,9 +22,11 @@
import mil.nga.tiff.util.TiffException;
/**
- * File Directory, represents all directory entries and can be used to read the
- * image raster
- *
+ * File Directory.
+ *
+ * A file directory represents all directory entries and can be used to read the
+ * image raster(s).
+ *
* @author osbornb
*/
public class FileDirectory {
@@ -86,7 +88,7 @@ public class FileDirectory {
/**
* Constructor, for reading TIFF files
- *
+ *
* @param entries
* file directory entries
* @param reader
@@ -99,7 +101,7 @@ public FileDirectory(SortedSet Coordinates of a window over a portion or the entire image coordinates.
+ *
* @author osbornb
*/
public class ImageWindow {
@@ -29,7 +31,7 @@ public class ImageWindow {
/**
* Constructor
- *
+ *
* @param minX
* min x (inclusive)
* @param minY
@@ -48,7 +50,7 @@ public ImageWindow(int minX, int minY, int maxX, int maxY) {
/**
* Constructor for a single coordinate
- *
+ *
* @param x
* x coordinate
* @param y
@@ -60,7 +62,7 @@ public ImageWindow(int x, int y) {
/**
* Constructor, full image size
- *
+ *
* @param fileDirectory
* file directory
*/
@@ -73,7 +75,7 @@ public ImageWindow(FileDirectory fileDirectory) {
/**
* Get the min x
- *
+ *
* @return min x
*/
public int getMinX() {
@@ -82,7 +84,7 @@ public int getMinX() {
/**
* Set the min x
- *
+ *
* @param minX
* min x
*/
@@ -92,7 +94,7 @@ public void setMinX(int minX) {
/**
* Get the min y
- *
+ *
* @return min y
*/
public int getMinY() {
@@ -101,7 +103,7 @@ public int getMinY() {
/**
* Set the min y
- *
+ *
* @param minY
* min y
*/
@@ -111,7 +113,7 @@ public void setMinY(int minY) {
/**
* Get the max x
- *
+ *
* @return max x
*/
public int getMaxX() {
@@ -120,7 +122,7 @@ public int getMaxX() {
/**
* Set the max x
- *
+ *
* @param maxX
* max x
*/
@@ -130,7 +132,7 @@ public void setMaxX(int maxX) {
/**
* Get the max y
- *
+ *
* @return max y
*/
public int getMaxY() {
@@ -139,7 +141,7 @@ public int getMaxY() {
/**
* Set the max y
- *
+ *
* @param maxY
* max y
*/
diff --git a/src/main/java/mil/nga/tiff/Rasters.java b/src/main/java/mil/nga/tiff/Rasters.java
index 62b75e5..4b4a298 100644
--- a/src/main/java/mil/nga/tiff/Rasters.java
+++ b/src/main/java/mil/nga/tiff/Rasters.java
@@ -10,7 +10,7 @@
import mil.nga.tiff.util.TiffException;
/**
- * Raster image values
+ * Raster image values.
*
* @author osbornb
*/
diff --git a/src/main/java/mil/nga/tiff/TIFFImage.java b/src/main/java/mil/nga/tiff/TIFFImage.java
index a402e15..ef88607 100644
--- a/src/main/java/mil/nga/tiff/TIFFImage.java
+++ b/src/main/java/mil/nga/tiff/TIFFImage.java
@@ -7,7 +7,7 @@
import mil.nga.tiff.util.TiffConstants;
/**
- * TIFF Image containing the File Directories
+ * TIFF Image containing the File Directories.
*
* @author osbornb
*/
diff --git a/src/main/java/mil/nga/tiff/TiffReader.java b/src/main/java/mil/nga/tiff/TiffReader.java
index 92f552d..6b21a52 100644
--- a/src/main/java/mil/nga/tiff/TiffReader.java
+++ b/src/main/java/mil/nga/tiff/TiffReader.java
@@ -16,15 +16,18 @@
import mil.nga.tiff.util.TiffException;
/**
- * TIFF reader
- *
+ * TIFF reader.
+ *
* @author osbornb
*/
public class TiffReader {
+ // This class is not meant to be instantiated.
+ private TiffReader() {}
+
/**
* Read a TIFF from a file
- *
+ *
* @param file
* TIFF file
* @return TIFF image
@@ -37,7 +40,7 @@ public static TIFFImage readTiff(File file) throws IOException {
/**
* Read a TIFF from a file
- *
+ *
* @param file
* TIFF file
* @param cache
@@ -55,7 +58,7 @@ public static TIFFImage readTiff(File file, boolean cache)
/**
* Read a TIFF from an input stream
- *
+ *
* @param stream
* TIFF input stream
* @return TIFF image
@@ -68,7 +71,7 @@ public static TIFFImage readTiff(InputStream stream) throws IOException {
/**
* Read a TIFF from an input stream
- *
+ *
* @param stream
* TIFF input stream
* @param cache
@@ -86,7 +89,7 @@ public static TIFFImage readTiff(InputStream stream, boolean cache)
/**
* Read a TIFF from the bytes
- *
+ *
* @param bytes
* TIFF bytes
* @return TIFF image
@@ -97,7 +100,7 @@ public static TIFFImage readTiff(byte[] bytes) {
/**
* Read a TIFF from the bytes
- *
+ *
* @param bytes
* TIFF bytes
* @param cache
@@ -112,7 +115,7 @@ public static TIFFImage readTiff(byte[] bytes, boolean cache) {
/**
* Read a TIFF from the byte reader
- *
+ *
* @param reader
* byte reader
* @return TIFF image
@@ -123,7 +126,7 @@ public static TIFFImage readTiff(ByteReader reader) {
/**
* Read a TIFF from the byte reader
- *
+ *
* @param reader
* byte reader
* @param cache
@@ -171,7 +174,7 @@ public static TIFFImage readTiff(ByteReader reader, boolean cache) {
/**
* Parse the TIFF Image with file directories
- *
+ *
* @param reader
* byte reader
* @param byteOffset
@@ -246,7 +249,7 @@ private static TIFFImage parseTIFFImage(ByteReader reader, long byteOffset,
/**
* Read the field values
- *
+ *
* @param reader
* byte reader
* @param fieldTag
@@ -284,7 +287,7 @@ private static Object readFieldValues(ByteReader reader,
/**
* Get the directory entry values
- *
+ *
* @param reader
* byte reader
* @param fieldType
diff --git a/src/main/java/mil/nga/tiff/TiffWriter.java b/src/main/java/mil/nga/tiff/TiffWriter.java
index 50b5bdb..4557672 100644
--- a/src/main/java/mil/nga/tiff/TiffWriter.java
+++ b/src/main/java/mil/nga/tiff/TiffWriter.java
@@ -19,7 +19,7 @@
import mil.nga.tiff.util.TiffException;
/**
- * TIFF Writer.
+ * TIFF writer.
*
* For a striped TIFF, the {@link FileDirectory#setStripOffsets(List)} and
* {@link FileDirectory#setStripByteCounts(List)} methods are automatically set
@@ -37,6 +37,9 @@
*/
public class TiffWriter {
+ // This class is not meant to be instantiated.
+ private TiffWriter() {}
+
/**
* Write a TIFF to a file
*
diff --git a/src/main/java/mil/nga/tiff/compression/CompressionDecoder.java b/src/main/java/mil/nga/tiff/compression/CompressionDecoder.java
index 9c3e7d9..9fbefb9 100644
--- a/src/main/java/mil/nga/tiff/compression/CompressionDecoder.java
+++ b/src/main/java/mil/nga/tiff/compression/CompressionDecoder.java
@@ -3,7 +3,7 @@
import java.nio.ByteOrder;
/**
- * Compression decoder interface
+ * Compression decoder interface.
*
* @author osbornb
*/
diff --git a/src/main/java/mil/nga/tiff/compression/CompressionEncoder.java b/src/main/java/mil/nga/tiff/compression/CompressionEncoder.java
index 2f1d76c..1ee6c36 100644
--- a/src/main/java/mil/nga/tiff/compression/CompressionEncoder.java
+++ b/src/main/java/mil/nga/tiff/compression/CompressionEncoder.java
@@ -3,8 +3,10 @@
import java.nio.ByteOrder;
/**
- * Compression encoder interface. Encode either on a per row or block basis
- *
+ * Compression encoder interface.
+ *
+ * Encode either on a per row or block basis
+ *
* @author osbornb
*/
public interface CompressionEncoder {
@@ -12,14 +14,14 @@ public interface CompressionEncoder {
/**
* True to encode on a per row basis, false to encode on a per block / strip
* basis
- *
+ *
* @return true for row encoding
*/
public boolean rowEncoding();
/**
* Encode the bytes
- *
+ *
* @param bytes
* bytes to encode
* @param byteOrder
diff --git a/src/main/java/mil/nga/tiff/compression/DeflateCompression.java b/src/main/java/mil/nga/tiff/compression/DeflateCompression.java
index 826b009..146c5e2 100644
--- a/src/main/java/mil/nga/tiff/compression/DeflateCompression.java
+++ b/src/main/java/mil/nga/tiff/compression/DeflateCompression.java
@@ -11,13 +11,18 @@
import mil.nga.tiff.util.TiffException;
/**
- * Deflate Compression
+ * Deflate Compression.
*
* @author osbornb
*/
public class DeflateCompression implements CompressionDecoder,
CompressionEncoder {
+ /**
+ * Constructor.
+ */
+ public DeflateCompression() {}
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/mil/nga/tiff/compression/LZWCompression.java b/src/main/java/mil/nga/tiff/compression/LZWCompression.java
index a75e2ec..837c5d7 100644
--- a/src/main/java/mil/nga/tiff/compression/LZWCompression.java
+++ b/src/main/java/mil/nga/tiff/compression/LZWCompression.java
@@ -11,7 +11,7 @@
import mil.nga.tiff.util.TiffException;
/**
- * LZW Compression
+ * LZW Compression.
*
* @author osbornb
*/
@@ -23,6 +23,11 @@ public class LZWCompression implements CompressionDecoder, CompressionEncoder {
private static final Logger logger = Logger.getLogger(LZWCompression.class
.getName());
+ /**
+ * Constructor.
+ */
+ public LZWCompression() {}
+
/**
* Clear code
*/
diff --git a/src/main/java/mil/nga/tiff/compression/PackbitsCompression.java b/src/main/java/mil/nga/tiff/compression/PackbitsCompression.java
index fd68008..039e08c 100644
--- a/src/main/java/mil/nga/tiff/compression/PackbitsCompression.java
+++ b/src/main/java/mil/nga/tiff/compression/PackbitsCompression.java
@@ -7,13 +7,18 @@
import mil.nga.tiff.util.TiffException;
/**
- * Packbits Compression
- *
+ * Packbits Compression.
+ *
* @author osbornb
*/
public class PackbitsCompression implements CompressionDecoder,
CompressionEncoder {
+ /**
+ * Constructor.
+ */
+ public PackbitsCompression() {}
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/mil/nga/tiff/compression/Predictor.java b/src/main/java/mil/nga/tiff/compression/Predictor.java
index 6b2c1e1..f9f2819 100644
--- a/src/main/java/mil/nga/tiff/compression/Predictor.java
+++ b/src/main/java/mil/nga/tiff/compression/Predictor.java
@@ -9,13 +9,16 @@
import mil.nga.tiff.util.TiffException;
/**
- * Differencing Predictor decoder
+ * Differencing Predictor decoder.
*
* @author osbornb
* @since 3.0.0
*/
public class Predictor {
+ // This class is not meant to be instantiated.
+ private Predictor() {}
+
/**
* Decode the predictor encoded bytes
*
diff --git a/src/main/java/mil/nga/tiff/compression/RawCompression.java b/src/main/java/mil/nga/tiff/compression/RawCompression.java
index cfc8332..9d6002c 100644
--- a/src/main/java/mil/nga/tiff/compression/RawCompression.java
+++ b/src/main/java/mil/nga/tiff/compression/RawCompression.java
@@ -3,12 +3,17 @@
import java.nio.ByteOrder;
/**
- * Raw / no compression
+ * Raw / no compression.
*
* @author osbornb
*/
public class RawCompression implements CompressionDecoder, CompressionEncoder {
+ /**
+ * Constructor.
+ */
+ public RawCompression() {}
+
/**
* {@inheritDoc}
*/
diff --git a/src/main/java/mil/nga/tiff/compression/UnsupportedCompression.java b/src/main/java/mil/nga/tiff/compression/UnsupportedCompression.java
index f8e2343..1b0f23e 100644
--- a/src/main/java/mil/nga/tiff/compression/UnsupportedCompression.java
+++ b/src/main/java/mil/nga/tiff/compression/UnsupportedCompression.java
@@ -5,7 +5,7 @@
import mil.nga.tiff.util.TiffException;
/**
- * Unsupported compression
+ * Unsupported compression.
*
* @author michaelknigge
*/
diff --git a/src/main/java/mil/nga/tiff/compression/package-info.java b/src/main/java/mil/nga/tiff/compression/package-info.java
new file mode 100644
index 0000000..58399b8
--- /dev/null
+++ b/src/main/java/mil/nga/tiff/compression/package-info.java
@@ -0,0 +1,7 @@
+/**
+ * TIFF compression implementation.
+ *
+ * This package provides encoder and decoder for common compression
+ * types used within TIFF files.
+ */
+package mil.nga.tiff.compression;
diff --git a/src/main/java/mil/nga/tiff/io/IOUtils.java b/src/main/java/mil/nga/tiff/io/IOUtils.java
index b38a228..a975513 100644
--- a/src/main/java/mil/nga/tiff/io/IOUtils.java
+++ b/src/main/java/mil/nga/tiff/io/IOUtils.java
@@ -15,6 +15,9 @@
*/
public class IOUtils {
+ // This class is not meant to be instantiated.
+ private IOUtils() {}
+
/**
* Copy stream buffer chunk size in bytes
*
diff --git a/src/main/java/mil/nga/tiff/io/package-info.java b/src/main/java/mil/nga/tiff/io/package-info.java
new file mode 100644
index 0000000..1d20067
--- /dev/null
+++ b/src/main/java/mil/nga/tiff/io/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * Input / Output support utilities.
+ */
+package mil.nga.tiff.io;
diff --git a/src/main/java/mil/nga/tiff/package-info.java b/src/main/java/mil/nga/tiff/package-info.java
new file mode 100644
index 0000000..796ecc0
--- /dev/null
+++ b/src/main/java/mil/nga/tiff/package-info.java
@@ -0,0 +1,69 @@
+/**
+ * Primary TIFF API.
+ *
+ * TIFF is a Java library
+ * for reading and writing Tagged Image File Format files. It was primarily
+ * created to provide license friendly TIFF functionality to Android
+ * applications. Implementation is based on the
+ * TIFF specification
+ * and this JavaScript implementation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_NO = 1;
- public static final int COMPRESSION_CCITT_HUFFMAN = 2;
+
+ /**
+ * CCITT 1D compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
+ public static final int COMPRESSION_CCITT_HUFFMAN = 2;
+
+ /**
+ * Group 3 fax compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_T4 = 3;
+
+ /**
+ * Group 4 fax compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_T6 = 4;
+
+ /**
+ * Lempel-Ziv and Welch (LZW) compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_LZW = 5;
+
+ /**
+ * Old style JPEG compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_JPEG_OLD = 6;
+
+ /**
+ * New style JPEG compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ *
+ * This is not in the original TIFF 6 specification. See TIFF
+ * Technical Notes 22 March 2002.
+ */
public static final int COMPRESSION_JPEG_NEW = 7;
+
+ /**
+ * Deflate (zlib) compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ *
+ * This is not in the original TIFF 6 specification. See TIFF
+ * Technical Notes 22 March 2002.
+ */
public static final int COMPRESSION_DEFLATE = 8;
+
+ /**
+ * Obsolete ZIP/flate compression.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ *
+ * This is identical implementation to COMPRESSION_DEFLATE. See
+ * TIFF Technical Notes 22 March 2002.
+ */
@Deprecated
- public static final int COMPRESSION_PKZIP_DEFLATE = 32946; // PKZIP-style Deflate encoding (Obsolete).
+ public static final int COMPRESSION_PKZIP_DEFLATE = 32946; // PKZIP-style Deflate encoding (Obsolete).
+
+ /**
+ * PackBits compression.
+ *
+ * Run Length Encoding, originally from Macintosh.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Compression}.
+ */
public static final int COMPRESSION_PACKBITS = 32773;
- // Extra Samples constants
+ /**
+ * Unspecified extra sample type.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ExtraSamples}.
+ */
public static final int EXTRA_SAMPLES_UNSPECIFIED = 0;
+
+ /**
+ * Associated alpha data extra sample type.
+ *
+ * This is opacity information (pre-multiplied colour).
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ExtraSamples}.
+ */
public static final int EXTRA_SAMPLES_ASSOCIATED_ALPHA = 1;
- public static final int EXTRA_SAMPLES_UNASSOCIATED_ALPHA = 2;
- // Fill Order constants
+ /**
+ * Unassociated alpha data extra sample type.
+ *
+ * This is soft matte information (not pre-multiplied colour).
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ExtraSamples}.
+ */
+ public static final int EXTRA_SAMPLES_UNASSOCIATED_ALPHA = 2;
+
+ /**
+ * Fill order high bits first.
+ *
+ * Pixels are arranged within a byte such that pixels with lower
+ * column values are stored in the higher-order bits of the byte.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#FillOrder}.
+ */
public static final int FILL_ORDER_LOWER_COLUMN_HIGHER_ORDER = 1;
+
+ /**
+ * Fill order low bits first.
+ *
+ * Pixels are arranged within a byte such that pixels with lower
+ * column values are stored in the lower-order bits of the byte.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#FillOrder}.
+ */
public static final int FILL_ORDER_LOWER_COLUMN_LOWER_ORDER = 2;
- // Gray Response constants
+ /**
+ * Gray response is in tenths of a unit.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#GrayResponseUnit}.
+ */
public static final int GRAY_RESPONSE_TENTHS = 1;
+
+ /**
+ * Gray response is in hundredths of a unit.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#GrayResponseUnit}.
+ */
public static final int GRAY_RESPONSE_HUNDREDTHS = 2;
+
+ /**
+ * Gray response is in thousandths of a unit.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#GrayResponseUnit}.
+ */
public static final int GRAY_RESPONSE_THOUSANDTHS = 3;
+
+ /**
+ * Gray response is in ten-thousandths of a unit.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#GrayResponseUnit}.
+ */
public static final int GRAY_RESPONSE_TEN_THOUSANDTHS = 4;
+
+ /**
+ * Gray response is in hundred-thousandths of a unit.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#GrayResponseUnit}.
+ */
public static final int GRAY_RESPONSE_HUNDRED_THOUSANDTHS = 5;
- // Orientation constants
+ /**
+ * Orientation origin is top-left.
+ *
+ * The 0th row represents the visual top of the image,
+ * and the 0th column represents the visual left-hand side.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_TOP_ROW_LEFT_COLUMN = 1;
+
+ /**
+ * Orientation origin is top-right.
+ *
+ * The 0th row represents the visual top of the image,
+ * and the 0th column represents the visual right-hand side.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_TOP_ROW_RIGHT_COLUMN = 2;
+
+ /**
+ * Orientation origin is bottom-right.
+ *
+ * The 0th row represents the visual bottom of the image,
+ * and the 0th column represents the visual right-hand side.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_BOTTOM_ROW_RIGHT_COLUMN = 3;
+
+ /**
+ * Orientation origin is bottom-left.
+ *
+ * The 0th row represents the visual bottom of the image,
+ * and the 0th column represents the visual left-hand side.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_BOTTOM_ROW_LEFT_COLUMN = 4;
+
+ /**
+ * Orientation origin is left-top.
+ *
+ * The 0th row represents the visual left-hand side of
+ * the image, and the 0th column represents the visual
+ * top.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_LEFT_ROW_TOP_COLUMN = 5;
+
+ /**
+ * Orientation origin is right-top.
+ *
+ * The 0th row represents the visual right-hand side of
+ * the image, and the 0th column represents the visual
+ * top.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_RIGHT_ROW_TOP_COLUMN = 6;
+
+ /**
+ * Orientation origin is right-bottom.
+ *
+ * The 0th row represents the visual right-hand side of
+ * the image, and the 0th column represents the visual
+ * bottom.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_RIGHT_ROW_BOTTOM_COLUMN = 7;
+
+ /**
+ * Orientation origin is left-bottom.
+ *
+ * The 0th row represents the visual left-hand side of
+ * the image, and the 0th column represents the visual
+ * bottom.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Orientation}.
+ */
public static final int ORIENTATION_LEFT_ROW_BOTTOM_COLUMN = 8;
- // Photometric Interpretation constants
+ /**
+ * White is zero photometric interpretation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ */
public static final int PHOTOMETRIC_INTERPRETATION_WHITE_IS_ZERO = 0;
+
+ /**
+ * Black is zero photometric interpretation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ */
public static final int PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO = 1;
+
+ /**
+ * RGB photometric interpretation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ */
public static final int PHOTOMETRIC_INTERPRETATION_RGB = 2;
+
+ /**
+ * Palette colour photometric interpretation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ */
public static final int PHOTOMETRIC_INTERPRETATION_PALETTE = 3;
+
+ /**
+ * Transparency mask photometric interpretation.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ */
public static final int PHOTOMETRIC_INTERPRETATION_TRANSPARENCY = 4;
- // Planar Configuration constants
+ /**
+ * Chunky planar configuration.
+ *
+ * The component values for each pixel are stored contiguously (i.e.
+ * pixel interleave). The order of the components within the pixel is
+ * specified by {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PlanarConfiguration}.
+ */
public static final int PLANAR_CONFIGURATION_CHUNKY = 1;
+
+ /**
+ * Component plane planar configuration.
+ *
+ * The components are stored in separate “component planes". (i.e.
+ * component interleave). The order of the components within the pixel is
+ * specified by {@link mil.nga.tiff.FieldTagType#PhotometricInterpretation}.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#PlanarConfiguration}.
+ */
public static final int PLANAR_CONFIGURATION_PLANAR = 2;
- // Resolution Unit constants
+ /**
+ * Resolution unit none.
+ *
+ * No absolute unit of measurement. Used for images that may have a
+ * non-square aspect ratio, but no meaningful absolute dimensions.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ResolutionUnit}.
+ */
public static final int RESOLUTION_UNIT_NO = 1;
+
+ /**
+ * Resolution unit inch.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ResolutionUnit}.
+ */
public static final int RESOLUTION_UNIT_INCH = 2;
+
+ /**
+ * Resolution unit centimetre.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#ResolutionUnit}.
+ */
public static final int RESOLUTION_UNIT_CENTIMETER = 3;
- // Sample Format constants
+ /**
+ * Unsigned integer sample format.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SampleFormat}.
+ */
public static final int SAMPLE_FORMAT_UNSIGNED_INT = 1;
+
+ /**
+ * Two's complement signed integer sample format.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SampleFormat}.
+ */
public static final int SAMPLE_FORMAT_SIGNED_INT = 2;
+
+ /**
+ * IEEE floating point sample format.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SampleFormat}.
+ */
public static final int SAMPLE_FORMAT_FLOAT = 3;
+
+ /**
+ * Undefined data sample format.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SampleFormat}.
+ */
public static final int SAMPLE_FORMAT_UNDEFINED = 4;
- // Subfile Type constants
+ /**
+ * Full resolution image data subfile type.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SubfileType}.
+ */
public static final int SUBFILE_TYPE_FULL = 1;
+
+ /**
+ * Reduced resolution image data subfile type.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SubfileType}.
+ */
public static final int SUBFILE_TYPE_REDUCED = 2;
+
+ /**
+ * Single page of multi-page image subfile type.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#SubfileType}.
+ */
public static final int SAMPLE_FORMAT_SINGLE_PAGE_MULTI_PAGE = 3;
- // Threshholding constants
+ /**
+ * No dithering or halftoning.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Threshholding}.
+ */
public static final int THRESHHOLDING_NO = 1;
+
+ /**
+ * Ordered dithering or halftoning.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Threshholding}.
+ */
public static final int THRESHHOLDING_ORDERED = 2;
+
+ /**
+ * Random dithering or halftoning.
+ *
+ * A randomized process such as error diffusion has been applied to the image data.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Threshholding}.
+ */
public static final int THRESHHOLDING_RANDOM = 3;
- // Differencing Predictor constants
+ /**
+ * No differencing predictor.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Predictor}.
+ */
public static final int PREDICTOR_NO = 1;
+
+ /**
+ * Horizontal differencing predictor.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Predictor}.
+ */
public static final int PREDICTOR_HORIZONTAL = 2;
+
+ /**
+ * Floating point differencing predictor.
+ *
+ * This is one of the options for {@link mil.nga.tiff.FieldTagType#Predictor}.
+ *
+ * This is not in the baseline TIFF 6.0 specification. See TIFF Technical
+ * Note 3.
+ */
public static final int PREDICTOR_FLOATINGPOINT = 3;
}
diff --git a/src/main/java/mil/nga/tiff/util/TiffException.java b/src/main/java/mil/nga/tiff/util/TiffException.java
index 3f93e23..58611da 100644
--- a/src/main/java/mil/nga/tiff/util/TiffException.java
+++ b/src/main/java/mil/nga/tiff/util/TiffException.java
@@ -1,7 +1,7 @@
package mil.nga.tiff.util;
/**
- * TIFF exception
+ * TIFF exception.
*
* @author osbornb
*/
diff --git a/src/main/java/mil/nga/tiff/util/package-info.java b/src/main/java/mil/nga/tiff/util/package-info.java
new file mode 100644
index 0000000..8ecb69c
--- /dev/null
+++ b/src/main/java/mil/nga/tiff/util/package-info.java
@@ -0,0 +1,4 @@
+/**
+ * Utility classes.
+ */
+package mil.nga.tiff.util;
Overview
+ *
+ * Usage
+ *
+ * Reading
+ *
+ * {@code
+ * //File input = ...
+ * //InputStream input = ...
+ * //byte[] input = ...
+ * //ByteReader input = ...
+ *
+ * TIFFImage tiffImage = TiffReader.readTiff(input);
+ * List
+ *
+ * Writing
+ *
+ * {@code
+ * int width = 256;
+ * int height = 256;
+ * int samplesPerPixel = 1;
+ * FieldType fieldType = FieldType.FLOAT;
+ * int bitsPerSample = fieldType.getBits();
+ *
+ * Rasters rasters = new Rasters(width, height, samplesPerPixel, fieldType);
+ *
+ * int rowsPerStrip = rasters.calculateRowsPerStrip(TiffConstants.PLANAR_CONFIGURATION_CHUNKY);
+ *
+ * FileDirectory directory = new FileDirectory();
+ * directory.setImageWidth(width);
+ * directory.setImageHeight(height);
+ * directory.setBitsPerSample(bitsPerSample);
+ * directory.setCompression(TiffConstants.COMPRESSION_NO);
+ * directory.setPhotometricInterpretation(TiffConstants.PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO);
+ * directory.setSamplesPerPixel(samplesPerPixel);
+ * directory.setRowsPerStrip(rowsPerStrip);
+ * directory.setPlanarConfiguration(TiffConstants.PLANAR_CONFIGURATION_CHUNKY);
+ * directory.setSampleFormat(TiffConstants.SAMPLE_FORMAT_FLOAT);
+ * directory.setWriteRasters(rasters);
+ *
+ * for (int y = 0; y < height; y++) {
+ * for (int x = 0; x < width; x++) {
+ * float pixelValue = 1.0f; // any pixel value
+ * rasters.setFirstPixelSample(x, y, pixelValue);
+ * }
+ * }
+ *
+ * TIFFImage tiffImage = new TIFFImage();
+ * tiffImage.add(directory);
+ * byte[] bytes = TiffWriter.writeTiffToBytes(tiffImage);
+ * // or
+ * // File file = ...
+ * // TiffWriter.writeTiff(file, tiffImage);
+ * }
+ */
+package mil.nga.tiff;
diff --git a/src/main/java/mil/nga/tiff/util/TiffConstants.java b/src/main/java/mil/nga/tiff/util/TiffConstants.java
index 5a3abe9..a85bc38 100644
--- a/src/main/java/mil/nga/tiff/util/TiffConstants.java
+++ b/src/main/java/mil/nga/tiff/util/TiffConstants.java
@@ -1,12 +1,15 @@
package mil.nga.tiff.util;
/**
- * TIFF Constants
- *
+ * TIFF Constants.
+ *
* @author osbornb
*/
public class TiffConstants {
+ // This class is not meant to be instantiated.
+ private TiffConstants() {}
+
/**
* Little Endian byte order string
*/
@@ -47,80 +50,428 @@ public class TiffConstants {
*/
public static final int DEFAULT_MAX_BYTES_PER_STRIP = 8000;
- // Compression constants
+
+ /**
+ * No compression.
+ *
+ *