当前位置: 首页>>代码示例>>Java>>正文


Java TiffElement类代码示例

本文整理汇总了Java中org.apache.sanselan.formats.tiff.TiffElement的典型用法代码示例。如果您正苦于以下问题:Java TiffElement类的具体用法?Java TiffElement怎么用?Java TiffElement使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


TiffElement类属于org.apache.sanselan.formats.tiff包,在下文中一共展示了TiffElement类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: ImageDataOffsets

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public ImageDataOffsets(final TiffElement.DataElement imageData[],
		final int[] imageDataOffsets,
		final TiffOutputField imageDataOffsetsField)
{
	this.imageDataOffsets = imageDataOffsets;
	this.imageDataOffsetsField = imageDataOffsetsField;

	outputItems = new TiffOutputItem[imageData.length];
	for (int i = 0; i < imageData.length; i++)
	{
		TiffOutputItem item = new TiffOutputItem.Value("TIFF image data",
				imageData[i].data);
		outputItems[i] = item;
	}

}
 
开发者ID:fulcrumapp,项目名称:sanselan-android,代码行数:17,代码来源:ImageDataOffsets.java

示例2: ImageDataOffsets

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public ImageDataOffsets(final TiffElement.DataElement imageData[],
        final int[] imageDataOffsets,
        final TiffOutputField imageDataOffsetsField)
{
    this.imageDataOffsets = imageDataOffsets;
    this.imageDataOffsetsField = imageDataOffsetsField;

    outputItems = new TiffOutputItem[imageData.length];
    for (int i = 0; i < imageData.length; i++)
    {
        TiffOutputItem item = new TiffOutputItem.Value("TIFF image data",
                imageData[i].data);
        outputItems[i] = item;
    }

}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:17,代码来源:ImageDataOffsets.java

示例3: dumpElements

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
private void dumpElements(ByteSource byteSource, List elements)
		throws IOException
{
	int last = TIFF_HEADER_SIZE;
	for (int i = 0; i < elements.size(); i++)
	{
		TiffElement element = (TiffElement) elements.get(i);
		if (element.offset > last)
		{
			final int SLICE_SIZE = 32;
			int gepLength = element.offset - last;
			Debug.debug("gap of " + gepLength + " bytes.");
			byte bytes[] = byteSource.getBlock(last, gepLength);
			if (bytes.length > 2 * SLICE_SIZE)
			{
				Debug.debug("\t" + "head", BinaryFileFunctions.head(bytes,
						SLICE_SIZE));
				Debug.debug("\t" + "tail", BinaryFileFunctions.tail(bytes,
						SLICE_SIZE));
			}
			else
				Debug.debug("\t" + "bytes", bytes);
		}

		Debug.debug("element[" + i + "]:" + element.getElementDescription()
				+ " (" + element.offset + " + " + element.length + " = "
				+ (element.offset + element.length) + ")");
		if (element instanceof TiffDirectory)
		{
			TiffDirectory dir = (TiffDirectory) element;
			Debug.debug("\t" + "next Directory Offset: "
					+ dir.nextDirectoryOffset);
		}
		last = element.offset + element.length;
	}
	Debug.debug();
}
 
开发者ID:fulcrumapp,项目名称:sanselan-android,代码行数:38,代码来源:TiffImageWriterLossless.java

示例4: write

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public void write(OutputStream os, TiffOutputSet outputSet)
		throws IOException, ImageWriteException
{
	List analysis = analyzeOldTiff();
	int oldLength = exifBytes.length;
	if (analysis.size() < 1)
		throw new ImageWriteException("Couldn't analyze old tiff data.");
	else if (analysis.size() == 1)
	{
		TiffElement onlyElement = (TiffElement) analysis.get(0);
		//			Debug.debug("onlyElement", onlyElement.getElementDescription());
		if (onlyElement.offset == TIFF_HEADER_SIZE
				&& onlyElement.offset + onlyElement.length
						+ TIFF_HEADER_SIZE == oldLength)
		{
			// no gaps in old data, safe to complete overwrite.
			new TiffImageWriterLossy(byteOrder).write(os, outputSet);
			return;
		}
	}

	//		if (true)
	//			throw new ImageWriteException("hahah");

	//		List directories = outputSet.getDirectories();

	TiffOutputSummary outputSummary = validateDirectories(outputSet);

	List outputItems = outputSet.getOutputItems(outputSummary);

	int outputLength = updateOffsetsStep(analysis, outputItems);
	//		Debug.debug("outputLength", outputLength);

	outputSummary.updateOffsets(byteOrder);

	writeStep(os, outputSet, analysis, outputItems, outputLength);

}
 
