本文整理匯總了Java中org.apache.sanselan.formats.tiff.TiffDirectory.ImageDataElement類的典型用法代碼示例。如果您正苦於以下問題:Java ImageDataElement類的具體用法?Java ImageDataElement怎麽用?Java ImageDataElement使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ImageDataElement類屬於org.apache.sanselan.formats.tiff.TiffDirectory包,在下文中一共展示了ImageDataElement類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getJpegRawImageData
import org.apache.sanselan.formats.tiff.TiffDirectory.ImageDataElement; //導入依賴的package包/類
private JpegImageData getJpegRawImageData(ByteSource byteSource,
TiffDirectory directory) throws ImageReadException, IOException
{
ImageDataElement element = directory.getJpegRawImageDataElement();
int offset = element.offset;
int length = element.length;
// Sony DCR-PC110 has an off-by-one error.
if (offset + length == byteSource.getLength() + 1)
length--;
byte data[] = byteSource.getBlock(offset, length);
return new JpegImageData(offset, length, data);
}
示例2: getTiffRawImageData
import org.apache.sanselan.formats.tiff.TiffDirectory.ImageDataElement; //導入依賴的package包/類
private TiffImageData getTiffRawImageData(ByteSource byteSource,
TiffDirectory directory) throws ImageReadException, IOException
{
ArrayList elements = directory.getTiffRawImageDataElements();
TiffImageData.Data data[] = new TiffImageData.Data[elements.size()];
for (int i = 0; i < elements.size(); i++)
{
TiffDirectory.ImageDataElement element = (TiffDirectory.ImageDataElement) elements
.get(i);
byte bytes[] = byteSource.getBlock(element.offset, element.length);
data[i] = new TiffImageData.Data(element.offset, element.length,
bytes);
}
if (directory.imageDataInStrips())
{
TiffField rowsPerStripField = directory
.findField(TIFF_TAG_ROWS_PER_STRIP);
if (null == rowsPerStripField)
throw new ImageReadException("Can't find rows per strip field.");
int rowsPerStrip = rowsPerStripField.getIntValue();
return new TiffImageData.Strips(data, rowsPerStrip);
} else
{
TiffField tileWidthField = directory.findField(TIFF_TAG_TILE_WIDTH);
if (null == tileWidthField)
throw new ImageReadException("Can't find tile width field.");
int tileWidth = tileWidthField.getIntValue();
TiffField tileLengthField = directory
.findField(TIFF_TAG_TILE_LENGTH);
if (null == tileLengthField)
throw new ImageReadException("Can't find tile length field.");
int tileLength = tileLengthField.getIntValue();
return new TiffImageData.Tiles(data, tileWidth, tileLength);
}
}
示例3: getJpegRawImageData
import org.apache.sanselan.formats.tiff.TiffDirectory.ImageDataElement; //導入依賴的package包/類
private JpegImageData getJpegRawImageData(ByteSource byteSource,
TiffDirectory directory) throws ImageReadException, IOException
{
ImageDataElement element = directory.getJpegRawImageDataElement();
int offset = element.offset;
int length = element.length;
// Sony DCR-PC110 has an off-by-one error.
if (offset + length == byteSource.getLength() + 1)
length--;
byte data[] = byteSource.getBlock(offset, length);
return new JpegImageData(offset, length, data);
}