本文整理匯總了Java中mil.nga.tiff.util.TiffConstants.COMPRESSION_NO屬性的典型用法代碼示例。如果您正苦於以下問題:Java TiffConstants.COMPRESSION_NO屬性的具體用法?Java TiffConstants.COMPRESSION_NO怎麽用?Java TiffConstants.COMPRESSION_NO使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類mil.nga.tiff.util.TiffConstants
的用法示例。
在下文中一共展示了TiffConstants.COMPRESSION_NO屬性的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getEncoder
/**
* Get the compression encoder
*
* @param fileDirectory
* file directory
* @return encoder
*/
@SuppressWarnings("deprecation")
private static CompressionEncoder getEncoder(FileDirectory fileDirectory) {
CompressionEncoder encoder = null;
// Determine the encoder based upon the compression
Integer compression = fileDirectory.getCompression();
if (compression == null) {
compression = TiffConstants.COMPRESSION_NO;
}
switch (compression) {
case TiffConstants.COMPRESSION_NO:
encoder = new RawCompression();
break;
case TiffConstants.COMPRESSION_CCITT_HUFFMAN:
throw new TiffException("CCITT Huffman compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_T4:
throw new TiffException("T4-encoding compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_T6:
throw new TiffException("T6-encoding compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_LZW:
encoder = new LZWCompression();
break;
case TiffConstants.COMPRESSION_JPEG_OLD:
case TiffConstants.COMPRESSION_JPEG_NEW:
throw new TiffException("JPEG compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_DEFLATE:
case TiffConstants.COMPRESSION_PKZIP_DEFLATE:
encoder = new DeflateCompression();
break;
case TiffConstants.COMPRESSION_PACKBITS:
encoder = new PackbitsCompression();
break;
default:
throw new TiffException("Unknown compression method identifier: "
+ compression);
}
return encoder;
}
示例2: FileDirectory
/**
* Constructor, for reading TIFF files
*
* @param entries
* file directory entries
* @param reader
* TIFF file byte reader
* @param cacheData
* true to cache tiles and strips
*/
public FileDirectory(SortedSet<FileDirectoryEntry> entries,
ByteReader reader, boolean cacheData) {
// Set the entries and the field tag type mapping
this.entries = entries;
for (FileDirectoryEntry entry : entries) {
fieldTagTypeMapping.put(entry.getFieldTag(), entry);
}
this.reader = reader;
// Set the cache
setCache(cacheData);
// Determine if tiled
tiled = getRowsPerStrip() == null;
// Determine and validate the planar configuration
Integer pc = getPlanarConfiguration();
planarConfiguration = pc != null ? pc
: TiffConstants.PLANAR_CONFIGURATION_CHUNKY;
if (planarConfiguration != TiffConstants.PLANAR_CONFIGURATION_CHUNKY
&& planarConfiguration != TiffConstants.PLANAR_CONFIGURATION_PLANAR) {
throw new TiffException("Invalid planar configuration: "
+ planarConfiguration);
}
// Determine the decoder based upon the compression
Integer compression = getCompression();
if (compression == null) {
compression = TiffConstants.COMPRESSION_NO;
}
switch (compression) {
case TiffConstants.COMPRESSION_NO:
decoder = new RawCompression();
break;
case TiffConstants.COMPRESSION_CCITT_HUFFMAN:
throw new TiffException("CCITT Huffman compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_T4:
throw new TiffException("T4-encoding compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_T6:
throw new TiffException("T6-encoding compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_LZW:
decoder = new LZWCompression();
break;
case TiffConstants.COMPRESSION_JPEG_OLD:
case TiffConstants.COMPRESSION_JPEG_NEW:
throw new TiffException("JPEG compression not supported: "
+ compression);
case TiffConstants.COMPRESSION_DEFLATE:
case TiffConstants.COMPRESSION_PKZIP_DEFLATE:
decoder = new DeflateCompression();
break;
case TiffConstants.COMPRESSION_PACKBITS:
decoder = new PackbitsCompression();
break;
default:
throw new TiffException("Unknown compression method identifier: "
+ compression);
}
}