本文整理汇总了Java中java.awt.RenderingHints.VALUE_COLOR_RENDER_QUALITY属性的典型用法代码示例。如果您正苦于以下问题:Java RenderingHints.VALUE_COLOR_RENDER_QUALITY属性的具体用法?Java RenderingHints.VALUE_COLOR_RENDER_QUALITY怎么用?Java RenderingHints.VALUE_COLOR_RENDER_QUALITY使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类java.awt.RenderingHints
的用法示例。
在下文中一共展示了RenderingHints.VALUE_COLOR_RENDER_QUALITY属性的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: copyraster
/**
* Copy a source raster to a destination raster, performing a colorspace
* conversion between the two. The conversion will respect the
* KEY_COLOR_RENDERING rendering hint if one is present.
*
* @param src The source raster.
* @param scs The colorspace of the source raster.
* @dst The destination raster.
* @dcs The colorspace of the destination raster.
*/
private void copyraster(Raster src, ColorSpace scs, WritableRaster dst, ColorSpace dcs)
{
float[] sbuf = new float[src.getNumBands()];
if (hints != null
&& hints.get(RenderingHints.KEY_COLOR_RENDERING) ==
RenderingHints.VALUE_COLOR_RENDER_QUALITY)
{
// use cie for accuracy
for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
dst.setPixel(x, y,
dcs.fromCIEXYZ(scs.toCIEXYZ(src.getPixel(x, y, sbuf))));
}
else
{
// use rgb - it's probably faster
for (int y = src.getMinY(); y < src.getHeight() + src.getMinY(); y++)
for (int x = src.getMinX(); x < src.getWidth() + src.getMinX(); x++)
dst.setPixel(x, y,
dcs.fromRGB(scs.toRGB(src.getPixel(x, y, sbuf))));
}
}