mirror of
https://github.com/haraldk/TwelveMonkeys.git
synced 2025-08-05 12:35:29 -04:00
TMI-139: Support for writing TIFF files with custom resolution value (made TIFFImageMetadata class public).
This commit is contained in:
parent
c913ef445b
commit
61b07cb9cb
@ -27,20 +27,45 @@ import java.util.*;
|
|||||||
* @author last modified by $Author: harald.kuhr$
|
* @author last modified by $Author: harald.kuhr$
|
||||||
* @version $Id: TIFFImageMetadata.java,v 1.0 17/04/15 harald.kuhr Exp$
|
* @version $Id: TIFFImageMetadata.java,v 1.0 17/04/15 harald.kuhr Exp$
|
||||||
*/
|
*/
|
||||||
final class TIFFImageMetadata extends AbstractMetadata {
|
public final class TIFFImageMetadata extends AbstractMetadata {
|
||||||
|
|
||||||
static final int RATIONAL_SCALE_FACTOR = 100000;
|
static final int RATIONAL_SCALE_FACTOR = 100000;
|
||||||
|
|
||||||
private final Directory original;
|
private final Directory original;
|
||||||
private Directory ifd;
|
private Directory ifd;
|
||||||
|
|
||||||
TIFFImageMetadata(final Directory ifd) {
|
/**
|
||||||
|
* Creates an empty TIFF metadata object.
|
||||||
|
*
|
||||||
|
* Client code can update or change the metadata using the
|
||||||
|
* {@link #setFromTree(String, Node)}
|
||||||
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
|
*/
|
||||||
|
public TIFFImageMetadata() {
|
||||||
|
this(new TIFFIFD(Collections.<Entry>emptyList()));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Creates a TIFF metadata object, using the values from the given IFD.
|
||||||
|
*
|
||||||
|
* Client code can update or change the metadata using the
|
||||||
|
* {@link #setFromTree(String, Node)}
|
||||||
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
|
*/
|
||||||
|
public TIFFImageMetadata(final Directory ifd) {
|
||||||
super(true, TIFFMedataFormat.SUN_NATIVE_IMAGE_METADATA_FORMAT_NAME, TIFFMedataFormat.class.getName(), null, null);
|
super(true, TIFFMedataFormat.SUN_NATIVE_IMAGE_METADATA_FORMAT_NAME, TIFFMedataFormat.class.getName(), null, null);
|
||||||
this.ifd = Validate.notNull(ifd, "IFD");
|
this.ifd = Validate.notNull(ifd, "IFD");
|
||||||
this.original = ifd;
|
this.original = ifd;
|
||||||
}
|
}
|
||||||
|
|
||||||
TIFFImageMetadata(final Collection<Entry> entries) {
|
/**
|
||||||
|
* Creates a TIFF metadata object, using the values from the given entries.
|
||||||
|
*
|
||||||
|
* Client code can update or change the metadata using the
|
||||||
|
* {@link #setFromTree(String, Node)}
|
||||||
|
* or {@link #mergeTree(String, Node)} methods.
|
||||||
|
*/
|
||||||
|
public TIFFImageMetadata(final Collection<Entry> entries) {
|
||||||
this(new TIFFIFD(entries));
|
this(new TIFFIFD(entries));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user