X-Git-Url: http://gitweb.fperrin.net/?p=GpsPrune.git;a=blobdiff_plain;f=tim%2Fprune%2Fjpeg%2Fdrew%2FTiffDataFormat.java;fp=tim%2Fprune%2Fjpeg%2Fdrew%2FTiffDataFormat.java;h=6c89fc3553c5ef6754108b75a5bf8339343e52c2;hp=0000000000000000000000000000000000000000;hb=92dad5df664287acb51728e9ea599f150765d34a;hpb=81843c3d8d0771bf00d0f26034a13aa515465c78 diff --git a/tim/prune/jpeg/drew/TiffDataFormat.java b/tim/prune/jpeg/drew/TiffDataFormat.java new file mode 100644 index 0000000..6c89fc3 --- /dev/null +++ b/tim/prune/jpeg/drew/TiffDataFormat.java @@ -0,0 +1,54 @@ +/* + * Copyright 2002-2015 Drew Noakes + * + * More information about this project is available at: + * + * https://drewnoakes.com/code/exif/ + * https://github.com/drewnoakes/metadata-extractor + */ +package tim.prune.jpeg.drew; + +/** + * An enumeration of data formats used by the TIFF specification. + * + * @author Drew Noakes https://drewnoakes.com + */ +public class TiffDataFormat +{ + public static final int CODE_INT8_U = 1; + public static final int CODE_STRING = 2; + public static final int CODE_INT16_U = 3; + public static final int CODE_INT32_U = 4; + public static final int CODE_RATIONAL_U = 5; + public static final int CODE_INT8_S = 6; + public static final int CODE_UNDEFINED = 7; + public static final int CODE_INT16_S = 8; + public static final int CODE_INT32_S = 9; + public static final int CODE_RATIONAL_S = 10; + public static final int CODE_SINGLE = 11; + public static final int CODE_DOUBLE = 12; + + public static int getComponentSize(int tiffFormatCode) + { + switch (tiffFormatCode) + { + case CODE_INT8_U: + case CODE_STRING: + case CODE_INT8_S: + case CODE_UNDEFINED: + return 1; + case CODE_INT16_U: + case CODE_INT16_S: + case CODE_INT32_U: + case CODE_INT32_S: + case CODE_SINGLE: + return 4; + case CODE_RATIONAL_U: + case CODE_RATIONAL_S: + case CODE_DOUBLE: + return 8; + default: + return 0; + } + } +}