├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ ├── config.yml │ └── documentation-report.md └── workflows │ ├── build-test.yml │ └── build.yml ├── .gitignore ├── CHANGELOG.md ├── LICENSE.txt ├── README.md ├── docs ├── docs │ └── api │ │ ├── META-INF │ │ └── MANIFEST.MF │ │ ├── allclasses-index.html │ │ ├── allclasses.html │ │ ├── allpackages-index.html │ │ ├── constant-values.html │ │ ├── deprecated-list.html │ │ ├── element-list │ │ ├── help-doc.html │ │ ├── index-all.html │ │ ├── index.html │ │ ├── jquery │ │ ├── external │ │ │ └── jquery │ │ │ │ └── jquery.js │ │ ├── images │ │ │ ├── ui-bg_glass_55_fbf9ee_1x400.png │ │ │ ├── ui-bg_glass_65_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_dadada_1x400.png │ │ │ ├── ui-bg_glass_75_e6e6e6_1x400.png │ │ │ ├── ui-bg_glass_95_fef1ec_1x400.png │ │ │ ├── ui-bg_highlight-soft_75_cccccc_1x100.png │ │ │ ├── ui-icons_222222_256x240.png │ │ │ ├── ui-icons_2e83ff_256x240.png │ │ │ ├── ui-icons_454545_256x240.png │ │ │ ├── ui-icons_888888_256x240.png │ │ │ └── ui-icons_cd0a0a_256x240.png │ │ ├── jquery-3.5.1.js │ │ ├── jquery-ui.css │ │ ├── jquery-ui.js │ │ ├── jquery-ui.min.css │ │ ├── jquery-ui.min.js │ │ ├── jquery-ui.structure.css │ │ ├── jquery-ui.structure.min.css │ │ ├── jszip-utils │ │ │ └── dist │ │ │ │ ├── jszip-utils-ie.js │ │ │ │ ├── jszip-utils-ie.min.js │ │ │ │ ├── jszip-utils.js │ │ │ │ └── jszip-utils.min.js │ │ └── jszip │ │ │ └── dist │ │ │ ├── jszip.js │ │ │ └── jszip.min.js │ │ ├── member-search-index.js │ │ ├── member-search-index.zip │ │ ├── mil │ │ └── nga │ │ │ └── tiff │ │ │ ├── FieldTagType.html │ │ │ ├── FieldType.html │ │ │ ├── FileDirectory.html │ │ │ ├── FileDirectoryEntry.html │ │ │ ├── ImageWindow.html │ │ │ ├── Rasters.html │ │ │ ├── TIFFImage.html │ │ │ ├── TiffReader.html │ │ │ ├── TiffWriter.html │ │ │ ├── class-use │ │ │ ├── FieldTagType.html │ │ │ ├── FieldType.html │ │ │ ├── FileDirectory.html │ │ │ ├── FileDirectoryEntry.html │ │ │ ├── ImageWindow.html │ │ │ ├── Rasters.html │ │ │ ├── TIFFImage.html │ │ │ ├── TiffReader.html │ │ │ └── TiffWriter.html │ │ │ ├── compression │ │ │ ├── CompressionDecoder.html │ │ │ ├── CompressionEncoder.html │ │ │ ├── DeflateCompression.html │ │ │ ├── LZWCompression.html │ │ │ ├── PackbitsCompression.html │ │ │ ├── Predictor.html │ │ │ ├── RawCompression.html │ │ │ ├── UnsupportedCompression.html │ │ │ ├── class-use │ │ │ │ ├── CompressionDecoder.html │ │ │ │ ├── CompressionEncoder.html │ │ │ │ ├── DeflateCompression.html │ │ │ │ ├── LZWCompression.html │ │ │ │ ├── PackbitsCompression.html │ │ │ │ ├── Predictor.html │ │ │ │ ├── RawCompression.html │ │ │ │ └── UnsupportedCompression.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ │ ├── io │ │ │ ├── ByteReader.html │ │ │ ├── ByteWriter.html │ │ │ ├── IOUtils.html │ │ │ ├── class-use │ │ │ │ ├── ByteReader.html │ │ │ │ ├── ByteWriter.html │ │ │ │ └── IOUtils.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ ├── package-use.html │ │ │ └── util │ │ │ ├── TiffConstants.html │ │ │ ├── TiffException.html │ │ │ ├── class-use │ │ │ ├── TiffConstants.html │ │ │ └── TiffException.html │ │ │ ├── package-summary.html │ │ │ ├── package-tree.html │ │ │ └── package-use.html │ │ ├── overview-summary.html │ │ ├── overview-tree.html │ │ ├── package-search-index.js │ │ ├── package-search-index.zip │ │ ├── resources │ │ ├── glass.png │ │ └── x.png │ │ ├── script.js │ │ ├── search.js │ │ ├── serialized-form.html │ │ ├── stylesheet.css │ │ ├── type-search-index.js │ │ └── type-search-index.zip ├── index.html └── stylesheets │ ├── github-light.css │ ├── normalize.css │ └── stylesheet.css ├── pom.xml └── src ├── main └── java │ └── mil │ └── nga │ └── tiff │ ├── FieldTagType.java │ ├── FieldType.java │ ├── FileDirectory.java │ ├── FileDirectoryEntry.java │ ├── ImageWindow.java │ ├── Rasters.java │ ├── TIFFImage.java │ ├── TiffReader.java │ ├── TiffWriter.java │ ├── compression │ ├── CompressionDecoder.java │ ├── CompressionEncoder.java │ ├── DeflateCompression.java │ ├── LZWCompression.java │ ├── PackbitsCompression.java │ ├── Predictor.java │ ├── RawCompression.java │ └── UnsupportedCompression.java │ ├── io │ ├── ByteReader.java │ ├── ByteWriter.java │ └── IOUtils.java │ └── util │ ├── TiffConstants.java │ └── TiffException.java └── test ├── java └── mil │ └── nga │ └── tiff │ ├── ReadmeTest.java │ ├── TiffFileTester.java │ ├── TiffReadTest.java │ ├── TiffTestConstants.java │ ├── TiffTestUtils.java │ └── TiffWriteTest.java └── resources ├── README ├── deflate.tiff ├── deflate_predictor.tiff ├── deflate_predictor_big_strips.tiff ├── deflate_predictor_tiled.tiff ├── float32.tiff ├── float64.tiff ├── initial.tiff ├── int32.tiff ├── interleave.tiff ├── lzw.tiff ├── lzw_predictor.tiff ├── lzw_predictor_floating.tiff ├── overviews.tiff ├── packbits.tiff ├── quad-jpeg.tif ├── rgb.tiff ├── small.tiff ├── stripped.tiff ├── tiled.tiff ├── tiledplanar.tiff ├── tiledplanarlzw.tiff └── uint32.tiff /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Report an issue 4 | title: '' 5 | labels: bug 6 | assignees: '' 7 | 8 | --- 9 | 10 | Please fill out as much known and relevant information as possible. 11 | 12 | #### Version Information: 13 | 14 | * TIFF Java Version: 15 | * TIFF Java Source: (e.g. Central Repository, Release, Source Code Build) 16 | * IDE Name & Version: 17 | * Maven Version: (mvn -version) 18 | * Java Version: (java -version) 19 | * Platform & OS: 20 | * Other Relevant Libraries: 21 | 22 | #### Expected Results: 23 | 24 | * What did you expect to happen? 25 | 26 | #### Observed Results: 27 | 28 | * What happened instead? 29 | * How often does this occur? 30 | 31 | #### Output: 32 | 33 | * Any logs, errors, or output messages? 34 | 35 | #### Steps to Reproduce: 36 | 37 | 1. Step One 38 | 2. Step Two 39 | 3. ... 40 | 41 | #### Relevant Code: 42 | 43 | ```java 44 | // Code to reproduce the problem? 45 | ``` 46 | 47 | #### Test Files: 48 | 49 | * Links to any files needed for testing? 50 | 51 | #### Additional Information: 52 | 53 | * Any additional configuration, data, or information that might help with the issue? 54 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | 2 | blank_issues_enabled: false 3 | contact_links: 4 | - name: Discussions 5 | url: https://github.com/ngageoint/tiff-java/discussions 6 | about: Questions, Feature Requests, Feedback, Conversations 7 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/documentation-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Documentation report 3 | about: Report a documentation issue 4 | title: '' 5 | labels: documentation 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the documentation issue** 11 | A clear and concise description of what the issue is. 12 | 13 | **Additional context** 14 | Add any other context about the issue here. 15 | -------------------------------------------------------------------------------- /.github/workflows/build-test.yml: -------------------------------------------------------------------------------- 1 | name: Build & Test 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | 9 | jobs: 10 | 11 | build: 12 | 13 | runs-on: ubuntu-latest 14 | 15 | steps: 16 | - name: Checkout Repository 17 | uses: actions/checkout@v3 18 | - name: Set up JDK 11 19 | uses: actions/setup-java@v3 20 | with: 21 | distribution: 'temurin' 22 | java-version: 11 23 | - name: Build & Test 24 | run: mvn clean package 25 | - name: Copy Release Artifacts 26 | run: | 27 | mkdir target/release 28 | cp pom.xml target/*.jar target/release/ 29 | - name: Upload Artifacts 30 | uses: actions/upload-artifact@v1 31 | with: 32 | name: tiff 33 | path: target/release 34 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Build 2 | 3 | on: 4 | push: 5 | branches-ignore: 6 | - master 7 | 8 | jobs: 9 | 10 | build: 11 | 12 | runs-on: ubuntu-latest 13 | 14 | steps: 15 | - name: Checkout Repository 16 | uses: actions/checkout@v3 17 | - name: Set up JDK 11 18 | uses: actions/setup-java@v3 19 | with: 20 | distribution: 'temurin' 21 | java-version: 11 22 | - name: Build 23 | run: mvn clean package -DskipTests 24 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | /bin/ 3 | 4 | # IntelliJ 5 | .idea 6 | *.iml 7 | 8 | # Eclipse Core 9 | .project 10 | .settings/ 11 | 12 | # JDT-specific (Eclipse Java Development Tools) 13 | .classpath 14 | -------------------------------------------------------------------------------- /CHANGELOG.md: -------------------------------------------------------------------------------- 1 | # Change Log 2 | All notable changes to this project will be documented in this file. 3 | Adheres to [Semantic Versioning](http://semver.org/). 4 | 5 | --- 6 | 7 | ## 3.0.1 (TBD) 8 | 9 | * TBD 10 | 11 | ## [3.0.0](https://github.com/ngageoint/tiff-java/releases/tag/3.0.0) (01-10-2022) 12 | 13 | * Differencing Predictor decoding implementation 14 | * Java 11 15 | 16 | ## [2.0.5](https://github.com/ngageoint/tiff-java/releases/tag/2.0.5) (10-11-2021) 17 | 18 | * FileDirectory setModelPixelScale and setModelTiepoint methods 19 | 20 | ## [2.0.4](https://github.com/ngageoint/tiff-java/releases/tag/2.0.4) (07-12-2021) 21 | 22 | * Improved error for byte offsets out of range or above max integer 23 | 24 | ## [2.0.3](https://github.com/ngageoint/tiff-java/releases/tag/2.0.3) (06-25-2021) 25 | 26 | * Modifiable IOUtils copy buffer, defaulted at 8k byte chunks 27 | 28 | ## [2.0.2](https://github.com/ngageoint/tiff-java/releases/tag/2.0.2) (07-10-2020) 29 | 30 | * Model pixel scale and model tiepoint retrieval methods 31 | * Sample values byte buffer max capacity allocation check 32 | 33 | ## [2.0.1](https://github.com/ngageoint/tiff-java/releases/tag/2.0.1) (04-01-2019) 34 | 35 | * xResolution and yResolution write fix 36 | * Skip unknown tags while reading 37 | * Allow headers to be read for unsupported compression types 38 | * JPEG field tags 39 | * Eclipse project cleanup 40 | * Dropping "geopackage" from library name 41 | 42 | ## [2.0.0](https://github.com/ngageoint/tiff-java/releases/tag/2.0.0) (11-20-2017) 43 | 44 | * Rasters modified to use buffers in place of arrays 45 | * Deflate compression support 46 | * Additional Rasters constructor options 47 | * Handle missing samples per pixel with default value of 1 48 | * Public access to tiff tags 49 | * String Entry Value getter and setter 50 | * maven-gpg-plugin version 1.6 51 | 52 | ## [1.0.3](https://github.com/ngageoint/tiff-java/releases/tag/1.0.3) (06-27-2017) 53 | 54 | * Handle writing file directory entry ASCII values ending with more than one null 55 | 56 | ## [1.0.2](https://github.com/ngageoint/tiff-java/releases/tag/1.0.2) (06-12-2017) 57 | 58 | * Handle fewer SampleFormat values specified than SamplesPerPixel. Defaults to 1 (unsigned integer data) 59 | 60 | ## [1.0.1](https://github.com/ngageoint/tiff-java/releases/tag/1.0.1) (03-02-2017) 61 | 62 | * LZW Compression modified to handle non contiguous table codes 63 | 64 | ## [1.0.0](https://github.com/ngageoint/tiff-java/releases/tag/1.0.0) (10-04-2016) 65 | 66 | * Initial Release 67 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 National Geospatial-Intelligence Agency 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # TIFF Java 2 | 3 | #### Tagged Image File Format Lib #### 4 | 5 | The TIFF Library was developed at the [National Geospatial-Intelligence Agency (NGA)](http://www.nga.mil/) in collaboration with [BIT Systems](https://www.caci.com/bit-systems/). The government has "unlimited rights" and is releasing this software to increase the impact of government investments by providing developers with the opportunity to take things in new directions. The software use, modification, and distribution rights are stipulated within the [MIT license](http://choosealicense.com/licenses/mit/). 6 | 7 | ### Pull Requests ### 8 | If you'd like to contribute to this project, please make a pull request. We'll review the pull request and discuss the changes. All pull request contributions to this project will be released under the MIT license. 9 | 10 | Software source code previously released under an open source license and then modified by NGA staff is considered a "joint work" (see 17 USC § 101); it is partially copyrighted, partially public domain, and as a whole is protected by the copyrights of the non-government authors and must be released according to the terms of the original open source license. 11 | 12 | ### About ### 13 | 14 | [TIFF](http://ngageoint.github.io/tiff-java/) 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](https://partners.adobe.com/public/developer/en/tiff/TIFF6.pdf) and this JavaScript implementation: https://github.com/constantinius/geotiff.js 15 | 16 | ### Usage ### 17 | 18 | View the latest [Javadoc](http://ngageoint.github.io/tiff-java/docs/api/) 19 | 20 | #### Read #### 21 | 22 | ```java 23 | 24 | //File input = ... 25 | //InputStream input = ... 26 | //byte[] input = ... 27 | //ByteReader input = ... 28 | 29 | TIFFImage tiffImage = TiffReader.readTiff(input); 30 | List directories = tiffImage.getFileDirectories(); 31 | FileDirectory directory = directories.get(0); 32 | Rasters rasters = directory.readRasters(); 33 | 34 | ``` 35 | 36 | #### Write #### 37 | 38 | ```java 39 | 40 | int width = 256; 41 | int height = 256; 42 | int samplesPerPixel = 1; 43 | FieldType fieldType = FieldType.FLOAT; 44 | int bitsPerSample = fieldType.getBits(); 45 | 46 | Rasters rasters = new Rasters(width, height, samplesPerPixel, 47 | fieldType); 48 | 49 | int rowsPerStrip = rasters.calculateRowsPerStrip( 50 | TiffConstants.PLANAR_CONFIGURATION_CHUNKY); 51 | 52 | FileDirectory directory = new FileDirectory(); 53 | directory.setImageWidth(width); 54 | directory.setImageHeight(height); 55 | directory.setBitsPerSample(bitsPerSample); 56 | directory.setCompression(TiffConstants.COMPRESSION_NO); 57 | directory.setPhotometricInterpretation( 58 | TiffConstants.PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO); 59 | directory.setSamplesPerPixel(samplesPerPixel); 60 | directory.setRowsPerStrip(rowsPerStrip); 61 | directory.setPlanarConfiguration( 62 | TiffConstants.PLANAR_CONFIGURATION_CHUNKY); 63 | directory.setSampleFormat(TiffConstants.SAMPLE_FORMAT_FLOAT); 64 | directory.setWriteRasters(rasters); 65 | 66 | for (int y = 0; y < height; y++) { 67 | for (int x = 0; x < width; x++) { 68 | float pixelValue = 1.0f; // any pixel value 69 | rasters.setFirstPixelSample(x, y, pixelValue); 70 | } 71 | } 72 | 73 | TIFFImage tiffImage = new TIFFImage(); 74 | tiffImage.add(directory); 75 | byte[] bytes = TiffWriter.writeTiffToBytes(tiffImage); 76 | // or 77 | // File file = ... 78 | // TiffWriter.writeTiff(file, tiffImage); 79 | 80 | ``` 81 | 82 | ### Installation ### 83 | 84 | Pull from the [Maven Central Repository](http://search.maven.org/#artifactdetails|mil.nga|tiff|3.0.0|jar) (JAR, POM, Source, Javadoc) 85 | 86 | 87 | mil.nga 88 | tiff 89 | 3.0.0 90 | 91 | 92 | ### Build ### 93 | 94 | [![Build & Test](https://github.com/ngageoint/tiff-java/workflows/Build%20&%20Test/badge.svg)](https://github.com/ngageoint/tiff-java/actions/workflows/build-test.yml) 95 | 96 | Build this repository using Eclipse and/or Maven: 97 | 98 | mvn clean install 99 | -------------------------------------------------------------------------------- /docs/docs/api/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Created-By: Maven Javadoc Plugin 3.3.1 3 | Build-Jdk-Spec: 11 4 | 5 | -------------------------------------------------------------------------------- /docs/docs/api/allclasses.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Classes (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 |