开发者ID:fulcrumapp,项目名称:sanselan-android,代码行数:39,代码来源:TiffImageWriterLossless.java

示例5: dumpElements

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
private void dumpElements(ByteSource byteSource, List elements)
        throws IOException
{
    int last = TIFF_HEADER_SIZE;
    for (int i = 0; i < elements.size(); i++)
    {
        TiffElement element = (TiffElement) elements.get(i);
        if (element.offset > last)
        {
            final int SLICE_SIZE = 32;
            int gepLength = element.offset - last;
            Debug.debug("gap of " + gepLength + " bytes.");
            byte bytes[] = byteSource.getBlock(last, gepLength);
            if (bytes.length > 2 * SLICE_SIZE)
            {
                Debug.debug("\t" + "head", BinaryFileFunctions.head(bytes,
                        SLICE_SIZE));
                Debug.debug("\t" + "tail", BinaryFileFunctions.tail(bytes,
                        SLICE_SIZE));
            }
            else
                Debug.debug("\t" + "bytes", bytes);
        }

        Debug.debug("element[" + i + "]:" + element.getElementDescription()
                + " (" + element.offset + " + " + element.length + " = "
                + (element.offset + element.length) + ")");
        if (element instanceof TiffDirectory)
        {
            TiffDirectory dir = (TiffDirectory) element;
            Debug.debug("\t" + "next Directory Offset: "
                    + dir.nextDirectoryOffset);
        }
        last = element.offset + element.length;
    }
    Debug.debug();
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:38,代码来源:TiffImageWriterLossless.java

示例6: write

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public void write(OutputStream os, TiffOutputSet outputSet)
        throws IOException, ImageWriteException
{
    List analysis = analyzeOldTiff();
    int oldLength = exifBytes.length;
    if (analysis.size() < 1)
        throw new ImageWriteException("Couldn't analyze old tiff data.");
    else if (analysis.size() == 1)
    {
        TiffElement onlyElement = (TiffElement) analysis.get(0);
        //            Debug.debug("onlyElement", onlyElement.getElementDescription());
        if (onlyElement.offset == TIFF_HEADER_SIZE
                && onlyElement.offset + onlyElement.length
                        + TIFF_HEADER_SIZE == oldLength)
        {
            // no gaps in old data, safe to complete overwrite.
            new TiffImageWriterLossy(byteOrder).write(os, outputSet);
            return;
        }
    }

    //        if (true)
    //            throw new ImageWriteException("hahah");

    //        List directories = outputSet.getDirectories();

    TiffOutputSummary outputSummary = validateDirectories(outputSet);

    List outputItems = outputSet.getOutputItems(outputSummary);

    int outputLength = updateOffsetsStep(analysis, outputItems);
    //        Debug.debug("outputLength", outputLength);

    outputSummary.updateOffsets(byteOrder);

    writeStep(os, outputSet, analysis, outputItems, outputLength);

}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:39,代码来源:TiffImageWriterLossless.java

示例7: compare

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public int compare(Object o1, Object o2)
{
	TiffElement e1 = (TiffElement) o1;
	TiffElement e2 = (TiffElement) o2;
	return e1.length - e2.length;
}
 
开发者ID:fulcrumapp,项目名称:sanselan-android,代码行数:7,代码来源:TiffImageWriterLossless.java

示例8: compare

import org.apache.sanselan.formats.tiff.TiffElement; //导入依赖的package包/类
public int compare(Object o1, Object o2)
{
    TiffElement e1 = (TiffElement) o1;
    TiffElement e2 = (TiffElement) o2;
    return e1.length - e2.length;
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:7,代码来源:TiffImageWriterLossless.java


注:本文中的org.apache.sanselan.formats.tiff.TiffElement类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。