本文整理匯總了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))));
}
}