All Classes

22 |
23 | 47 |
48 | 49 | 50 | -------------------------------------------------------------------------------- /docs/docs/api/allpackages-index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | All Packages (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

All Packages

98 |
99 |
100 | 129 |
130 |
131 | 178 | 179 | 180 | -------------------------------------------------------------------------------- /docs/docs/api/deprecated-list.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Deprecated List (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Deprecated API

98 |

Contents

99 | 102 |
103 |
104 | 105 | 106 | 123 |
124 |
125 | 172 | 173 | 174 | -------------------------------------------------------------------------------- /docs/docs/api/element-list: -------------------------------------------------------------------------------- 1 | mil.nga.tiff 2 | mil.nga.tiff.compression 3 | mil.nga.tiff.io 4 | mil.nga.tiff.util 5 | -------------------------------------------------------------------------------- /docs/docs/api/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Overview (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |

Tagged Image File Format 3.0.0 API

97 |
98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 |
Packages 
PackageDescription
mil.nga.tiff 
mil.nga.tiff.compression 
mil.nga.tiff.io 
mil.nga.tiff.util 
125 |
126 |
127 | 174 | 175 | 176 | -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_glass_55_fbf9ee_1x400.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_glass_65_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_glass_65_dadada_1x400.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_glass_75_dadada_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_glass_75_dadada_1x400.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_glass_75_e6e6e6_1x400.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_glass_95_fef1ec_1x400.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_glass_95_fef1ec_1x400.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-bg_highlight-soft_75_cccccc_1x100.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-icons_222222_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-icons_222222_256x240.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-icons_2e83ff_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-icons_2e83ff_256x240.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-icons_454545_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-icons_454545_256x240.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-icons_888888_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-icons_888888_256x240.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/images/ui-icons_cd0a0a_256x240.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/jquery/images/ui-icons_cd0a0a_256x240.png -------------------------------------------------------------------------------- /docs/docs/api/jquery/jquery-ui.structure.css: -------------------------------------------------------------------------------- 1 | /*! 2 | * jQuery UI CSS Framework 1.12.1 3 | * http://jqueryui.com 4 | * 5 | * Copyright jQuery Foundation and other contributors 6 | * Released under the MIT license. 7 | * http://jquery.org/license 8 | * 9 | * http://api.jqueryui.com/category/theming/ 10 | */ 11 | /* Layout helpers 12 | ----------------------------------*/ 13 | .ui-helper-hidden { 14 | display: none; 15 | } 16 | .ui-helper-hidden-accessible { 17 | border: 0; 18 | clip: rect(0 0 0 0); 19 | height: 1px; 20 | margin: -1px; 21 | overflow: hidden; 22 | padding: 0; 23 | position: absolute; 24 | width: 1px; 25 | } 26 | .ui-helper-reset { 27 | margin: 0; 28 | padding: 0; 29 | border: 0; 30 | outline: 0; 31 | line-height: 1.3; 32 | text-decoration: none; 33 | font-size: 100%; 34 | list-style: none; 35 | } 36 | .ui-helper-clearfix:before, 37 | .ui-helper-clearfix:after { 38 | content: ""; 39 | display: table; 40 | border-collapse: collapse; 41 | } 42 | .ui-helper-clearfix:after { 43 | clear: both; 44 | } 45 | .ui-helper-zfix { 46 | width: 100%; 47 | height: 100%; 48 | top: 0; 49 | left: 0; 50 | position: absolute; 51 | opacity: 0; 52 | filter:Alpha(Opacity=0); /* support: IE8 */ 53 | } 54 | 55 | .ui-front { 56 | z-index: 100; 57 | } 58 | 59 | 60 | /* Interaction Cues 61 | ----------------------------------*/ 62 | .ui-state-disabled { 63 | cursor: default !important; 64 | pointer-events: none; 65 | } 66 | 67 | 68 | /* Icons 69 | ----------------------------------*/ 70 | .ui-icon { 71 | display: inline-block; 72 | vertical-align: middle; 73 | margin-top: -.25em; 74 | position: relative; 75 | text-indent: -99999px; 76 | overflow: hidden; 77 | background-repeat: no-repeat; 78 | } 79 | 80 | .ui-widget-icon-block { 81 | left: 50%; 82 | margin-left: -8px; 83 | display: block; 84 | } 85 | 86 | /* Misc visuals 87 | ----------------------------------*/ 88 | 89 | /* Overlays */ 90 | .ui-widget-overlay { 91 | position: fixed; 92 | top: 0; 93 | left: 0; 94 | width: 100%; 95 | height: 100%; 96 | } 97 | .ui-autocomplete { 98 | position: absolute; 99 | top: 0; 100 | left: 0; 101 | cursor: default; 102 | } 103 | .ui-menu { 104 | list-style: none; 105 | padding: 0; 106 | margin: 0; 107 | display: block; 108 | outline: 0; 109 | } 110 | .ui-menu .ui-menu { 111 | position: absolute; 112 | } 113 | .ui-menu .ui-menu-item { 114 | margin: 0; 115 | cursor: pointer; 116 | /* support: IE10, see #8844 */ 117 | list-style-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7"); 118 | } 119 | .ui-menu .ui-menu-item-wrapper { 120 | position: relative; 121 | padding: 3px 1em 3px .4em; 122 | } 123 | .ui-menu .ui-menu-divider { 124 | margin: 5px 0; 125 | height: 0; 126 | font-size: 0; 127 | line-height: 0; 128 | border-width: 1px 0 0 0; 129 | } 130 | .ui-menu .ui-state-focus, 131 | .ui-menu .ui-state-active { 132 | margin: -1px; 133 | } 134 | 135 | /* icon support */ 136 | .ui-menu-icons { 137 | position: relative; 138 | } 139 | .ui-menu-icons .ui-menu-item-wrapper { 140 | padding-left: 2em; 141 | } 142 | 143 | /* left-aligned */ 144 | .ui-menu .ui-icon { 145 | position: absolute; 146 | top: 0; 147 | bottom: 0; 148 | left: .2em; 149 | margin: auto 0; 150 | } 151 | 152 | /* right-aligned */ 153 | .ui-menu .ui-menu-icon { 154 | left: auto; 155 | right: 0; 156 | } 157 | -------------------------------------------------------------------------------- /docs/docs/api/jquery/jquery-ui.structure.min.css: -------------------------------------------------------------------------------- 1 | /*! jQuery UI - v1.12.1 - 2018-12-06 2 | * http://jqueryui.com 3 | * Copyright jQuery Foundation and other contributors; Licensed MIT */ 4 | 5 | .ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important;pointer-events:none}.ui-icon{display:inline-block;vertical-align:middle;margin-top:-.25em;position:relative;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-icon-block{left:50%;margin-left:-8px;display:block}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}.ui-autocomplete{position:absolute;top:0;left:0;cursor:default}.ui-menu{list-style:none;padding:0;margin:0;display:block;outline:0}.ui-menu .ui-menu{position:absolute}.ui-menu .ui-menu-item{margin:0;cursor:pointer;list-style-image:url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7")}.ui-menu .ui-menu-item-wrapper{position:relative;padding:3px 1em 3px .4em}.ui-menu .ui-menu-divider{margin:5px 0;height:0;font-size:0;line-height:0;border-width:1px 0 0 0}.ui-menu .ui-state-focus,.ui-menu .ui-state-active{margin:-1px}.ui-menu-icons{position:relative}.ui-menu-icons .ui-menu-item-wrapper{padding-left:2em}.ui-menu .ui-icon{position:absolute;top:0;bottom:0;left:.2em;margin:auto 0}.ui-menu .ui-menu-icon{left:auto;right:0} -------------------------------------------------------------------------------- /docs/docs/api/jquery/jszip-utils/dist/jszip-utils-ie.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | ;(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o\r\n"+ 18 | "\r\n"; 32 | 33 | // inject VBScript 34 | document.write(IEBinaryToArray_ByteStr_Script); 35 | 36 | global.JSZipUtils._getBinaryFromXHR = function (xhr) { 37 | var binary = xhr.responseBody; 38 | var byteMapping = {}; 39 | for ( var i = 0; i < 256; i++ ) { 40 | for ( var j = 0; j < 256; j++ ) { 41 | byteMapping[ String.fromCharCode( i + (j << 8) ) ] = 42 | String.fromCharCode(i) + String.fromCharCode(j); 43 | } 44 | } 45 | var rawBytes = IEBinaryToArray_ByteStr(binary); 46 | var lastChr = IEBinaryToArray_ByteStr_Last(binary); 47 | return rawBytes.replace(/[\s\S]/g, function( match ) { 48 | return byteMapping[match]; 49 | }) + lastChr; 50 | }; 51 | 52 | // enforcing Stuk's coding style 53 | // vim: set shiftwidth=4 softtabstop=4: 54 | 55 | },{}]},{},[1]) 56 | ; 57 | -------------------------------------------------------------------------------- /docs/docs/api/jquery/jszip-utils/dist/jszip-utils-ie.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g\r\n";document.write(b),a.JSZipUtils._getBinaryFromXHR=function(a){for(var b=a.responseBody,c={},d=0;256>d;d++)for(var e=0;256>e;e++)c[String.fromCharCode(d+(e<<8))]=String.fromCharCode(d)+String.fromCharCode(e);var f=IEBinaryToArray_ByteStr(b),g=IEBinaryToArray_ByteStr_Last(b);return f.replace(/[\s\S]/g,function(a){return c[a]})+g}},{}]},{},[1]); 11 | -------------------------------------------------------------------------------- /docs/docs/api/jquery/jszip-utils/dist/jszip-utils.js: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | JSZipUtils - A collection of cross-browser utilities to go along with JSZip. 4 | 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(e){"object"==typeof exports?module.exports=e():"function"==typeof define&&define.amd?define(e):"undefined"!=typeof window?window.JSZipUtils=e():"undefined"!=typeof global?global.JSZipUtils=e():"undefined"!=typeof self&&(self.JSZipUtils=e())}(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);throw new Error("Cannot find module '"+o+"'")}var f=n[o]={exports:{}};t[o][0].call(f.exports,function(e){var n=t[o][1][e];return s(n?n:e)},f,f.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o 5 | 6 | (c) 2014 Stuart Knightley, David Duponchel 7 | Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip-utils/master/LICENSE.markdown. 8 | 9 | */ 10 | !function(a){"object"==typeof exports?module.exports=a():"function"==typeof define&&define.amd?define(a):"undefined"!=typeof window?window.JSZipUtils=a():"undefined"!=typeof global?global.JSZipUtils=a():"undefined"!=typeof self&&(self.JSZipUtils=a())}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.TiffReader (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.TiffReader

98 |
99 |
No usage of mil.nga.tiff.TiffReader
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/class-use/TiffWriter.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.TiffWriter (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.TiffWriter

98 |
99 |
No usage of mil.nga.tiff.TiffWriter
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/DeflateCompression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.DeflateCompression (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.DeflateCompression

98 |
99 |
No usage of mil.nga.tiff.compression.DeflateCompression
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/LZWCompression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.LZWCompression (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.LZWCompression

98 |
99 |
No usage of mil.nga.tiff.compression.LZWCompression
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/PackbitsCompression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.PackbitsCompression (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.PackbitsCompression

98 |
99 |
No usage of mil.nga.tiff.compression.PackbitsCompression
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/Predictor.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.Predictor (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.Predictor

98 |
99 |
No usage of mil.nga.tiff.compression.Predictor
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/RawCompression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.RawCompression (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.RawCompression

98 |
99 |
No usage of mil.nga.tiff.compression.RawCompression
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/compression/class-use/UnsupportedCompression.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.compression.UnsupportedCompression (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.compression.UnsupportedCompression

98 |
99 |
No usage of mil.nga.tiff.compression.UnsupportedCompression
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/io/class-use/IOUtils.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.io.IOUtils (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.io.IOUtils

98 |
99 |
No usage of mil.nga.tiff.io.IOUtils
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/io/package-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | mil.nga.tiff.io (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Package mil.nga.tiff.io

98 |
99 |
100 |
    101 |
  • 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 114 | 115 | 116 | 117 | 120 | 121 | 122 | 123 | 126 | 127 | 128 |
    Class Summary 
    ClassDescription
    ByteReader 112 |
    Read through a byte array
    113 |
    ByteWriter 118 |
    Write a byte array
    119 |
    IOUtils 124 |
    Input / Output utility methods
    125 |
    129 |
  • 130 |
131 |
132 |
133 | 180 | 181 | 182 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/io/package-tree.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | mil.nga.tiff.io Class Hierarchy (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Hierarchy For Package mil.nga.tiff.io

98 | Package Hierarchies: 99 | 102 |
103 |
104 |
105 |

Class Hierarchy

106 | 115 |
116 |
117 |
118 | 165 | 166 | 167 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/util/class-use/TiffConstants.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.util.TiffConstants (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.util.TiffConstants

98 |
99 |
No usage of mil.nga.tiff.util.TiffConstants
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/util/class-use/TiffException.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Class mil.nga.tiff.util.TiffException (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Class
mil.nga.tiff.util.TiffException

98 |
99 |
No usage of mil.nga.tiff.util.TiffException
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/mil/nga/tiff/util/package-use.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Uses of Package mil.nga.tiff.util (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Uses of Package
mil.nga.tiff.util

98 |
99 |
No usage of mil.nga.tiff.util
100 |
101 | 148 | 149 | 150 | -------------------------------------------------------------------------------- /docs/docs/api/overview-summary.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Tagged Image File Format 3.0.0 API 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 |
17 | 20 |

index.html

21 |
22 | 23 | 24 | -------------------------------------------------------------------------------- /docs/docs/api/package-search-index.js: -------------------------------------------------------------------------------- 1 | packageSearchIndex = [{"l":"All Packages","url":"allpackages-index.html"},{"l":"mil.nga.tiff"},{"l":"mil.nga.tiff.compression"},{"l":"mil.nga.tiff.io"},{"l":"mil.nga.tiff.util"}] -------------------------------------------------------------------------------- /docs/docs/api/package-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/package-search-index.zip -------------------------------------------------------------------------------- /docs/docs/api/resources/glass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/resources/glass.png -------------------------------------------------------------------------------- /docs/docs/api/resources/x.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/resources/x.png -------------------------------------------------------------------------------- /docs/docs/api/script.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. 3 | * ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms. 4 | * 5 | * 6 | * 7 | * 8 | * 9 | * 10 | * 11 | * 12 | * 13 | * 14 | * 15 | * 16 | * 17 | * 18 | * 19 | * 20 | * 21 | * 22 | * 23 | * 24 | */ 25 | 26 | var moduleSearchIndex; 27 | var packageSearchIndex; 28 | var typeSearchIndex; 29 | var memberSearchIndex; 30 | var tagSearchIndex; 31 | function loadScripts(doc, tag) { 32 | createElem(doc, tag, 'jquery/jszip/dist/jszip.js'); 33 | createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils.js'); 34 | if (window.navigator.userAgent.indexOf('MSIE ') > 0 || window.navigator.userAgent.indexOf('Trident/') > 0 || 35 | window.navigator.userAgent.indexOf('Edge/') > 0) { 36 | createElem(doc, tag, 'jquery/jszip-utils/dist/jszip-utils-ie.js'); 37 | } 38 | createElem(doc, tag, 'search.js'); 39 | 40 | $.get(pathtoroot + "module-search-index.zip") 41 | .done(function() { 42 | JSZipUtils.getBinaryContent(pathtoroot + "module-search-index.zip", function(e, data) { 43 | JSZip.loadAsync(data).then(function(zip){ 44 | zip.file("module-search-index.json").async("text").then(function(content){ 45 | moduleSearchIndex = JSON.parse(content); 46 | }); 47 | }); 48 | }); 49 | }); 50 | $.get(pathtoroot + "package-search-index.zip") 51 | .done(function() { 52 | JSZipUtils.getBinaryContent(pathtoroot + "package-search-index.zip", function(e, data) { 53 | JSZip.loadAsync(data).then(function(zip){ 54 | zip.file("package-search-index.json").async("text").then(function(content){ 55 | packageSearchIndex = JSON.parse(content); 56 | }); 57 | }); 58 | }); 59 | }); 60 | $.get(pathtoroot + "type-search-index.zip") 61 | .done(function() { 62 | JSZipUtils.getBinaryContent(pathtoroot + "type-search-index.zip", function(e, data) { 63 | JSZip.loadAsync(data).then(function(zip){ 64 | zip.file("type-search-index.json").async("text").then(function(content){ 65 | typeSearchIndex = JSON.parse(content); 66 | }); 67 | }); 68 | }); 69 | }); 70 | $.get(pathtoroot + "member-search-index.zip") 71 | .done(function() { 72 | JSZipUtils.getBinaryContent(pathtoroot + "member-search-index.zip", function(e, data) { 73 | JSZip.loadAsync(data).then(function(zip){ 74 | zip.file("member-search-index.json").async("text").then(function(content){ 75 | memberSearchIndex = JSON.parse(content); 76 | }); 77 | }); 78 | }); 79 | }); 80 | $.get(pathtoroot + "tag-search-index.zip") 81 | .done(function() { 82 | JSZipUtils.getBinaryContent(pathtoroot + "tag-search-index.zip", function(e, data) { 83 | JSZip.loadAsync(data).then(function(zip){ 84 | zip.file("tag-search-index.json").async("text").then(function(content){ 85 | tagSearchIndex = JSON.parse(content); 86 | }); 87 | }); 88 | }); 89 | }); 90 | if (!moduleSearchIndex) { 91 | createElem(doc, tag, 'module-search-index.js'); 92 | } 93 | if (!packageSearchIndex) { 94 | createElem(doc, tag, 'package-search-index.js'); 95 | } 96 | if (!typeSearchIndex) { 97 | createElem(doc, tag, 'type-search-index.js'); 98 | } 99 | if (!memberSearchIndex) { 100 | createElem(doc, tag, 'member-search-index.js'); 101 | } 102 | if (!tagSearchIndex) { 103 | createElem(doc, tag, 'tag-search-index.js'); 104 | } 105 | $(window).resize(function() { 106 | $('.navPadding').css('padding-top', $('.fixedNav').css("height")); 107 | }); 108 | } 109 | 110 | function createElem(doc, tag, path) { 111 | var script = doc.createElement(tag); 112 | var scriptElement = doc.getElementsByTagName(tag)[0]; 113 | script.src = pathtoroot + path; 114 | scriptElement.parentNode.insertBefore(script, scriptElement); 115 | } 116 | 117 | function show(type) { 118 | count = 0; 119 | for (var key in data) { 120 | var row = document.getElementById(key); 121 | if ((data[key] & type) !== 0) { 122 | row.style.display = ''; 123 | row.className = (count++ % 2) ? rowColor : altColor; 124 | } 125 | else 126 | row.style.display = 'none'; 127 | } 128 | updateTabs(type); 129 | } 130 | 131 | function updateTabs(type) { 132 | for (var value in tabs) { 133 | var sNode = document.getElementById(tabs[value][0]); 134 | var spanNode = sNode.firstChild; 135 | if (value == type) { 136 | sNode.className = activeTableTab; 137 | spanNode.innerHTML = tabs[value][1]; 138 | } 139 | else { 140 | sNode.className = tableTab; 141 | spanNode.innerHTML = "" + tabs[value][1] + ""; 142 | } 143 | } 144 | } 145 | 146 | function updateModuleFrame(pFrame, cFrame) { 147 | top.packageFrame.location = pFrame; 148 | top.classFrame.location = cFrame; 149 | } 150 | -------------------------------------------------------------------------------- /docs/docs/api/serialized-form.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Serialized Form (Tagged Image File Format 3.0.0 API) 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 17 | 18 | 19 | 20 | 21 | 33 | 36 |
37 | 94 |
95 |
96 |
97 |

Serialized Form

98 |
99 |
100 | 118 |
119 |
120 | 167 | 168 | 169 | -------------------------------------------------------------------------------- /docs/docs/api/type-search-index.js: -------------------------------------------------------------------------------- 1 | typeSearchIndex = [{"l":"All Classes","url":"allclasses-index.html"},{"p":"mil.nga.tiff.io","l":"ByteReader"},{"p":"mil.nga.tiff.io","l":"ByteWriter"},{"p":"mil.nga.tiff.compression","l":"CompressionDecoder"},{"p":"mil.nga.tiff.compression","l":"CompressionEncoder"},{"p":"mil.nga.tiff.compression","l":"DeflateCompression"},{"p":"mil.nga.tiff","l":"FieldTagType"},{"p":"mil.nga.tiff","l":"FieldType"},{"p":"mil.nga.tiff","l":"FileDirectory"},{"p":"mil.nga.tiff","l":"FileDirectoryEntry"},{"p":"mil.nga.tiff","l":"ImageWindow"},{"p":"mil.nga.tiff.io","l":"IOUtils"},{"p":"mil.nga.tiff.compression","l":"LZWCompression"},{"p":"mil.nga.tiff.compression","l":"PackbitsCompression"},{"p":"mil.nga.tiff.compression","l":"Predictor"},{"p":"mil.nga.tiff","l":"Rasters"},{"p":"mil.nga.tiff.compression","l":"RawCompression"},{"p":"mil.nga.tiff.util","l":"TiffConstants"},{"p":"mil.nga.tiff.util","l":"TiffException"},{"p":"mil.nga.tiff","l":"TIFFImage"},{"p":"mil.nga.tiff","l":"TiffReader"},{"p":"mil.nga.tiff","l":"TiffWriter"},{"p":"mil.nga.tiff.compression","l":"UnsupportedCompression"}] -------------------------------------------------------------------------------- /docs/docs/api/type-search-index.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/docs/docs/api/type-search-index.zip -------------------------------------------------------------------------------- /docs/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | TIFF Java 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 22 | 23 |
24 | 25 |

The TIFF Java library was developed by the National Geospatial-Intelligence Agency (NGA) in collaboration with BIT Systems. 26 | 27 |

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.

28 | 29 | 39 | 40 |
41 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /docs/stylesheets/github-light.css: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright 2014 GitHub Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | */ 17 | 18 | .pl-c /* comment */ { 19 | color: #969896; 20 | } 21 | 22 | .pl-c1 /* constant, markup.raw, meta.diff.header, meta.module-reference, meta.property-name, support, support.constant, support.variable, variable.other.constant */, 23 | .pl-s .pl-v /* string variable */ { 24 | color: #0086b3; 25 | } 26 | 27 | .pl-e /* entity */, 28 | .pl-en /* entity.name */ { 29 | color: #795da3; 30 | } 31 | 32 | .pl-s .pl-s1 /* string source */, 33 | .pl-smi /* storage.modifier.import, storage.modifier.package, storage.type.java, variable.other, variable.parameter.function */ { 34 | color: #333; 35 | } 36 | 37 | .pl-ent /* entity.name.tag */ { 38 | color: #63a35c; 39 | } 40 | 41 | .pl-k /* keyword, storage, storage.type */ { 42 | color: #a71d5d; 43 | } 44 | 45 | .pl-pds /* punctuation.definition.string, string.regexp.character-class */, 46 | .pl-s /* string */, 47 | .pl-s .pl-pse .pl-s1 /* string punctuation.section.embedded source */, 48 | .pl-sr /* string.regexp */, 49 | .pl-sr .pl-cce /* string.regexp constant.character.escape */, 50 | .pl-sr .pl-sra /* string.regexp string.regexp.arbitrary-repitition */, 51 | .pl-sr .pl-sre /* string.regexp source.ruby.embedded */ { 52 | color: #183691; 53 | } 54 | 55 | .pl-v /* variable */ { 56 | color: #ed6a43; 57 | } 58 | 59 | .pl-id /* invalid.deprecated */ { 60 | color: #b52a1d; 61 | } 62 | 63 | .pl-ii /* invalid.illegal */ { 64 | background-color: #b52a1d; 65 | color: #f8f8f8; 66 | } 67 | 68 | .pl-sr .pl-cce /* string.regexp constant.character.escape */ { 69 | color: #63a35c; 70 | font-weight: bold; 71 | } 72 | 73 | .pl-ml /* markup.list */ { 74 | color: #693a17; 75 | } 76 | 77 | .pl-mh /* markup.heading */, 78 | .pl-mh .pl-en /* markup.heading entity.name */, 79 | .pl-ms /* meta.separator */ { 80 | color: #1d3e81; 81 | font-weight: bold; 82 | } 83 | 84 | .pl-mq /* markup.quote */ { 85 | color: #008080; 86 | } 87 | 88 | .pl-mi /* markup.italic */ { 89 | color: #333; 90 | font-style: italic; 91 | } 92 | 93 | .pl-mb /* markup.bold */ { 94 | color: #333; 95 | font-weight: bold; 96 | } 97 | 98 | .pl-md /* markup.deleted, meta.diff.header.from-file */ { 99 | background-color: #ffecec; 100 | color: #bd2c00; 101 | } 102 | 103 | .pl-mi1 /* markup.inserted, meta.diff.header.to-file */ { 104 | background-color: #eaffea; 105 | color: #55a532; 106 | } 107 | 108 | .pl-mdr /* meta.diff.range */ { 109 | color: #795da3; 110 | font-weight: bold; 111 | } 112 | 113 | .pl-mo /* meta.output */ { 114 | color: #1d3e81; 115 | } 116 | 117 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | mil.nga 5 | tiff 6 | 3.0.1 7 | jar 8 | Tagged Image File Format 9 | https://github.com/ngageoint/tiff-java 10 | Library for reading and writing TIFF (Tagged Image File Format) files 11 | 12 | git@github.com:ngageoint/tiff-java.git 13 | scm:git:git@github.com:ngageoint/tiff-java.git 14 | scm:git:git@github.com:ngageoint/tiff-java.git 15 | 16 | 17 | 18 | The MIT License (MIT) 19 | https://github.com/ngageoint/tiff-java/blob/master/LICENSE.txt 20 | repo 21 | 22 | 23 | 24 | National Geospatial-Intelligence Agency 25 | https://www.nga.mil/ 26 | 27 | 28 | 29 | bosborn 30 | Brian Osborn 31 | bosborn@caci.com 32 | BIT Systems 33 | https://www.caci.com/bit-systems 34 | 35 | developer 36 | 37 | UTC−07 38 | 39 | 40 | 41 | 11 42 | 11 43 | UTF-8 44 | 45 | 46 | 47 | junit 48 | junit 49 | 4.13.2 50 | test 51 | 52 | 53 | 54 | 55 | 56 | 57 | org.apache.maven.plugins 58 | maven-source-plugin 59 | 3.3.0 60 | 61 | 62 | attach-sources 63 | 64 | jar-no-fork 65 | 66 | 67 | 68 | 69 | 70 | org.apache.maven.plugins 71 | maven-javadoc-plugin 72 | 3.6.3 73 | 74 | 75 | attach-javadocs 76 | 77 | jar 78 | 79 | 80 | -Xdoclint:none 81 | 82 | 83 | 84 | 85 | 86 | org.apache.maven.plugins 87 | maven-gpg-plugin 88 | 3.2.2 89 | 90 | 91 | sign-artifacts 92 | deploy 93 | 94 | sign 95 | 96 | 97 | 98 | 99 | 100 | org.sonatype.plugins 101 | nexus-staging-maven-plugin 102 | 1.6.13 103 | true 104 | 105 | ossrh 106 | https://oss.sonatype.org/ 107 | true 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | ossrh 116 | https://oss.sonatype.org/content/repositories/snapshots 117 | 118 | 119 | ossrh 120 | https://oss.sonatype.org/service/local/staging/deploy/maven2/ 121 | 122 | 123 | 124 | 125 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/FieldTagType.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * Field Tag Types 8 | * 9 | * @author osbornb 10 | */ 11 | public enum FieldTagType { 12 | 13 | Artist(315, false), 14 | 15 | BitsPerSample(258, true), 16 | 17 | CellLength(265, false), 18 | 19 | CellWidth(264, false), 20 | 21 | ColorMap(320, false), 22 | 23 | Compression(259, false), 24 | 25 | Copyright(33432, false), 26 | 27 | DateTime(306, false), 28 | 29 | ExtraSamples(338, true), 30 | 31 | FillOrder(266, false), 32 | 33 | FreeByteCounts(289, false), 34 | 35 | FreeOffsets(288, false), 36 | 37 | GrayResponseCurve(291, false), 38 | 39 | GrayResponseUnit(290, false), 40 | 41 | HostComputer(316, false), 42 | 43 | ImageDescription(270, false), 44 | 45 | ImageLength(257, false), 46 | 47 | ImageWidth(256, false), 48 | 49 | Make(271, false), 50 | 51 | MaxSampleValue(281, false), 52 | 53 | MinSampleValue(280, false), 54 | 55 | Model(272, false), 56 | 57 | NewSubfileType(254, false), 58 | 59 | Orientation(274, false), 60 | 61 | PhotometricInterpretation(262, false), 62 | 63 | PlanarConfiguration(284, false), 64 | 65 | ResolutionUnit(296, false), 66 | 67 | RowsPerStrip(278, false), 68 | 69 | SamplesPerPixel(277, false), 70 | 71 | Software(305, false), 72 | 73 | StripByteCounts(279, true), 74 | 75 | StripOffsets(273, true), 76 | 77 | SubfileType(255, false), 78 | 79 | Threshholding(263, false), 80 | 81 | XResolution(282, false), 82 | 83 | YResolution(283, false), 84 | 85 | // TIFF Extended 86 | 87 | BadFaxLines(326, false), 88 | 89 | CleanFaxData(327, false), 90 | 91 | ClipPath(343, false), 92 | 93 | ConsecutiveBadFaxLines(328, false), 94 | 95 | Decode(433, false), 96 | 97 | DefaultImageColor(434, false), 98 | 99 | DocumentName(269, false), 100 | 101 | DotRange(336, false), 102 | 103 | HalftoneHints(321, false), 104 | 105 | Indexed(346, false), 106 | 107 | JPEGTables(347, false), 108 | 109 | PageName(285, false), 110 | 111 | PageNumber(297, false), 112 | 113 | Predictor(317, false), 114 | 115 | PrimaryChromaticities(319, false), 116 | 117 | ReferenceBlackWhite(532, false), 118 | 119 | SampleFormat(339, true), 120 | 121 | SMinSampleValue(340, false), 122 | 123 | SMaxSampleValue(341, false), 124 | 125 | StripRowCounts(559, true), 126 | 127 | SubIFDs(330, false), 128 | 129 | T4Options(292, false), 130 | 131 | T6Options(293, false), 132 | 133 | TileByteCounts(325, true), 134 | 135 | TileLength(323, false), 136 | 137 | TileOffsets(324, true), 138 | 139 | TileWidth(322, false), 140 | 141 | TransferFunction(301, false), 142 | 143 | WhitePoint(318, false), 144 | 145 | XClipPathUnits(344, false), 146 | 147 | XPosition(286, false), 148 | 149 | YCbCrCoefficients(529, false), 150 | 151 | YCbCrPositioning(531, false), 152 | 153 | YCbCrSubSampling(530, false), 154 | 155 | YClipPathUnits(345, false), 156 | 157 | YPosition(287, false), 158 | 159 | // JPEG 160 | 161 | JPEGProc(512, false), 162 | 163 | JPEGInterchangeFormat(513, false), 164 | 165 | JPEGInterchangeFormatLength(514, false), 166 | 167 | JPEGRestartInterval(515, false), 168 | 169 | JPEGLosslessPredictors(517, true), 170 | 171 | JPEGPointTransforms(518, true), 172 | 173 | JPEGQTables(519, true), 174 | 175 | JPEGDCTables(520, true), 176 | 177 | JPEGACTables(521, true), 178 | 179 | // EXIF 180 | 181 | ApertureValue(37378, false), 182 | 183 | ColorSpace(40961, false), 184 | 185 | DateTimeDigitized(36868, false), 186 | 187 | DateTimeOriginal(36867, false), 188 | 189 | ExifIFD(34665, false), 190 | 191 | ExifVersion(36864, false), 192 | 193 | ExposureTime(33434, false), 194 | 195 | FileSource(41728, false), 196 | 197 | Flash(37385, false), 198 | 199 | FlashpixVersion(40960, false), 200 | 201 | FNumber(33437, false), 202 | 203 | ImageUniqueID(42016, false), 204 | 205 | LightSource(37384, false), 206 | 207 | MakerNote(37500, false), 208 | 209 | ShutterSpeedValue(37377, false), 210 | 211 | UserComment(37510, false), 212 | 213 | // IPTC 214 | 215 | IPTC(33723, false), 216 | 217 | // ICC 218 | 219 | ICCProfile(34675, false), 220 | 221 | // XMP 222 | 223 | XMP(700, false), 224 | 225 | // GDAL 226 | 227 | GDAL_METADATA(42112, false), 228 | 229 | GDAL_NODATA(42113, false), 230 | 231 | // Photoshop 232 | 233 | Photoshop(34377, false), 234 | 235 | // GeoTiff 236 | 237 | ModelPixelScale(33550, false), 238 | 239 | ModelTiepoint(33922, false), 240 | 241 | ModelTransformation(34264, false), 242 | 243 | GeoKeyDirectory(34735, false), 244 | 245 | GeoDoubleParams(34736, false), 246 | 247 | GeoAsciiParams(34737, false); 248 | 249 | /** 250 | * Tag id 251 | */ 252 | private final int id; 253 | 254 | /** 255 | * True if an array type 256 | */ 257 | private final boolean array; 258 | 259 | /** 260 | * Constructor 261 | * 262 | * @param id 263 | * tag id 264 | * @param array 265 | * true if an array type 266 | */ 267 | private FieldTagType(int id, boolean array) { 268 | this.id = id; 269 | this.array = array; 270 | } 271 | 272 | /** 273 | * Is this field an array type 274 | * 275 | * @return true if array type 276 | */ 277 | public boolean isArray() { 278 | return array; 279 | } 280 | 281 | /** 282 | * Get the tag id 283 | * 284 | * @return tag id 285 | */ 286 | public int getId() { 287 | return id; 288 | } 289 | 290 | /** 291 | * Mapping between ids and field tag types 292 | */ 293 | private static final Map idMapping = new HashMap<>(); 294 | 295 | /** 296 | * Load the id mapping 297 | */ 298 | static { 299 | for (FieldTagType fieldTag : FieldTagType.values()) { 300 | idMapping.put(fieldTag.getId(), fieldTag); 301 | } 302 | } 303 | 304 | /** 305 | * Get a field tag type by id 306 | * 307 | * @param id 308 | * tag id 309 | * @return field tag type 310 | */ 311 | public static FieldTagType getById(int id) { 312 | FieldTagType fieldTag = idMapping.get(id); 313 | return fieldTag; 314 | } 315 | 316 | } 317 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/FieldType.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import mil.nga.tiff.util.TiffConstants; 4 | import mil.nga.tiff.util.TiffException; 5 | 6 | /** 7 | * Field Types 8 | * 9 | * @author osbornb 10 | */ 11 | public enum FieldType { 12 | 13 | /** 14 | * 8-bit unsigned integer 15 | */ 16 | BYTE(1), 17 | 18 | /** 19 | * 8-bit byte that contains a 7-bit ASCII code; the last byte must be NUL 20 | * (binary zero) 21 | */ 22 | ASCII(1), 23 | 24 | /** 25 | * 16-bit (2-byte) unsigned integer 26 | */ 27 | SHORT(2), 28 | 29 | /** 30 | * 32-bit (4-byte) unsigned integer 31 | */ 32 | LONG(4), 33 | 34 | /** 35 | * Two LONGs: the first represents the numerator of a fraction; the second, 36 | * the denominator 37 | */ 38 | RATIONAL(8), 39 | 40 | /** 41 | * An 8-bit signed (twos-complement) integer 42 | */ 43 | SBYTE(1), 44 | 45 | /** 46 | * An 8-bit byte that may contain anything, depending on the definition of 47 | * the field 48 | */ 49 | UNDEFINED(1), 50 | 51 | /** 52 | * A 16-bit (2-byte) signed (twos-complement) integer 53 | */ 54 | SSHORT(2), 55 | 56 | /** 57 | * A 32-bit (4-byte) signed (twos-complement) integer 58 | */ 59 | SLONG(4), 60 | 61 | /** 62 | * Two SLONG’s: the first represents the numerator of a fraction, the second 63 | * the denominator 64 | */ 65 | SRATIONAL(8), 66 | 67 | /** 68 | * Single precision (4-byte) IEEE format 69 | */ 70 | FLOAT(4), 71 | 72 | /** 73 | * Double precision (8-byte) IEEE format 74 | */ 75 | DOUBLE(8); 76 | 77 | /** 78 | * Number of bytes per field value 79 | */ 80 | private final int bytes; 81 | 82 | /** 83 | * Constructor 84 | * 85 | * @param bytes 86 | * bytes per value 87 | */ 88 | private FieldType(int bytes) { 89 | this.bytes = bytes; 90 | } 91 | 92 | /** 93 | * Get the field type value 94 | * 95 | * @return field type value 96 | */ 97 | public int getValue() { 98 | return ordinal() + 1; 99 | } 100 | 101 | /** 102 | * Get the number of bytes per value 103 | * 104 | * @return number of bytes 105 | */ 106 | public int getBytes() { 107 | return bytes; 108 | } 109 | 110 | /** 111 | * Get the number of bits per value 112 | * 113 | * @return number of bits 114 | * @since 2.0.0 115 | */ 116 | public int getBits() { 117 | return bytes * 8; 118 | } 119 | 120 | /** 121 | * Get the field type 122 | * 123 | * @param fieldType 124 | * field type number 125 | * @return field type 126 | */ 127 | public static FieldType getFieldType(int fieldType) { 128 | return FieldType.values()[fieldType - 1]; 129 | } 130 | 131 | /** 132 | * Get the field type of the sample format and bits per sample 133 | * 134 | * @param sampleFormat 135 | * sample format 136 | * @param bitsPerSample 137 | * bits per sample 138 | * @return field type 139 | * @since 2.0.0 140 | */ 141 | public static FieldType getFieldType(int sampleFormat, int bitsPerSample) { 142 | 143 | FieldType fieldType = null; 144 | 145 | switch (sampleFormat) { 146 | case TiffConstants.SAMPLE_FORMAT_UNSIGNED_INT: 147 | switch (bitsPerSample) { 148 | case 8: 149 | fieldType = FieldType.BYTE; 150 | break; 151 | case 16: 152 | fieldType = FieldType.SHORT; 153 | break; 154 | case 32: 155 | fieldType = FieldType.LONG; 156 | break; 157 | } 158 | break; 159 | case TiffConstants.SAMPLE_FORMAT_SIGNED_INT: 160 | switch (bitsPerSample) { 161 | case 8: 162 | fieldType = FieldType.SBYTE; 163 | break; 164 | case 16: 165 | fieldType = FieldType.SSHORT; 166 | break; 167 | case 32: 168 | fieldType = FieldType.SLONG; 169 | break; 170 | } 171 | break; 172 | case TiffConstants.SAMPLE_FORMAT_FLOAT: 173 | switch (bitsPerSample) { 174 | case 32: 175 | fieldType = FieldType.FLOAT; 176 | break; 177 | case 64: 178 | fieldType = FieldType.DOUBLE; 179 | break; 180 | } 181 | break; 182 | } 183 | 184 | if (fieldType == null) { 185 | throw new TiffException( 186 | "Unsupported field type for sample format: " + sampleFormat 187 | + ", bits per sample: " + bitsPerSample); 188 | } 189 | 190 | return fieldType; 191 | } 192 | 193 | /** 194 | * Get the sample format of the field type 195 | * 196 | * @param fieldType 197 | * field type 198 | * @return sample format 199 | * @since 2.0.0 200 | */ 201 | public static int getSampleFormat(FieldType fieldType) { 202 | 203 | int sampleFormat; 204 | 205 | switch (fieldType) { 206 | case BYTE: 207 | case SHORT: 208 | case LONG: 209 | sampleFormat = TiffConstants.SAMPLE_FORMAT_UNSIGNED_INT; 210 | break; 211 | case SBYTE: 212 | case SSHORT: 213 | case SLONG: 214 | sampleFormat = TiffConstants.SAMPLE_FORMAT_SIGNED_INT; 215 | break; 216 | case FLOAT: 217 | case DOUBLE: 218 | sampleFormat = TiffConstants.SAMPLE_FORMAT_FLOAT; 219 | break; 220 | default: 221 | throw new TiffException( 222 | "Unsupported sample format for field type: " + fieldType); 223 | } 224 | 225 | return sampleFormat; 226 | } 227 | 228 | } 229 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/FileDirectoryEntry.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import mil.nga.tiff.util.TiffConstants; 4 | 5 | /** 6 | * TIFF File Directory Entry 7 | * 8 | * @author osbornb 9 | */ 10 | public class FileDirectoryEntry implements Comparable { 11 | 12 | /** 13 | * Field Tag Type 14 | */ 15 | private final FieldTagType fieldTag; 16 | 17 | /** 18 | * Field Type 19 | */ 20 | private final FieldType fieldType; 21 | 22 | /** 23 | * Type Count 24 | */ 25 | private final long typeCount; 26 | 27 | /** 28 | * Values 29 | */ 30 | private final Object values; 31 | 32 | /** 33 | * Constructor 34 | * 35 | * @param fieldTag 36 | * field tag type 37 | * @param fieldType 38 | * field type 39 | * @param typeCount 40 | * type count 41 | * @param values 42 | * values 43 | */ 44 | public FileDirectoryEntry(FieldTagType fieldTag, FieldType fieldType, 45 | long typeCount, Object values) { 46 | this.fieldTag = fieldTag; 47 | this.fieldType = fieldType; 48 | this.typeCount = typeCount; 49 | this.values = values; 50 | } 51 | 52 | /** 53 | * Get the field tag type 54 | * 55 | * @return field tag type 56 | */ 57 | public FieldTagType getFieldTag() { 58 | return fieldTag; 59 | } 60 | 61 | /** 62 | * Get the field type 63 | * 64 | * @return field type 65 | */ 66 | public FieldType getFieldType() { 67 | return fieldType; 68 | } 69 | 70 | /** 71 | * Get the type count 72 | * 73 | * @return type count 74 | */ 75 | public long getTypeCount() { 76 | return typeCount; 77 | } 78 | 79 | /** 80 | * Get the values 81 | * 82 | * @return values 83 | */ 84 | public Object getValues() { 85 | return values; 86 | } 87 | 88 | /** 89 | * Size in bytes of the image file directory entry and its values (not 90 | * contiguous bytes) 91 | * 92 | * @return size in bytes 93 | */ 94 | public long sizeWithValues() { 95 | long size = TiffConstants.IFD_ENTRY_BYTES + sizeOfValues(); 96 | return size; 97 | } 98 | 99 | /** 100 | * Size of the values not included in the directory entry bytes 101 | * 102 | * @return size in bytes 103 | */ 104 | public long sizeOfValues() { 105 | long size = 0; 106 | long valueBytes = fieldType.getBytes() * typeCount; 107 | if (valueBytes > 4) { 108 | size = valueBytes; 109 | } 110 | return size; 111 | } 112 | 113 | /** 114 | * {@inheritDoc} 115 | */ 116 | @Override 117 | public int compareTo(FileDirectoryEntry other) { 118 | return fieldTag.getId() - other.getFieldTag().getId(); 119 | } 120 | 121 | /** 122 | * {@inheritDoc} 123 | */ 124 | @Override 125 | public int hashCode() { 126 | return fieldTag.getId(); 127 | } 128 | 129 | /** 130 | * {@inheritDoc} 131 | */ 132 | @Override 133 | public boolean equals(Object obj) { 134 | if (this == obj) 135 | return true; 136 | if (obj == null) 137 | return false; 138 | if (getClass() != obj.getClass()) 139 | return false; 140 | FileDirectoryEntry other = (FileDirectoryEntry) obj; 141 | if (fieldTag != other.fieldTag) 142 | return false; 143 | return true; 144 | } 145 | 146 | } 147 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/ImageWindow.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | /** 4 | * Coordinates of a window over a portion or the entire image coordinates 5 | * 6 | * @author osbornb 7 | */ 8 | public class ImageWindow { 9 | 10 | /** 11 | * Min x 12 | */ 13 | private int minX; 14 | 15 | /** 16 | * Min y 17 | */ 18 | private int minY; 19 | 20 | /** 21 | * Max x 22 | */ 23 | private int maxX; 24 | 25 | /** 26 | * Max y 27 | */ 28 | private int maxY; 29 | 30 | /** 31 | * Constructor 32 | * 33 | * @param minX 34 | * min x (inclusive) 35 | * @param minY 36 | * min y (inclusive) 37 | * @param maxX 38 | * max x (exclusive) 39 | * @param maxY 40 | * max y (exclusive) 41 | */ 42 | public ImageWindow(int minX, int minY, int maxX, int maxY) { 43 | this.minX = minX; 44 | this.minY = minY; 45 | this.maxX = maxX; 46 | this.maxY = maxY; 47 | } 48 | 49 | /** 50 | * Constructor for a single coordinate 51 | * 52 | * @param x 53 | * x coordinate 54 | * @param y 55 | * y coordinate 56 | */ 57 | public ImageWindow(int x, int y) { 58 | this(x, y, x + 1, y + 1); 59 | } 60 | 61 | /** 62 | * Constructor, full image size 63 | * 64 | * @param fileDirectory 65 | * file directory 66 | */ 67 | public ImageWindow(FileDirectory fileDirectory) { 68 | this.minX = 0; 69 | this.minY = 0; 70 | this.maxX = fileDirectory.getImageWidth().intValue(); 71 | this.maxY = fileDirectory.getImageHeight().intValue(); 72 | } 73 | 74 | /** 75 | * Get the min x 76 | * 77 | * @return min x 78 | */ 79 | public int getMinX() { 80 | return minX; 81 | } 82 | 83 | /** 84 | * Set the min x 85 | * 86 | * @param minX 87 | * min x 88 | */ 89 | public void setMinX(int minX) { 90 | this.minX = minX; 91 | } 92 | 93 | /** 94 | * Get the min y 95 | * 96 | * @return min y 97 | */ 98 | public int getMinY() { 99 | return minY; 100 | } 101 | 102 | /** 103 | * Set the min y 104 | * 105 | * @param minY 106 | * min y 107 | */ 108 | public void setMinY(int minY) { 109 | this.minY = minY; 110 | } 111 | 112 | /** 113 | * Get the max x 114 | * 115 | * @return max x 116 | */ 117 | public int getMaxX() { 118 | return maxX; 119 | } 120 | 121 | /** 122 | * Set the max x 123 | * 124 | * @param maxX 125 | * max x 126 | */ 127 | public void setMaxX(int maxX) { 128 | this.maxX = maxX; 129 | } 130 | 131 | /** 132 | * Get the max y 133 | * 134 | * @return max y 135 | */ 136 | public int getMaxY() { 137 | return maxY; 138 | } 139 | 140 | /** 141 | * Set the max y 142 | * 143 | * @param maxY 144 | * max y 145 | */ 146 | public void setMaxY(int maxY) { 147 | this.maxY = maxY; 148 | } 149 | 150 | /** 151 | * {@inheritDoc} 152 | */ 153 | @Override 154 | public String toString() { 155 | return "ImageWindow [minX=" + minX + ", minY=" + minY + ", maxX=" 156 | + maxX + ", maxY=" + maxY + "]"; 157 | } 158 | 159 | } 160 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/TIFFImage.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import java.util.ArrayList; 4 | import java.util.Collections; 5 | import java.util.List; 6 | 7 | import mil.nga.tiff.util.TiffConstants; 8 | 9 | /** 10 | * TIFF Image containing the File Directories 11 | * 12 | * @author osbornb 13 | */ 14 | public class TIFFImage { 15 | 16 | /** 17 | * File directories 18 | */ 19 | private final List fileDirectories = new ArrayList<>(); 20 | 21 | /** 22 | * Constructor 23 | */ 24 | public TIFFImage() { 25 | 26 | } 27 | 28 | /** 29 | * Constructor, single file directory 30 | * 31 | * @param fileDirectory 32 | * file directory 33 | */ 34 | public TIFFImage(FileDirectory fileDirectory) { 35 | this.fileDirectories.add(fileDirectory); 36 | } 37 | 38 | /** 39 | * Constructor, multiple file directories 40 | * 41 | * @param fileDirectories 42 | * file directories 43 | */ 44 | public TIFFImage(List fileDirectories) { 45 | this.fileDirectories.addAll(fileDirectories); 46 | } 47 | 48 | /** 49 | * Add a file directory 50 | * 51 | * @param fileDirectory 52 | * file directory 53 | */ 54 | public void add(FileDirectory fileDirectory) { 55 | fileDirectories.add(fileDirectory); 56 | } 57 | 58 | /** 59 | * Get the file directories 60 | * 61 | * @return file directories 62 | */ 63 | public List getFileDirectories() { 64 | return Collections.unmodifiableList(fileDirectories); 65 | } 66 | 67 | /** 68 | * Get the default, first, or only file directory 69 | * 70 | * @return file directory 71 | */ 72 | public FileDirectory getFileDirectory() { 73 | return getFileDirectory(0); 74 | } 75 | 76 | /** 77 | * Get the file directory at the index 78 | * 79 | * @param index 80 | * index 81 | * @return file directory 82 | */ 83 | public FileDirectory getFileDirectory(int index) { 84 | return fileDirectories.get(index); 85 | } 86 | 87 | /** 88 | * Size in bytes of the TIFF header and file directories with their entries 89 | * 90 | * @return size in bytes 91 | */ 92 | public long sizeHeaderAndDirectories() { 93 | long size = TiffConstants.HEADER_BYTES; 94 | for (FileDirectory directory : fileDirectories) { 95 | size += directory.size(); 96 | } 97 | return size; 98 | } 99 | 100 | /** 101 | * Size in bytes of the TIFF header and file directories with their entries 102 | * and entry values 103 | * 104 | * @return size in bytes 105 | */ 106 | public long sizeHeaderAndDirectoriesWithValues() { 107 | long size = TiffConstants.HEADER_BYTES; 108 | for (FileDirectory directory : fileDirectories) { 109 | size += directory.sizeWithValues(); 110 | } 111 | return size; 112 | } 113 | 114 | } 115 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/CompressionDecoder.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.nio.ByteOrder; 4 | 5 | /** 6 | * Compression decoder interface 7 | * 8 | * @author osbornb 9 | */ 10 | public interface CompressionDecoder { 11 | 12 | /** 13 | * Decode the bytes 14 | * 15 | * @param bytes 16 | * bytes to decode 17 | * @param byteOrder 18 | * byte order 19 | * @return decoded bytes 20 | */ 21 | public byte[] decode(byte[] bytes, ByteOrder byteOrder); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/CompressionEncoder.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.nio.ByteOrder; 4 | 5 | /** 6 | * Compression encoder interface. Encode either on a per row or block basis 7 | * 8 | * @author osbornb 9 | */ 10 | public interface CompressionEncoder { 11 | 12 | /** 13 | * True to encode on a per row basis, false to encode on a per block / strip 14 | * basis 15 | * 16 | * @return true for row encoding 17 | */ 18 | public boolean rowEncoding(); 19 | 20 | /** 21 | * Encode the bytes 22 | * 23 | * @param bytes 24 | * bytes to encode 25 | * @param byteOrder 26 | * byte order 27 | * @return encoded block of bytes 28 | */ 29 | public byte[] encode(byte[] bytes, ByteOrder byteOrder); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/DeflateCompression.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.nio.ByteOrder; 6 | import java.util.zip.DataFormatException; 7 | import java.util.zip.Deflater; 8 | import java.util.zip.Inflater; 9 | 10 | import mil.nga.tiff.io.IOUtils; 11 | import mil.nga.tiff.util.TiffException; 12 | 13 | /** 14 | * Deflate Compression 15 | * 16 | * @author osbornb 17 | */ 18 | public class DeflateCompression implements CompressionDecoder, 19 | CompressionEncoder { 20 | 21 | /** 22 | * {@inheritDoc} 23 | */ 24 | @Override 25 | public byte[] decode(byte[] bytes, ByteOrder byteOrder) { 26 | try { 27 | Inflater inflater = new Inflater(); 28 | inflater.setInput(bytes); 29 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(bytes.length); 30 | byte[] buffer = new byte[IOUtils.COPY_BUFFER_SIZE]; 31 | while (!inflater.finished()) { 32 | int count = inflater.inflate(buffer); 33 | outputStream.write(buffer, 0, count); 34 | } 35 | outputStream.close(); 36 | byte[] output = outputStream.toByteArray(); 37 | 38 | return output; 39 | } catch (IOException e) { 40 | throw new TiffException("Failed close decoded byte stream", e); 41 | } catch (DataFormatException e) { 42 | throw new TiffException("Data format error while decoding stream", e); 43 | } 44 | } 45 | 46 | /** 47 | * {@inheritDoc} 48 | */ 49 | @Override 50 | public boolean rowEncoding() { 51 | return false; 52 | } 53 | 54 | /** 55 | * {@inheritDoc} 56 | */ 57 | @Override 58 | public byte[] encode(byte[] bytes, ByteOrder byteOrder) { 59 | try { 60 | Deflater deflater = new Deflater(); 61 | deflater.setInput(bytes); 62 | ByteArrayOutputStream outputStream = new ByteArrayOutputStream(bytes.length); 63 | deflater.finish(); 64 | byte[] buffer = new byte[IOUtils.COPY_BUFFER_SIZE]; 65 | while (!deflater.finished()) { 66 | int count = deflater.deflate(buffer); // returns the generated code... index 67 | outputStream.write(buffer, 0, count); 68 | } 69 | 70 | outputStream.close(); 71 | byte[] output = outputStream.toByteArray(); 72 | return output; 73 | } catch (IOException e) { 74 | throw new TiffException("Failed close encoded stream", e); 75 | } 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/PackbitsCompression.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.nio.ByteOrder; 5 | 6 | import mil.nga.tiff.io.ByteReader; 7 | import mil.nga.tiff.util.TiffException; 8 | 9 | /** 10 | * Packbits Compression 11 | * 12 | * @author osbornb 13 | */ 14 | public class PackbitsCompression implements CompressionDecoder, 15 | CompressionEncoder { 16 | 17 | /** 18 | * {@inheritDoc} 19 | */ 20 | @Override 21 | public byte[] decode(byte[] bytes, ByteOrder byteOrder) { 22 | 23 | ByteReader reader = new ByteReader(bytes, byteOrder); 24 | 25 | ByteArrayOutputStream decodedStream = new ByteArrayOutputStream(); 26 | 27 | while (reader.hasByte()) { 28 | int header = reader.readByte(); 29 | if (header != -128) { 30 | if (header < 0) { 31 | int next = reader.readUnsignedByte(); 32 | header = -header; 33 | for (int i = 0; i <= header; i++) { 34 | decodedStream.write(next); 35 | } 36 | } else { 37 | for (int i = 0; i <= header; i++) { 38 | decodedStream.write(reader.readUnsignedByte()); 39 | } 40 | } 41 | } 42 | } 43 | 44 | byte[] decoded = decodedStream.toByteArray(); 45 | 46 | return decoded; 47 | } 48 | 49 | /** 50 | * {@inheritDoc} 51 | */ 52 | @Override 53 | public boolean rowEncoding() { 54 | return true; 55 | } 56 | 57 | /** 58 | * {@inheritDoc} 59 | */ 60 | @Override 61 | public byte[] encode(byte[] bytes, ByteOrder byteOrder) { 62 | throw new TiffException("Packbits encoder is not yet implemented"); 63 | } 64 | 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/RawCompression.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.nio.ByteOrder; 4 | 5 | /** 6 | * Raw / no compression 7 | * 8 | * @author osbornb 9 | */ 10 | public class RawCompression implements CompressionDecoder, CompressionEncoder { 11 | 12 | /** 13 | * {@inheritDoc} 14 | */ 15 | @Override 16 | public byte[] decode(byte[] bytes, ByteOrder byteOrder) { 17 | return bytes; 18 | } 19 | 20 | /** 21 | * {@inheritDoc} 22 | */ 23 | @Override 24 | public boolean rowEncoding() { 25 | return false; 26 | } 27 | 28 | /** 29 | * {@inheritDoc} 30 | */ 31 | @Override 32 | public byte[] encode(byte[] bytes, ByteOrder byteOrder) { 33 | return bytes; 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/compression/UnsupportedCompression.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.compression; 2 | 3 | import java.nio.ByteOrder; 4 | 5 | import mil.nga.tiff.util.TiffException; 6 | 7 | /** 8 | * Unsupported compression 9 | * 10 | * @author michaelknigge 11 | */ 12 | public class UnsupportedCompression implements CompressionDecoder, CompressionEncoder { 13 | 14 | private final String message; 15 | 16 | /** 17 | * Constructor 18 | * 19 | * @param message 20 | * message of the TiffException 21 | * @since 2.0.1 22 | */ 23 | public UnsupportedCompression(final String message) { 24 | this.message = message; 25 | } 26 | 27 | /** 28 | * {@inheritDoc} 29 | */ 30 | @Override 31 | public byte[] decode(byte[] bytes, ByteOrder byteOrder) { 32 | throw new TiffException(this.message); 33 | } 34 | 35 | /** 36 | * {@inheritDoc} 37 | */ 38 | @Override 39 | public boolean rowEncoding() { 40 | return false; 41 | } 42 | 43 | /** 44 | * {@inheritDoc} 45 | */ 46 | @Override 47 | public byte[] encode(byte[] bytes, ByteOrder byteOrder) { 48 | throw new TiffException(this.message); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/io/ByteWriter.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.io; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.IOException; 5 | import java.nio.ByteBuffer; 6 | import java.nio.ByteOrder; 7 | 8 | /** 9 | * Write a byte array 10 | * 11 | * @author osbornb 12 | */ 13 | public class ByteWriter { 14 | 15 | /** 16 | * Output stream to write bytes to 17 | */ 18 | private final ByteArrayOutputStream os = new ByteArrayOutputStream(); 19 | 20 | /** 21 | * Byte order 22 | */ 23 | private ByteOrder byteOrder = null; 24 | 25 | /** 26 | * Constructor 27 | */ 28 | public ByteWriter() { 29 | this(ByteOrder.nativeOrder()); 30 | } 31 | 32 | /** 33 | * Constructor 34 | * 35 | * @param byteOrder 36 | * byte order 37 | */ 38 | public ByteWriter(ByteOrder byteOrder) { 39 | this.byteOrder = byteOrder; 40 | } 41 | 42 | /** 43 | * Close the byte writer 44 | */ 45 | public void close() { 46 | try { 47 | os.close(); 48 | } catch (IOException e) { 49 | } 50 | } 51 | 52 | /** 53 | * Get the byte array output stream 54 | * 55 | * @return byte array output stream 56 | */ 57 | public ByteArrayOutputStream getOutputStream() { 58 | return os; 59 | } 60 | 61 | /** 62 | * Get the byte order 63 | * 64 | * @return byte order 65 | */ 66 | public ByteOrder getByteOrder() { 67 | return byteOrder; 68 | } 69 | 70 | /** 71 | * Set the byte order 72 | * 73 | * @param byteOrder 74 | * byte order 75 | */ 76 | public void setByteOrder(ByteOrder byteOrder) { 77 | this.byteOrder = byteOrder; 78 | } 79 | 80 | /** 81 | * Get the written bytes 82 | * 83 | * @return written bytes 84 | */ 85 | public byte[] getBytes() { 86 | return os.toByteArray(); 87 | } 88 | 89 | /** 90 | * Get the current size in bytes written 91 | * 92 | * @return bytes written 93 | */ 94 | public int size() { 95 | return os.size(); 96 | } 97 | 98 | /** 99 | * Write a String 100 | * 101 | * @param value 102 | * string value 103 | * @return bytes written 104 | * @throws IOException 105 | * upon failure to write 106 | */ 107 | public int writeString(String value) throws IOException { 108 | byte[] valueBytes = value.getBytes(); 109 | os.write(valueBytes); 110 | return valueBytes.length; 111 | } 112 | 113 | /** 114 | * Write a byte 115 | * 116 | * @param value 117 | * byte 118 | */ 119 | public void writeByte(byte value) { 120 | os.write(value); 121 | } 122 | 123 | /** 124 | * Write an unsigned byte 125 | * 126 | * @param value 127 | * unsigned byte as a short 128 | */ 129 | public void writeUnsignedByte(short value) { 130 | os.write((byte) (value & 0xff)); 131 | } 132 | 133 | /** 134 | * Write the bytes 135 | * 136 | * @param value 137 | * bytes 138 | * @throws IOException 139 | * upon failure to write 140 | */ 141 | public void writeBytes(byte[] value) throws IOException { 142 | os.write(value); 143 | } 144 | 145 | /** 146 | * Write a short 147 | * 148 | * @param value 149 | * short 150 | * @throws IOException 151 | * upon failure to write 152 | */ 153 | public void writeShort(short value) throws IOException { 154 | byte[] valueBytes = new byte[2]; 155 | ByteBuffer byteBuffer = ByteBuffer.allocate(2).order(byteOrder) 156 | .putShort(value); 157 | byteBuffer.flip(); 158 | byteBuffer.get(valueBytes); 159 | os.write(valueBytes); 160 | } 161 | 162 | /** 163 | * Write an unsigned short 164 | * 165 | * @param value 166 | * unsigned short as an int 167 | * @throws IOException 168 | * upon failure to write 169 | */ 170 | public void writeUnsignedShort(int value) throws IOException { 171 | byte[] valueBytes = new byte[2]; 172 | ByteBuffer byteBuffer = ByteBuffer.allocate(2).order(byteOrder) 173 | .putShort((short) (value & 0xffff)); 174 | byteBuffer.flip(); 175 | byteBuffer.get(valueBytes); 176 | os.write(valueBytes); 177 | } 178 | 179 | /** 180 | * Write an integer 181 | * 182 | * @param value 183 | * int 184 | * @throws IOException 185 | * upon failure to write 186 | */ 187 | public void writeInt(int value) throws IOException { 188 | byte[] valueBytes = new byte[4]; 189 | ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(byteOrder) 190 | .putInt(value); 191 | byteBuffer.flip(); 192 | byteBuffer.get(valueBytes); 193 | os.write(valueBytes); 194 | } 195 | 196 | /** 197 | * Write an unsigned int 198 | * 199 | * @param value 200 | * unsigned int as long 201 | * @throws IOException 202 | * upon failure to write 203 | */ 204 | public void writeUnsignedInt(long value) throws IOException { 205 | byte[] valueBytes = new byte[4]; 206 | ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(byteOrder) 207 | .putInt((int) (value & 0xffffffffL)); 208 | byteBuffer.flip(); 209 | byteBuffer.get(valueBytes); 210 | os.write(valueBytes); 211 | } 212 | 213 | /** 214 | * Write a float 215 | * 216 | * @param value 217 | * float 218 | * @throws IOException 219 | * upon failure to write 220 | */ 221 | public void writeFloat(float value) throws IOException { 222 | byte[] valueBytes = new byte[4]; 223 | ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(byteOrder) 224 | .putFloat(value); 225 | byteBuffer.flip(); 226 | byteBuffer.get(valueBytes); 227 | os.write(valueBytes); 228 | } 229 | 230 | /** 231 | * Write a double 232 | * 233 | * @param value 234 | * double 235 | * @throws IOException 236 | * upon failure to write 237 | */ 238 | public void writeDouble(double value) throws IOException { 239 | byte[] valueBytes = new byte[8]; 240 | ByteBuffer byteBuffer = ByteBuffer.allocate(8).order(byteOrder) 241 | .putDouble(value); 242 | byteBuffer.flip(); 243 | byteBuffer.get(valueBytes); 244 | os.write(valueBytes); 245 | } 246 | 247 | } 248 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/io/IOUtils.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.io; 2 | 3 | import java.io.ByteArrayOutputStream; 4 | import java.io.File; 5 | import java.io.FileInputStream; 6 | import java.io.FileOutputStream; 7 | import java.io.IOException; 8 | import java.io.InputStream; 9 | import java.io.OutputStream; 10 | 11 | /** 12 | * Input / Output utility methods 13 | * 14 | * @author osbornb 15 | */ 16 | public class IOUtils { 17 | 18 | /** 19 | * Copy stream buffer chunk size in bytes 20 | * 21 | * @since 2.0.3 22 | */ 23 | public static int COPY_BUFFER_SIZE = 8192; 24 | 25 | /** 26 | * Copy a file to a file location 27 | * 28 | * @param copyFrom 29 | * file to copy 30 | * @param copyTo 31 | * file to copy to 32 | * @throws IOException 33 | * upon failure to copy file 34 | */ 35 | public static void copyFile(File copyFrom, File copyTo) throws IOException { 36 | 37 | InputStream from = new FileInputStream(copyFrom); 38 | OutputStream to = new FileOutputStream(copyTo); 39 | 40 | copyStream(from, to); 41 | } 42 | 43 | /** 44 | * Copy an input stream to a file location 45 | * 46 | * @param copyFrom 47 | * stream to copy 48 | * @param copyTo 49 | * file to copy to 50 | * @throws IOException 51 | * upon failure to copy the stream 52 | */ 53 | public static void copyStream(InputStream copyFrom, File copyTo) 54 | throws IOException { 55 | 56 | OutputStream to = new FileOutputStream(copyTo); 57 | 58 | copyStream(copyFrom, to); 59 | } 60 | 61 | /** 62 | * Get the file bytes 63 | * 64 | * @param file 65 | * file 66 | * @return bytes 67 | * @throws IOException 68 | * upon failure to read the file 69 | */ 70 | public static byte[] fileBytes(File file) throws IOException { 71 | 72 | FileInputStream fis = new FileInputStream(file); 73 | 74 | return streamBytes(fis); 75 | } 76 | 77 | /** 78 | * Get the stream bytes 79 | * 80 | * @param stream 81 | * input stream 82 | * @throws IOException 83 | * upon failure to read stream bytes 84 | * @return bytes 85 | */ 86 | public static byte[] streamBytes(InputStream stream) throws IOException { 87 | 88 | ByteArrayOutputStream bytes = new ByteArrayOutputStream(); 89 | 90 | copyStream(stream, bytes); 91 | 92 | return bytes.toByteArray(); 93 | } 94 | 95 | /** 96 | * Copy an input stream to an output stream 97 | * 98 | * @param copyFrom 99 | * stream to copy 100 | * @param copyTo 101 | * stream to copy to 102 | * @throws IOException 103 | * upon failure to copy stream 104 | */ 105 | public static void copyStream(InputStream copyFrom, OutputStream copyTo) 106 | throws IOException { 107 | 108 | byte[] buffer = new byte[COPY_BUFFER_SIZE]; 109 | int length; 110 | while ((length = copyFrom.read(buffer)) > 0) { 111 | copyTo.write(buffer, 0, length); 112 | } 113 | 114 | copyTo.flush(); 115 | copyTo.close(); 116 | copyFrom.close(); 117 | } 118 | 119 | } 120 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/util/TiffConstants.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.util; 2 | 3 | /** 4 | * TIFF Constants 5 | * 6 | * @author osbornb 7 | */ 8 | public class TiffConstants { 9 | 10 | /** 11 | * Little Endian byte order string 12 | */ 13 | public static final String BYTE_ORDER_LITTLE_ENDIAN = "II"; 14 | 15 | /** 16 | * Big Endian byte order string 17 | */ 18 | public static final String BYTE_ORDER_BIG_ENDIAN = "MM"; 19 | 20 | /** 21 | * TIFF File Identifier 22 | */ 23 | public static final int FILE_IDENTIFIER = 42; 24 | 25 | /** 26 | * TIFF header bytes 27 | */ 28 | public static final int HEADER_BYTES = 8; 29 | 30 | /** 31 | * Image File Directory header / number of entries bytes 32 | */ 33 | public static final int IFD_HEADER_BYTES = 2; 34 | 35 | /** 36 | * Image File Directory offset to the next IFD bytes 37 | */ 38 | public static final int IFD_OFFSET_BYTES = 4; 39 | 40 | /** 41 | * Image File Directory entry bytes 42 | */ 43 | public static final int IFD_ENTRY_BYTES = 12; 44 | 45 | /** 46 | * Default max bytes per strip when writing strips 47 | */ 48 | public static final int DEFAULT_MAX_BYTES_PER_STRIP = 8000; 49 | 50 | // Compression constants 51 | public static final int COMPRESSION_NO = 1; 52 | public static final int COMPRESSION_CCITT_HUFFMAN = 2; 53 | public static final int COMPRESSION_T4 = 3; 54 | public static final int COMPRESSION_T6 = 4; 55 | public static final int COMPRESSION_LZW = 5; 56 | public static final int COMPRESSION_JPEG_OLD = 6; 57 | public static final int COMPRESSION_JPEG_NEW = 7; 58 | public static final int COMPRESSION_DEFLATE = 8; 59 | @Deprecated 60 | public static final int COMPRESSION_PKZIP_DEFLATE = 32946; // PKZIP-style Deflate encoding (Obsolete). 61 | public static final int COMPRESSION_PACKBITS = 32773; 62 | 63 | // Extra Samples constants 64 | public static final int EXTRA_SAMPLES_UNSPECIFIED = 0; 65 | public static final int EXTRA_SAMPLES_ASSOCIATED_ALPHA = 1; 66 | public static final int EXTRA_SAMPLES_UNASSOCIATED_ALPHA = 2; 67 | 68 | // Fill Order constants 69 | public static final int FILL_ORDER_LOWER_COLUMN_HIGHER_ORDER = 1; 70 | public static final int FILL_ORDER_LOWER_COLUMN_LOWER_ORDER = 2; 71 | 72 | // Gray Response constants 73 | public static final int GRAY_RESPONSE_TENTHS = 1; 74 | public static final int GRAY_RESPONSE_HUNDREDTHS = 2; 75 | public static final int GRAY_RESPONSE_THOUSANDTHS = 3; 76 | public static final int GRAY_RESPONSE_TEN_THOUSANDTHS = 4; 77 | public static final int GRAY_RESPONSE_HUNDRED_THOUSANDTHS = 5; 78 | 79 | // Orientation constants 80 | public static final int ORIENTATION_TOP_ROW_LEFT_COLUMN = 1; 81 | public static final int ORIENTATION_TOP_ROW_RIGHT_COLUMN = 2; 82 | public static final int ORIENTATION_BOTTOM_ROW_RIGHT_COLUMN = 3; 83 | public static final int ORIENTATION_BOTTOM_ROW_LEFT_COLUMN = 4; 84 | public static final int ORIENTATION_LEFT_ROW_TOP_COLUMN = 5; 85 | public static final int ORIENTATION_RIGHT_ROW_TOP_COLUMN = 6; 86 | public static final int ORIENTATION_RIGHT_ROW_BOTTOM_COLUMN = 7; 87 | public static final int ORIENTATION_LEFT_ROW_BOTTOM_COLUMN = 8; 88 | 89 | // Photometric Interpretation constants 90 | public static final int PHOTOMETRIC_INTERPRETATION_WHITE_IS_ZERO = 0; 91 | public static final int PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO = 1; 92 | public static final int PHOTOMETRIC_INTERPRETATION_RGB = 2; 93 | public static final int PHOTOMETRIC_INTERPRETATION_PALETTE = 3; 94 | public static final int PHOTOMETRIC_INTERPRETATION_TRANSPARENCY = 4; 95 | 96 | // Planar Configuration constants 97 | public static final int PLANAR_CONFIGURATION_CHUNKY = 1; 98 | public static final int PLANAR_CONFIGURATION_PLANAR = 2; 99 | 100 | // Resolution Unit constants 101 | public static final int RESOLUTION_UNIT_NO = 1; 102 | public static final int RESOLUTION_UNIT_INCH = 2; 103 | public static final int RESOLUTION_UNIT_CENTIMETER = 3; 104 | 105 | // Sample Format constants 106 | public static final int SAMPLE_FORMAT_UNSIGNED_INT = 1; 107 | public static final int SAMPLE_FORMAT_SIGNED_INT = 2; 108 | public static final int SAMPLE_FORMAT_FLOAT = 3; 109 | public static final int SAMPLE_FORMAT_UNDEFINED = 4; 110 | 111 | // Subfile Type constants 112 | public static final int SUBFILE_TYPE_FULL = 1; 113 | public static final int SUBFILE_TYPE_REDUCED = 2; 114 | public static final int SAMPLE_FORMAT_SINGLE_PAGE_MULTI_PAGE = 3; 115 | 116 | // Threshholding constants 117 | public static final int THRESHHOLDING_NO = 1; 118 | public static final int THRESHHOLDING_ORDERED = 2; 119 | public static final int THRESHHOLDING_RANDOM = 3; 120 | 121 | // Differencing Predictor constants 122 | public static final int PREDICTOR_NO = 1; 123 | public static final int PREDICTOR_HORIZONTAL = 2; 124 | public static final int PREDICTOR_FLOATINGPOINT = 3; 125 | 126 | } 127 | -------------------------------------------------------------------------------- /src/main/java/mil/nga/tiff/util/TiffException.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff.util; 2 | 3 | /** 4 | * TIFF exception 5 | * 6 | * @author osbornb 7 | */ 8 | public class TiffException extends RuntimeException { 9 | 10 | /** 11 | * Serial version id 12 | */ 13 | private static final long serialVersionUID = 1L; 14 | 15 | /** 16 | * Constructor 17 | */ 18 | public TiffException() { 19 | super(); 20 | } 21 | 22 | /** 23 | * Constructor 24 | * 25 | * @param message 26 | * error message 27 | */ 28 | public TiffException(String message) { 29 | super(message); 30 | } 31 | 32 | /** 33 | * Constructor 34 | * 35 | * @param message 36 | * error message 37 | * @param throwable 38 | * cause 39 | */ 40 | public TiffException(String message, Throwable throwable) { 41 | super(message, throwable); 42 | } 43 | 44 | /** 45 | * Constructor 46 | * 47 | * @param throwable 48 | * cause 49 | */ 50 | public TiffException(Throwable throwable) { 51 | super(throwable); 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/test/java/mil/nga/tiff/ReadmeTest.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | 6 | import org.junit.Test; 7 | 8 | import mil.nga.tiff.util.TiffConstants; 9 | 10 | /** 11 | * README example tests 12 | * 13 | * @author osbornb 14 | */ 15 | public class ReadmeTest { 16 | 17 | /** 18 | * Test read 19 | * 20 | * @throws IOException 21 | * upon error 22 | */ 23 | @Test 24 | public void testWriteAndRead() throws IOException { 25 | testRead(testWrite()); 26 | } 27 | 28 | /** 29 | * Test read 30 | * 31 | * @param input 32 | * input bytes 33 | * @throws IOException 34 | * upon error 35 | */ 36 | public void testRead(byte[] input) throws IOException { 37 | 38 | // File input = ... 39 | // InputStream input = ... 40 | // byte[] input = ... 41 | // ByteReader input = ... 42 | 43 | TIFFImage tiffImage = TiffReader.readTiff(input); 44 | List directories = tiffImage.getFileDirectories(); 45 | FileDirectory directory = directories.get(0); 46 | Rasters rasters = directory.readRasters(); 47 | 48 | } 49 | 50 | /** 51 | * Test write 52 | * 53 | * @return bytes 54 | * @throws IOException 55 | * upon error 56 | */ 57 | public byte[] testWrite() throws IOException { 58 | 59 | int width = 256; 60 | int height = 256; 61 | int samplesPerPixel = 1; 62 | FieldType fieldType = FieldType.FLOAT; 63 | int bitsPerSample = fieldType.getBits(); 64 | 65 | Rasters rasters = new Rasters(width, height, samplesPerPixel, 66 | fieldType); 67 | 68 | int rowsPerStrip = rasters.calculateRowsPerStrip( 69 | TiffConstants.PLANAR_CONFIGURATION_CHUNKY); 70 | 71 | FileDirectory directory = new FileDirectory(); 72 | directory.setImageWidth(width); 73 | directory.setImageHeight(height); 74 | directory.setBitsPerSample(bitsPerSample); 75 | directory.setCompression(TiffConstants.COMPRESSION_NO); 76 | directory.setPhotometricInterpretation( 77 | TiffConstants.PHOTOMETRIC_INTERPRETATION_BLACK_IS_ZERO); 78 | directory.setSamplesPerPixel(samplesPerPixel); 79 | directory.setRowsPerStrip(rowsPerStrip); 80 | directory.setPlanarConfiguration( 81 | TiffConstants.PLANAR_CONFIGURATION_CHUNKY); 82 | directory.setSampleFormat(TiffConstants.SAMPLE_FORMAT_FLOAT); 83 | directory.setWriteRasters(rasters); 84 | 85 | for (int y = 0; y < height; y++) { 86 | for (int x = 0; x < width; x++) { 87 | float pixelValue = 1.0f; // any pixel value 88 | rasters.setFirstPixelSample(x, y, pixelValue); 89 | } 90 | } 91 | 92 | TIFFImage tiffImage = new TIFFImage(); 93 | tiffImage.add(directory); 94 | byte[] bytes = TiffWriter.writeTiffToBytes(tiffImage); 95 | // or 96 | // File file = ... 97 | // TiffWriter.writeTiff(file, tiffImage); 98 | 99 | return bytes; 100 | } 101 | 102 | } 103 | -------------------------------------------------------------------------------- /src/test/java/mil/nga/tiff/TiffFileTester.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | import java.io.File; 4 | import java.io.IOException; 5 | import java.util.List; 6 | 7 | /** 8 | * Test reading an argument provided TIFF file 9 | * 10 | * @author osbornb 11 | */ 12 | public class TiffFileTester { 13 | 14 | /** 15 | * Main method, provide a single file path argument 16 | * 17 | * @param args 18 | * arguments 19 | * @throws IOException 20 | * upon error 21 | */ 22 | public static void main(String[] args) throws IOException { 23 | 24 | if (args.length != 1) { 25 | throw new IllegalArgumentException( 26 | "Provide a single TIFF file path argument"); 27 | } 28 | 29 | File file = new File(args[0]); 30 | if (!file.exists()) { 31 | throw new IllegalArgumentException( 32 | "TIFF file does not exist: " + file.getAbsolutePath()); 33 | } 34 | 35 | TIFFImage tiffImage = TiffReader.readTiff(file); 36 | 37 | System.out.println("TIFF Image: " + file.getName()); 38 | 39 | List fileDirectories = tiffImage.getFileDirectories(); 40 | for (int i = 0; i < fileDirectories.size(); i++) { 41 | FileDirectory fileDirectory = fileDirectories.get(i); 42 | 43 | System.out.println(); 44 | System.out.print("-- File Directory "); 45 | if (fileDirectories.size() > 1) { 46 | System.out.print((i + 1) + " "); 47 | } 48 | System.out.println("--"); 49 | 50 | for (FileDirectoryEntry entry : fileDirectory.getEntries()) { 51 | 52 | System.out.println(); 53 | System.out.println(entry.getFieldTag() + " (" 54 | + entry.getFieldTag().getId() + ")"); 55 | System.out.println(entry.getFieldType() + " (" 56 | + entry.getFieldType().getBytes() + " bytes)"); 57 | System.out.println("Count: " + entry.getTypeCount()); 58 | System.out.println("Values: " + entry.getValues()); 59 | } 60 | 61 | Rasters rasters = fileDirectory.readRasters(); 62 | System.out.println(); 63 | System.out.println("-- Rasters --"); 64 | System.out.println(); 65 | System.out.println("Width: " + rasters.getWidth()); 66 | System.out.println("Height: " + rasters.getHeight()); 67 | System.out.println("Number of Pixels: " + rasters.getNumPixels()); 68 | System.out.println( 69 | "Samples Per Pixel: " + rasters.getSamplesPerPixel()); 70 | System.out 71 | .println("Bits Per Sample: " + rasters.getBitsPerSample()); 72 | 73 | System.out.println(); 74 | printPixel(rasters, 0, 0); 75 | printPixel(rasters, (int) (rasters.getWidth() / 2.0), 76 | (int) (rasters.getHeight() / 2.0)); 77 | printPixel(rasters, rasters.getWidth() - 1, 78 | rasters.getHeight() - 1); 79 | 80 | System.out.println(); 81 | } 82 | 83 | } 84 | 85 | /** 86 | * Print a pixel from the rasters 87 | * 88 | * @param rasters 89 | * rasters 90 | * @param x 91 | * x coordinate 92 | * @param y 93 | * y coordinate 94 | */ 95 | private static void printPixel(Rasters rasters, int x, int y) { 96 | System.out.print("Pixel x = " + x + ", y = " + y + ": ["); 97 | Number[] pixel = rasters.getPixel(x, y); 98 | for (int i = 0; i < pixel.length; i++) { 99 | if (i > 0) { 100 | System.out.print(", "); 101 | } 102 | System.out.print(pixel[i]); 103 | } 104 | System.out.println("]"); 105 | } 106 | 107 | } 108 | -------------------------------------------------------------------------------- /src/test/java/mil/nga/tiff/TiffTestConstants.java: -------------------------------------------------------------------------------- 1 | package mil.nga.tiff; 2 | 3 | /** 4 | * TIFF Test Constants 5 | * 6 | * @author osbornb 7 | */ 8 | public class TiffTestConstants { 9 | 10 | /** 11 | * Stripped TIFF test file 12 | */ 13 | public static final String FILE_STRIPPED = "stripped.tiff"; 14 | 15 | /** 16 | * Packbits compressed TIFF test file 17 | */ 18 | public static final String FILE_PACKBITS = "packbits.tiff"; 19 | 20 | /** 21 | * LZW compressed TIFF test file 22 | */ 23 | public static final String FILE_LZW = "lzw.tiff"; 24 | 25 | /** 26 | * Tiled TIFF test file 27 | */ 28 | public static final String FILE_TILED = "tiled.tiff"; 29 | 30 | /** 31 | * Float 32 TIFF test file 32 | */ 33 | public static final String FILE_FLOAT32 = "float32.tiff"; 34 | 35 | /** 36 | * Float 64 TIFF test file 37 | */ 38 | public static final String FILE_FLOAT64 = "float64.tiff"; 39 | 40 | /** 41 | * Int 32 TIFF test file 42 | */ 43 | public static final String FILE_INT32 = "int32.tiff"; 44 | 45 | /** 46 | * Unsigned Int 32 TIFF test file 47 | */ 48 | public static final String FILE_UINT32 = "uint32.tiff"; 49 | 50 | /** 51 | * Interleave TIFF test file 52 | */ 53 | public static final String FILE_INTERLEAVE = "interleave.tiff"; 54 | 55 | /** 56 | * Tiled Planar TIFF test file 57 | */ 58 | public static final String FILE_TILED_PLANAR = "tiledplanar.tiff"; 59 | 60 | /** 61 | * JPEG TIFF test file 62 | */ 63 | public static final String FILE_JPEG = "quad-jpeg.tif"; 64 | 65 | /** 66 | * Deflate Predictor TIFF test file 67 | */ 68 | public static final String FILE_DEFLATE_PREDICTOR = "deflate_predictor.tiff"; 69 | 70 | /** 71 | * Deflate Predictor Big Strips TIFF test file 72 | */ 73 | public static final String FILE_DEFLATE_PREDICTOR_BIG_STRIPS = "deflate_predictor_big_strips.tiff"; 74 | 75 | /** 76 | * Deflate Predictor Tiled TIFF test file 77 | */ 78 | public static final String FILE_DEFLATE_PREDICTOR_TILED = "deflate_predictor_tiled.tiff"; 79 | 80 | /** 81 | * LZW Predictor TIFF test file 82 | */ 83 | public static final String FILE_LZW_PREDICTOR = "lzw_predictor.tiff"; 84 | 85 | /** 86 | * Tiled Planar LZW TIFF test file 87 | */ 88 | public static final String FILE_TILED_PLANAR_LZW = "tiledplanarlzw.tiff"; 89 | 90 | /** 91 | * LZW Predictor Floating Point TIFF test file 92 | */ 93 | public static final String FILE_LZW_PREDICTOR_FLOATING = "lzw_predictor_floating.tiff"; 94 | 95 | } 96 | -------------------------------------------------------------------------------- /src/test/resources/README: -------------------------------------------------------------------------------- 1 | Test TIFF files were generated from: https://github.com/constantinius/geotiff.js/blob/master/test/data/setup_data.sh 2 | 3 | The data comes from https://github.com/EOxServer/autotest/ under the EOxServer Open License, an MIT-style license. 4 | 5 | 6 | 7 | EOxServer Open License 8 | Version 1, 8 June 2011 9 | 10 | Copyright (C) 2011 EOX IT Services GmbH 11 | 12 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all copies of this Software or works derived from this Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 17 | 18 | Read more about this license at http://eoxserver.org/doc/copyright.html 19 | -------------------------------------------------------------------------------- /src/test/resources/deflate.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/deflate.tiff -------------------------------------------------------------------------------- /src/test/resources/deflate_predictor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/deflate_predictor.tiff -------------------------------------------------------------------------------- /src/test/resources/deflate_predictor_big_strips.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/deflate_predictor_big_strips.tiff -------------------------------------------------------------------------------- /src/test/resources/deflate_predictor_tiled.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/deflate_predictor_tiled.tiff -------------------------------------------------------------------------------- /src/test/resources/float32.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/float32.tiff -------------------------------------------------------------------------------- /src/test/resources/float64.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/float64.tiff -------------------------------------------------------------------------------- /src/test/resources/initial.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/initial.tiff -------------------------------------------------------------------------------- /src/test/resources/int32.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/int32.tiff -------------------------------------------------------------------------------- /src/test/resources/interleave.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/interleave.tiff -------------------------------------------------------------------------------- /src/test/resources/lzw.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/lzw.tiff -------------------------------------------------------------------------------- /src/test/resources/lzw_predictor.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/lzw_predictor.tiff -------------------------------------------------------------------------------- /src/test/resources/lzw_predictor_floating.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/lzw_predictor_floating.tiff -------------------------------------------------------------------------------- /src/test/resources/overviews.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/overviews.tiff -------------------------------------------------------------------------------- /src/test/resources/packbits.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/packbits.tiff -------------------------------------------------------------------------------- /src/test/resources/quad-jpeg.tif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/quad-jpeg.tif -------------------------------------------------------------------------------- /src/test/resources/rgb.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/rgb.tiff -------------------------------------------------------------------------------- /src/test/resources/small.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/small.tiff -------------------------------------------------------------------------------- /src/test/resources/stripped.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/stripped.tiff -------------------------------------------------------------------------------- /src/test/resources/tiled.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/tiled.tiff -------------------------------------------------------------------------------- /src/test/resources/tiledplanar.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/tiledplanar.tiff -------------------------------------------------------------------------------- /src/test/resources/tiledplanarlzw.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/tiledplanarlzw.tiff -------------------------------------------------------------------------------- /src/test/resources/uint32.tiff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ngageoint/tiff-java/0b3d9be69b704129f39e7ba5b8528f2e969fdb30/src/test/resources/uint32.tiff --------------------------------------------------------------------------------