本文整理汇总了Java中org.apache.sanselan.formats.jpeg.JpegImageParser.readSegments方法的典型用法代码示例。如果您正苦于以下问题:Java JpegImageParser.readSegments方法的具体用法?Java JpegImageParser.readSegments怎么用?Java JpegImageParser.readSegments使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.apache.sanselan.formats.jpeg.JpegImageParser
的用法示例。
在下文中一共展示了JpegImageParser.readSegments方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkAdobeMarker
import org.apache.sanselan.formats.jpeg.JpegImageParser; //导入方法依赖的package包/类
/**
* Check Adobe markers in File
* @param file
* @throws IOException
* @throws ImageReadException
*/
public void checkAdobeMarker(File file) throws IOException, ImageReadException {
JpegImageParser parser = new JpegImageParser();
ByteSource byteSource = new ByteSourceFile(file);
@SuppressWarnings("rawtypes")
ArrayList segments = parser.readSegments(byteSource, new int[] { 0xffee }, true);
if (segments != null && segments.size() >= 1) {
UnknownSegment app14Segment = (UnknownSegment) segments.get(0);
byte[] data = app14Segment.bytes;
if (data.length >= 12 && data[0] == 'A' && data[1] == 'd' && data[2] == 'o' && data[3] == 'b' && data[4] == 'e')
{
hasAdobeMarker = true;
int transform = app14Segment.bytes[11] & 0xff;
if (transform == 2)
colorType = COLOR_TYPE_YCCK;
}
}
}
示例2: checkAdobeMarker
import org.apache.sanselan.formats.jpeg.JpegImageParser; //导入方法依赖的package包/类
public static void checkAdobeMarker(File file) throws IOException, ImageReadException {
JpegImageParser parser = new JpegImageParser();
ByteSource byteSource = new ByteSourceFile(file);
@SuppressWarnings("rawtypes")
ArrayList segments = parser.readSegments(byteSource, new int[] { 0xffee }, true);
if (segments != null && segments.size() >= 1) {
UnknownSegment app14Segment = (UnknownSegment) segments.get(0);
byte[] data = app14Segment.bytes;
if (data.length >= 12 && data[0] == 'A' && data[1] == 'd' && data[2] == 'o' && data[3] == 'b' && data[4] == 'e')
{
hasAdobeMarker = true;
int transform = app14Segment.bytes[11] & 0xff;
if (transform == 2)
colorType = COLOR_TYPE_YCCK;
}
}
}
示例3: checkAdobeMarker
import org.apache.sanselan.formats.jpeg.JpegImageParser; //导入方法依赖的package包/类
private void checkAdobeMarker(File file) throws IOException, ImageReadException {
JpegImageParser parser = new JpegImageParser();
ByteSource byteSource = new ByteSourceFile(file);
@SuppressWarnings("rawtypes")
List segments = parser.readSegments(byteSource, new int[]{0xffee}, true);
if (segments != null && !segments.isEmpty()) {
UnknownSegment app14Segment = (UnknownSegment) segments.get(0);
byte[] data = app14Segment.bytes;
if (data.length >= 12 && data[0] == 'A' && data[1] == 'd' && data[2] == 'o' && data[3] == 'b' && data[4] == 'e') {
hasAdobeMarker = Boolean.TRUE;
int transform = app14Segment.bytes[11] & 0xff;
if (transform == 2) {
colorType = COLOR_TYPE_YCCK;
}
}
}
}