Skip to content

Commit

Permalink
change next version to 2.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bosborn committed Oct 23, 2017
1 parent 0b0e03b commit 5541bfb
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 4 deletions.
9 changes: 6 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@ Adheres to [Semantic Versioning](http://semver.org/).

---

## 1.0.4 (TBD)
## 2.0.0 (TBD)

* Rasters constructor support for multiple samples per pixel
* Handle missing samples per pixel values by using length of bits per sample
* Rasters modified to use buffers in place of arrays
* Deflate compression support
* Additional Rasters constructor options
* Handle missing samples per pixel with default value of 1
* Public access to tiff tags
* String Entry Value getter and setter
* maven-gpg-plugin version 1.6

## [1.0.3](https://github.com/ngageoint/geopackage-tiff-java/releases/tag/1.0.3) (06-27-2017)

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>mil.nga</groupId>
<artifactId>tiff</artifactId>
<version>1.0.4</version>
<version>2.0.0</version>
<packaging>jar</packaging>
<name>Tagged Image File Format</name>
<url>https://github.com/ngageoint/geopackage-tiff-java</url>
Expand Down
3 changes: 3 additions & 0 deletions src/main/java/mil/nga/tiff/FieldType.java
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ public int getBytes() {
* Get the number of bits per value
*
* @return number of bits
* @since 2.0.0
*/
public int getBits() {
return bytes * 8;
Expand All @@ -135,6 +136,7 @@ public static FieldType getFieldType(int fieldType) {
* @param bitsPerSample
* bits per sample
* @return field type
* @since 2.0.0
*/
public static FieldType getFieldType(int sampleFormat, int bitsPerSample) {

Expand Down Expand Up @@ -194,6 +196,7 @@ public static FieldType getFieldType(int sampleFormat, int bitsPerSample) {
* @param fieldType
* field type
* @return sample format
* @since 2.0.0
*/
public static int getSampleFormat(FieldType fieldType) {

Expand Down
17 changes: 17 additions & 0 deletions src/main/java/mil/nga/tiff/FileDirectory.java
Original file line number Diff line number Diff line change
Expand Up @@ -481,6 +481,7 @@ public void setStripOffsets(long stripOffset) {
* Get the samples per pixel
*
* @return samples per pixel
* @since 2.0.0
*/
public int getSamplesPerPixel() {
Integer samplesPerPixel = getIntegerEntryValue(FieldTagType.SamplesPerPixel);
Expand Down Expand Up @@ -1419,6 +1420,7 @@ private int getBytesPerPixel() {
* @param fieldTagType
* field tag type
* @return integer value
* @since 2.0.0
*/
public Integer getIntegerEntryValue(FieldTagType fieldTagType) {
return getEntryValue(fieldTagType);
Expand All @@ -1431,6 +1433,7 @@ public Integer getIntegerEntryValue(FieldTagType fieldTagType) {
* field tag type
* @param value
* unsigned integer value (16 bit)
* @since 2.0.0
*/
public void setUnsignedIntegerEntryValue(FieldTagType fieldTagType,
int value) {
Expand All @@ -1443,6 +1446,7 @@ public void setUnsignedIntegerEntryValue(FieldTagType fieldTagType,
* @param fieldTagType
* field tag type
* @return number value
* @since 2.0.0
*/
public Number getNumberEntryValue(FieldTagType fieldTagType) {
return getEntryValue(fieldTagType);
Expand All @@ -1455,6 +1459,7 @@ public Number getNumberEntryValue(FieldTagType fieldTagType) {
* field tag type
* @param value
* unsigned long value (32 bit)
* @since 2.0.0
*/
public void setUnsignedLongEntryValue(FieldTagType fieldTagType, long value) {
setEntryValue(fieldTagType, FieldType.LONG, 1, value);
Expand All @@ -1466,6 +1471,7 @@ public void setUnsignedLongEntryValue(FieldTagType fieldTagType, long value) {
* @param fieldTagType
* field tag type
* @return string value
* @since 2.0.0
*/
public String getStringEntryValue(FieldTagType fieldTagType) {
String value = null;
Expand All @@ -1483,6 +1489,7 @@ public String getStringEntryValue(FieldTagType fieldTagType) {
* field tag type
* @param value
* string value
* @since 2.0.0
*/
public void setStringEntryValue(FieldTagType fieldTagType, String value) {
List<String> values = new ArrayList<>();
Expand All @@ -1496,6 +1503,7 @@ public void setStringEntryValue(FieldTagType fieldTagType, String value) {
* @param fieldTagType
* field tag type
* @return integer list value
* @since 2.0.0
*/
public List<Integer> getIntegerListEntryValue(FieldTagType fieldTagType) {
return getEntryValue(fieldTagType);
Expand All @@ -1505,7 +1513,10 @@ public List<Integer> getIntegerListEntryValue(FieldTagType fieldTagType) {
* Set an unsigned integer list of values for the field tag type
*
* @param fieldTagType
* field tag type
* @param value
* integer list value
* @since 2.0.0
*/
public void setUnsignedIntegerListEntryValue(FieldTagType fieldTagType,
List<Integer> value) {
Expand All @@ -1518,6 +1529,7 @@ public void setUnsignedIntegerListEntryValue(FieldTagType fieldTagType,
* @param fieldTagType
* field tag type
* @return max integer value
* @since 2.0.0
*/
public Integer getMaxIntegerEntryValue(FieldTagType fieldTagType) {
Integer maxValue = null;
Expand All @@ -1534,6 +1546,7 @@ public Integer getMaxIntegerEntryValue(FieldTagType fieldTagType) {
* @param fieldTagType
* field tag type
* @return long list value
* @since 2.0.0
*/
public List<Number> getNumberListEntryValue(FieldTagType fieldTagType) {
return getEntryValue(fieldTagType);
Expand All @@ -1545,6 +1558,7 @@ public List<Number> getNumberListEntryValue(FieldTagType fieldTagType) {
* @param fieldTagType
* field tag type
* @return long list value
* @since 2.0.0
*/
public List<Long> getLongListEntryValue(FieldTagType fieldTagType) {
return getEntryValue(fieldTagType);
Expand All @@ -1554,7 +1568,10 @@ public List<Long> getLongListEntryValue(FieldTagType fieldTagType) {
* Set an unsigned long list of values for the field tag type
*
* @param fieldTagType
* field tag type
* @param value
* long list value
* @since 2.0.0
*/
public void setUnsignedLongListEntryValue(FieldTagType fieldTagType,
List<Long> value) {
Expand Down
20 changes: 20 additions & 0 deletions src/main/java/mil/nga/tiff/Rasters.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public class Rasters {
* field type for each sample
* @param sampleValues
* empty sample values buffer array
* @since 2.0.0
*/
public Rasters(int width, int height, FieldType[] fieldTypes,
ByteBuffer[] sampleValues) {
Expand All @@ -86,6 +87,7 @@ public Rasters(int width, int height, FieldType[] fieldTypes,
* field type for each sample
* @param interleaveValues
* empty interleaved values buffer
* @since 2.0.0
*/
public Rasters(int width, int height, FieldType[] fieldTypes,
ByteBuffer interleaveValues) {
Expand All @@ -105,6 +107,7 @@ public Rasters(int width, int height, FieldType[] fieldTypes,
* empty sample values buffer array
* @param interleaveValues
* empty interleaved values buffer
* @since 2.0.0
*/
public Rasters(int width, int height, FieldType[] fieldTypes,
ByteBuffer[] sampleValues, ByteBuffer interleaveValues) {
Expand All @@ -129,6 +132,7 @@ public Rasters(int width, int height, FieldType[] fieldTypes,
* number of samples per pixel
* @param fieldType
* type of field for each sample
* @since 2.0.0
*/
public Rasters(int width, int height, int samplesPerPixel,
FieldType fieldType) {
Expand All @@ -150,6 +154,7 @@ public Rasters(int width, int height, int samplesPerPixel,
* type of field for each sample
* @param order
* byte order
* @since 2.0.0
*/
public Rasters(int width, int height, int samplesPerPixel,
FieldType fieldType, ByteOrder order) {
Expand All @@ -171,6 +176,7 @@ public Rasters(int width, int height, int samplesPerPixel,
* bits per samples
* @param sampleFormats
* sample formats
* @since 2.0.0
*/
public Rasters(int width, int height, int[] bitsPerSamples,
int[] sampleFormats) {
Expand All @@ -193,6 +199,7 @@ public Rasters(int width, int height, int[] bitsPerSamples,
* sample formats
* @param order
* byte order
* @since 2.0.0
*/
public Rasters(int width, int height, int[] bitsPerSamples,
int[] sampleFormats, ByteOrder order) {
Expand All @@ -216,6 +223,7 @@ public Rasters(int width, int height, int[] bitsPerSamples,
* bits per each sample
* @param sampleFormat
* format for each sample
* @since 2.0.0
*/
public Rasters(int width, int height, int samplesPerPixel,
int bitsPerSample, int sampleFormat) {
Expand All @@ -241,6 +249,7 @@ public Rasters(int width, int height, int samplesPerPixel,
* format for each sample
* @param order
* byte order
* @since 2.0.0
*/
public Rasters(int width, int height, int samplesPerPixel,
int bitsPerSample, int sampleFormat, ByteOrder order) {
Expand All @@ -257,6 +266,7 @@ public Rasters(int width, int height, int samplesPerPixel,
* height of pixels
* @param fieldTypes
* field types per sample
* @since 2.0.0
*/
public Rasters(int width, int height, FieldType[] fieldTypes) {
this(width, height, fieldTypes, ByteOrder.nativeOrder());
Expand All @@ -273,6 +283,7 @@ public Rasters(int width, int height, FieldType[] fieldTypes) {
* field types per sample
* @param order
* byte order
* @since 2.0.0
*/
public Rasters(int width, int height, FieldType[] fieldTypes,
ByteOrder order) {
Expand Down Expand Up @@ -425,6 +436,7 @@ public void addToSample(int sampleIndex, int coordinate, Number value) {
* coordinate location
* @param value
* value
* @since 2.0.0
*/
public void addToInterleave(int sampleIndex, int coordinate, Number value) {
int bufferPos = coordinate * sizePixel();
Expand Down Expand Up @@ -497,6 +509,7 @@ public List<Integer> getBitsPerSample() {
* sample list @see getFieldTypes(). @see {@link TiffConstants}
*
* @return list of sample type constants
* @since 2.0.0
*/
public List<Integer> getSampleFormat() {
List<Integer> result = sampleFormat;
Expand All @@ -514,6 +527,7 @@ public List<Integer> getSampleFormat() {
* Get the results stored by samples
*
* @return sample values
* @since 2.0.0
*/
public ByteBuffer[] getSampleValues() {
for (int i = 0; i < sampleValues.length; ++i) {
Expand All @@ -527,6 +541,7 @@ public ByteBuffer[] getSampleValues() {
*
* @param sampleValues
* sample values
* @since 2.0.0
*/
public void setSampleValues(ByteBuffer[] sampleValues) {
this.sampleValues = sampleValues;
Expand All @@ -540,6 +555,7 @@ public void setSampleValues(ByteBuffer[] sampleValues) {
* Get the results stored as interleaved pixel samples
*
* @return interleaved values
* @since 2.0.0
*/
public ByteBuffer getInterleaveValues() {
interleaveValues.rewind();
Expand All @@ -551,6 +567,7 @@ public ByteBuffer getInterleaveValues() {
*
* @param interleaveValues
* interleaved values
* @since 2.0.0
*/
public void setInterleaveValues(ByteBuffer interleaveValues) {
this.interleaveValues = interleaveValues;
Expand Down Expand Up @@ -634,6 +651,7 @@ public void setPixel(int x, int y, Number[] values) {
* @param newOrder
* Desired byte order of result byte array
* @return Byte array of pixel row
* @since 2.0.0
*/
public byte[] getPixelRow(int y, ByteOrder newOrder) {
ByteBuffer outBuffer = ByteBuffer.allocate(getWidth() * sizePixel());
Expand Down Expand Up @@ -672,6 +690,7 @@ public byte[] getPixelRow(int y, ByteOrder newOrder) {
* @param newOrder
* Desired byte order of resulting byte array
* @return Byte array of sample row
* @since 2.0.0
*/
public byte[] getSampleRow(int y, int sample, ByteOrder newOrder) {
ByteBuffer outBuffer = ByteBuffer.allocate(getWidth()
Expand Down Expand Up @@ -1067,6 +1086,7 @@ private void writeSample(ByteBuffer outBuffer, ByteBuffer inBuffer,
* Returns field types
*
* @return field types
* @since 2.0.0
*/
public FieldType[] getFieldTypes() {
return fieldTypes;
Expand Down

0 comments on commit 5541bfb

Please sign in to comment.