本文整理汇总了Java中net.coobird.thumbnailator.resizers.BicubicResizer类的典型用法代码示例。如果您正苦于以下问题:Java BicubicResizer类的具体用法?Java BicubicResizer怎么用?Java BicubicResizer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BicubicResizer类属于net.coobird.thumbnailator.resizers包,在下文中一共展示了BicubicResizer类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: makeResizer
import net.coobird.thumbnailator.resizers.BicubicResizer; //导入依赖的package包/类
/**
* Returns a {@link Resizer} which is suitable for the current
* builder state.
*
* @param mode The scaling mode to use to create thumbnails.
* @return The {@link Resizer} which is suitable for the
* specified scaling mode and builder state.
*/
private Resizer makeResizer(ScalingMode mode)
{
Map<RenderingHints.Key, Object> hints =
new HashMap<RenderingHints.Key, Object>();
hints.put(RenderingHints.KEY_ALPHA_INTERPOLATION, alphaInterpolation.getValue());
hints.put(RenderingHints.KEY_DITHERING, dithering.getValue());
hints.put(RenderingHints.KEY_ANTIALIASING, antialiasing.getValue());
hints.put(RenderingHints.KEY_RENDERING, rendering.getValue());
if (mode == ScalingMode.BILINEAR)
{
return new BilinearResizer(hints);
}
else if (mode == ScalingMode.BICUBIC)
{
return new BicubicResizer(hints);
}
else if (mode == ScalingMode.PROGRESSIVE_BILINEAR)
{
return new ProgressiveBilinearResizer(hints);
}
else
{
return new ProgressiveBilinearResizer(hints);
}
}