當前位置: 首頁>>代碼示例>>Java>>正文


Java ImageDataElement類代碼示例

本文整理匯總了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);
}
 
開發者ID:fulcrumapp,項目名稱:sanselan-android,代碼行數:13,代碼來源:TiffReader.java

示例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);
    }
}
 
開發者ID:mike10004,項目名稱:appengine-imaging,代碼行數:41,代碼來源:TiffReader.java

示例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);
}
 
開發者ID:mike10004,項目名稱:appengine-imaging,代碼行數:13,代碼來源:TiffReader.java


注:本文中的org.apache.sanselan.formats.tiff.TiffDirectory.ImageDataElement類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。