diff --git a/src/main/java/org/apache/commons/imaging/color/ColorConversions.java b/src/main/java/org/apache/commons/imaging/color/ColorConversions.java index d9aa60abd..d33b57788 100644 --- a/src/main/java/org/apache/commons/imaging/color/ColorConversions.java +++ b/src/main/java/org/apache/commons/imaging/color/ColorConversions.java @@ -19,20 +19,15 @@ public final class ColorConversions { + /* + * These constants are for CIEXYZ to CIELAB conversion. + * For reference: From CIEXYZ to CIELAB, from CIELAB color space + */ // White reference - /** see: https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */ private static final double REF_X = 95.047; // Observer= 2°, Illuminant= D65 - - /** see: https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */ private static final double REF_Y = 100.000; - - /** see: https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */ private static final double REF_Z = 108.883; - - /** see: https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */ private static final double XYZ_m = 7.787037; // match in slope. Note commonly seen 7.787 gives worse results - - /** see: https://en.wikipedia.org/wiki/CIELAB_color_space#From_CIEXYZ_to_CIELAB[10] */ private static final double XYZ_t0 = 0.008856; private ColorConversions() { diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java index 0a79c67a7..627014190 100644 --- a/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java +++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/decoder/Dct.java @@ -252,9 +252,10 @@ public static void forwardDCT8x8(final float[] matrix) { /** * Fast inverse Dct using AA&N. This is taken from the beautiful - * http://vsr.finermatik.tu-chemnitz.de/~jan/MPEG/HTML/IDCT.html which gives - * easy equations and properly explains constants and scaling factors. Terms - * have been inlined and the negation optimized out of existence. + * (broken link) + * which gives easy equations and properly explains constants and + * scaling factors. Terms have been inlined and the negation + * optimized out of existence. */ public static void inverseDCT8(final float[] vector) { // B1 diff --git a/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java b/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java index 2bfaf387c..9a1032cf4 100644 --- a/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java +++ b/src/main/java/org/apache/commons/imaging/formats/jpeg/segments/App14Segment.java @@ -24,7 +24,7 @@ import java.nio.charset.StandardCharsets; /** - * http://www.aiim.org/documents/standards/PDF-Ref/References/Adobe/5116.DCT_Filter.pdf + * @see Supporting the DCT Filters in PostScript Level 2 */ public class App14Segment extends AppnSegment { private static final byte[] ADOBE_PREFIX; diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java index 3cc590969..b59b4f0a2 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/TiffReader.java @@ -440,7 +440,7 @@ private TiffImageData getTiffRawImageData(final ByteSource byteSource, rowsPerStrip = rowsPerStripField.getIntValue(); } else { final TiffField imageHeight = directory.findField(TiffTagConstants.TIFF_TAG_IMAGE_LENGTH); - /** + /* * if rows per strip not present then rowsPerStrip is equal to * imageLength or an infinity value; */ diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java index 3cef4c96d..ac9ad056f 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePageMaker6TagConstants.java @@ -28,47 +28,88 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShort; /** - * TIFF specification supplement 1 - *
- * Enhancements for Adobe PageMaker(R) 6.0 software - *
- * http://partners.adobe.com/public/developer/en/tiff/TIFFPM6.pdf + * TIFF specification supplement 1. + * + * @see Adobe PageMaker(R) 6.0 TIFF Technical Notes */ public final class AdobePageMaker6TagConstants { + /** + * 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 + * sub-sampled version of the parent image.

+ */ public static final TagInfoLongOrIFD TIFF_TAG_SUB_IFD = new TagInfoLongOrIFD( "SubIFDs", 0x014a, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN, true); - + /** + * 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.

+ */ public static final TagInfoBytes TIFF_TAG_CLIP_PATH = new TagInfoBytes( "ClipPath", 0x0157, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** + * XClipPathUnits. + * + *

The number of units that span the width of the image, in terms of integer ClipPath + * coordinates.

+ */ public static final TagInfoLong TIFF_TAG_XCLIP_PATH_UNITS = new TagInfoLong( "XClipPathUnits", 0x0158, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** + * YClipPathUnits. + * + *

The number of units that span the height of the image, in terms of integer ClipPath + * coordinates.

+ */ public static final TagInfoLong TIFF_TAG_YCLIP_PATH_UNITS = new TagInfoLong( "YClipPathUnits", 0x0159, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** + * 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 ColorMap. + * ColorMap is required for an Indexed image.

+ */ public static final TagInfoShort TIFF_TAG_INDEXED = new TagInfoShort( "Indexed", 0x015a, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final int INDEXED_VALUE_NOT_INDEXED = 0; - public static final int INDEXED_VALUE_INDEXED = 1; - + /** + * OPIProxy. + * + *

OPIProxy gives information concerning whether this image is a low-resolution + * proxy of a high-resolution image.

+ */ public static final TagInfoShort TIFF_TAG_OPIPROXY = new TagInfoShort( "OPIProxy", 0x015f, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_DOES_NOT_EXIST = 0; - public static final int OPIPROXY_VALUE_HIGHER_RESOLUTION_IMAGE_EXISTS = 1; + /** + * ImageID. + * + *

ImageID is the full pathname of the original, high-resolution image, or any other + * identifying string that uniquely identifies the original image.

+ */ public static final TagInfoAscii TIFF_TAG_IMAGE_ID = new TagInfoAscii( "ImageID", 0x800d, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** + * A list with all the Adobe PageMaker 6 tags. + */ public static final List ALL_ADOBE_PAGEMAKER_6_TAGS = Collections.unmodifiableList(Arrays.asList( TIFF_TAG_SUB_IFD, diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePhotoshopTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePhotoshopTagConstants.java index 33c8b22bc..f3885f7d1 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePhotoshopTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AdobePhotoshopTagConstants.java @@ -24,22 +24,34 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoUndefineds; /** - * TIFF specification supplement 2 - *
- * Adobe Photoshop (R) TIFF Technical Notes - *
- * http://partners.adobe.com/public/developer/en/tiff/TIFFphotoshop.pdf + * TIFF specification supplement 2. + * + * See Adobe Photoshop (R) TIFF Technical Notes */ public final class AdobePhotoshopTagConstants { + /** + * JPEGTables. + * + *

JPEGTables provides default JPEG quantization and/or Huffman tables which are used whenever + * a segment data stream does not contain its own tables, as specified below.

+ */ public static final TagInfoUndefineds EXIF_TAG_JPEGTABLES = new TagInfoUndefineds( "JPEGTables", 0x015b, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); + /** + * ImageSourceData. + * + *

Image source data bytes.

+ */ public static final TagInfoUndefineds EXIF_TAG_IMAGE_SOURCE_DATA = new TagInfoUndefineds( "ImageSourceData", 0x935c, -1, TiffDirectoryType.EXIF_DIRECTORY_IFD0); + /** + * A list with all the Adobe Photoshop tags. + */ public static final List ALL_ADOBE_PHOTOSHOP_TAGS = Collections.unmodifiableList(Arrays. asList( EXIF_TAG_JPEGTABLES, diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AliasSketchbookProTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AliasSketchbookProTagConstants.java index 0052cdc96..a368f4b9a 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AliasSketchbookProTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/AliasSketchbookProTagConstants.java @@ -16,7 +16,6 @@ */ package org.apache.commons.imaging.formats.tiff.constants; -import java.util.Arrays; import java.util.Collections; import java.util.List; @@ -24,19 +23,23 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoAscii; /** - * Alias Sketchbook Pro multi-layer TIFF - *
- * http://www.awaresystems.be/imaging/tiff/tifftags/docs/alias.html + * Alias Sketchbook Pro multi-layer TIFF. + * + * @see Alias Sketchbook Pro Multi-Layer TIFF File Format Specification */ public final class AliasSketchbookProTagConstants { + /** + * Identifies a file as an Alias Multi Layer TIFF file. + */ public static final TagInfoAscii EXIF_TAG_ALIAS_LAYER_METADATA = new TagInfoAscii( "Alias Layer Metadata", 0xc660, -1, TiffDirectoryType.EXIF_DIRECTORY_UNKNOWN); - public static final List ALL_ALIAS_SKETCHBOOK_PRO_TAGS = - Collections.unmodifiableList(Arrays. asList( - EXIF_TAG_ALIAS_LAYER_METADATA)); + /** + * A list with all the Alias Sketchbook Pro multi-layer tags. + */ + public static final List ALL_ALIAS_SKETCHBOOK_PRO_TAGS = Collections.singletonList(EXIF_TAG_ALIAS_LAYER_METADATA); private AliasSketchbookProTagConstants() { } diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DcfTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DcfTagConstants.java index 09284f451..198445db5 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DcfTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DcfTagConstants.java @@ -26,9 +26,9 @@ import org.apache.commons.imaging.formats.tiff.taginfos.TagInfoShortOrLong; /** - * Design rule for Camera Filesystem - *
- * http://www.exif.org/dcf.PDF + * Design rule for Camera Filesystem. + * + * @see Design rule for Camera File system Version 1.0 */ public final class DcfTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DngTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DngTagConstants.java index 84f0c4d2e..32cb8431c 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DngTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/DngTagConstants.java @@ -42,7 +42,7 @@ /** * Digital Negative (DNG) Specification *
- * http://www.adobe.com/products/dng/pdfs/dng_spec_1_3_0_0.pdf + * ... */ public final class DngTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/ExifTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/ExifTagConstants.java index 16c85e55e..67da83382 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/ExifTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/ExifTagConstants.java @@ -42,11 +42,11 @@ /** * References: - * http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/EXIF.html - * http://tiki-lounge.com/~raf/tiff/fields.html - * http://www.awaresystems.be/imaging/tiff/tifftags.html + * ... + * ... + * ... * - * "Stonits": http://www.anyhere.com/gward/pixformat/tiffluv.html + * "Stonits": ... */ public final class ExifTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GdalLibraryTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GdalLibraryTagConstants.java index 541514ccc..bb20772f4 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GdalLibraryTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GdalLibraryTagConstants.java @@ -26,9 +26,9 @@ /** * GDAL library. *
- * http://www.awaresystems.be/imaging/tiff/tifftags/gdal_metadata.html + * ... *
- * http://www.awaresystems.be/imaging/tiff/tifftags/gdal_nodata.html + * ... */ public final class GdalLibraryTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GeoTiffTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GeoTiffTagConstants.java index 3f0a51b5f..0d6211411 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GeoTiffTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/GeoTiffTagConstants.java @@ -28,7 +28,7 @@ /** * Geo Tiff. *
- * http://www.remotesensing.org/geotiff/spec/contents.html + * ... */ public final class GeoTiffTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/MolecularDynamicsGelTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/MolecularDynamicsGelTagConstants.java index a02094dee..9a9a778b9 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/MolecularDynamicsGelTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/MolecularDynamicsGelTagConstants.java @@ -29,7 +29,7 @@ /** * Molecular Dynamics GEL file format *
- * http://www.awaresystems.be/imaging/tiff/tifftags/docs/gel.html + * ... */ public final class MolecularDynamicsGelTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java index ad68dd268..df265e290 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/OceScanjobTagConstants.java @@ -26,7 +26,7 @@ /** * Oce Scanjob. *
- * http://www.awaresystems.be/imaging/tiff/tifftags/docs/oce.html + * ... */ public final class OceScanjobTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Rfc2301TagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Rfc2301TagConstants.java index 6e978a8d2..2be3e19e8 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Rfc2301TagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Rfc2301TagConstants.java @@ -33,12 +33,11 @@ /** * RFC 2301: File Format for Internet Fax - *
- * www.ietf.org/rfc/rfc2301.txt - *
- * Also subsumes "The spirit of TIFF class F" - *
- * http://cool.conservation-us.org/bytopic/imaging/std/tiff-f.html + * + *

Also subsumes "The spirit of TIFF class F"

+ * + * @see RFC-2301 File Format for Internet Fax + * @see TIFF-F Revised Specification */ public final class Rfc2301TagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Tiff4TagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Tiff4TagConstants.java index 797ddf38e..a5f421361 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Tiff4TagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/Tiff4TagConstants.java @@ -25,8 +25,8 @@ /** * Tags in TIFF4 but NOT in TIFF6. - *
- * http://cool.conservation-us.org/bytopic/imaging/std/tiff4.html + * + * @see Tag Image File Format Rev 4.0 */ public final class Tiff4TagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/TiffTagConstants.java b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/TiffTagConstants.java index 7b3bf8925..21c121563 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/constants/TiffTagConstants.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/constants/TiffTagConstants.java @@ -36,8 +36,8 @@ /** * Tags from the TIFF6 specification. - *
- * http://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf + * + * @see TIFF Revision 6.0 */ public final class TiffTagConstants { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/BitInputStream.java b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/BitInputStream.java index 5d2179882..a37f7c7bd 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/BitInputStream.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/BitInputStream.java @@ -89,10 +89,10 @@ public final int readBits(final int count) throws IOException { return is.read(); } - /** + /* * Taking default order of the Tiff to be Little Endian and reversing * the bytes in the end if its Big Endian.This is done because majority - * (may be all) of the files will be of Little Endian. + * (maybe all) of the files will be of Little Endian. */ if (byteOrder == ByteOrder.BIG_ENDIAN) { switch (count) { diff --git a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java index 95fdf1f67..b86e3c960 100644 --- a/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java +++ b/src/main/java/org/apache/commons/imaging/formats/tiff/datareaders/ImageDataReader.java @@ -244,8 +244,8 @@ protected boolean isHomogenous(final int size) { * * @param bis the stream to read from * @param result the samples array to populate, must be the same length as - * bitsPerSample.length - * @throws IOException + * {@code bitsPerSample.length} + * @throws IOException if it fails to read bits from the stream */ void getSamplesAsBytes(final BitInputStream bis, final int[] result) throws IOException { for (int i = 0; i < bitsPerSample.length; i++) {