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


Java ImageFormat.IMAGE_FORMAT_TIFF属性代码示例

本文整理汇总了Java中org.apache.sanselan.ImageFormat.IMAGE_FORMAT_TIFF属性的典型用法代码示例。如果您正苦于以下问题:Java ImageFormat.IMAGE_FORMAT_TIFF属性的具体用法?Java ImageFormat.IMAGE_FORMAT_TIFF怎么用?Java ImageFormat.IMAGE_FORMAT_TIFF使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.sanselan.ImageFormat的用法示例。


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

示例1: getImageFormat

private static ImageFormat getImageFormat(String ext){
    ImageFormat format = ImageFormat.IMAGE_FORMAT_PNG;
    switch(ext.toLowerCase()){
        case "gif":
            format = ImageFormat.IMAGE_FORMAT_GIF;
            break;
        case "jpeg":
        case "jpg":
            format = ImageFormat.IMAGE_FORMAT_JPEG;
            break;
        case "bmp":
            format = ImageFormat.IMAGE_FORMAT_BMP;
            break;
        case "tif":
        case "tiff":
            format = ImageFormat.IMAGE_FORMAT_TIFF;
            break;
    }
    return format;
}
 
开发者ID:meteoinfo,项目名称:MeteoInfoLib,代码行数:20,代码来源:ImageUtil.java

示例2: toSanselanFormat

public static ImageFormat toSanselanFormat(ImageInfo.Format format) {
	switch (format) {
	case BMP:
		return ImageFormat.IMAGE_FORMAT_BMP;
	case GIF: return ImageFormat.IMAGE_FORMAT_GIF;
	case ICO: return ImageFormat.IMAGE_FORMAT_ICO;
	case IFF: return null;
	case JPEG: return ImageFormat.IMAGE_FORMAT_JPEG;
	case PBM: return ImageFormat.IMAGE_FORMAT_PBM;
	case PPM: return ImageFormat.IMAGE_FORMAT_PPM;
	case PGM: return ImageFormat.IMAGE_FORMAT_PGM;
	case PCX: return null;
	case PNG: return ImageFormat.IMAGE_FORMAT_PNG;
	case PSD: return ImageFormat.IMAGE_FORMAT_PSD;
	case RAS: return null;
	case TIFF: return ImageFormat.IMAGE_FORMAT_TIFF;
	case WEBP: return null;
	default: return null;
	}
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:20,代码来源:ServiceImageIO.java

示例3: imageWriteExample

public static byte[] imageWriteExample(final File file)
		throws ImageReadException, ImageWriteException, IOException {
	// read image
	final BufferedImage image = Sanselan.getBufferedImage(file);
	final ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF;
	final Map<String, Object> params = new HashMap<String, Object>();

	// set optional parameters if you like
	params.put(SanselanConstants.PARAM_KEY_COMPRESSION, new Integer(
			TiffConstants.TIFF_COMPRESSION_UNCOMPRESSED));

	final byte[] bytes = Sanselan.writeImageToBytes(image, format, params);
	return bytes;
}
 
开发者ID:shaolinwu,项目名称:uimaster,代码行数:14,代码来源:ImageUtil.java

示例4: getRandomImage

private byte[] getRandomImage() throws IOException, ImageWriteException {
    int width = randomIntBetween(100, 1000);
    int height = randomIntBetween(100, 1000);
    BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    for (int j = 0; j < width; j ++) {
        for (int k = 0; k < height; k ++) {
            image.setRGB(j, k, randomInt(512));
        }
    }
    ImageFormat format = ImageFormat.IMAGE_FORMAT_TIFF;
    byte[] bytes = Sanselan.writeImageToBytes(image, format, Maps.newHashMap());
    return bytes;
}
 
开发者ID:kzwang,项目名称:elasticsearch-image,代码行数:13,代码来源:ImageIntegrationTests.java

示例5: getAcceptedTypes

protected ImageFormat[] getAcceptedTypes()
{
	return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_TIFF, //
	};
}
 
开发者ID:fulcrumapp,项目名称:sanselan-android,代码行数:5,代码来源:TiffImageParser.java

示例6: getAcceptedTypes

protected ImageFormat[] getAcceptedTypes()
{
    return new ImageFormat[] { ImageFormat.IMAGE_FORMAT_TIFF, //
    };
}
 
开发者ID:mike10004,项目名称:appengine-imaging,代码行数:5,代码来源:TiffImageParser.java


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