本文整理汇总了Java中com.jhlabs.image.ShadowFilter.filter方法的典型用法代码示例。如果您正苦于以下问题:Java ShadowFilter.filter方法的具体用法?Java ShadowFilter.filter怎么用?Java ShadowFilter.filter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.jhlabs.image.ShadowFilter
的用法示例。
在下文中一共展示了ShadowFilter.filter方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getDistortedImage
import com.jhlabs.image.ShadowFilter; //导入方法依赖的package包/类
/**
* Applies distortion by adding shadow to the text and also two noises.
*
* @param baseImage the base image
* @return the distorted image
*/
public BufferedImage getDistortedImage(BufferedImage baseImage)
{
NoiseProducer noiseProducer = getConfig().getNoiseImpl();
BufferedImage distortedImage = new BufferedImage(baseImage.getWidth(),
baseImage.getHeight(), BufferedImage.TYPE_INT_ARGB);
Graphics2D graph = (Graphics2D) distortedImage.getGraphics();
ShadowFilter shadowFilter = new ShadowFilter();
shadowFilter.setRadius(10);
shadowFilter.setDistance(5);
shadowFilter.setOpacity(1);
Random rand = new Random();
RippleFilter rippleFilter = new RippleFilter();
rippleFilter.setWaveType(RippleFilter.SINE);
rippleFilter.setXAmplitude(7.6f);
rippleFilter.setYAmplitude(rand.nextFloat() + 1.0f);
rippleFilter.setXWavelength(rand.nextInt(7) + 8);
rippleFilter.setYWavelength(rand.nextInt(3) + 2);
rippleFilter.setEdgeAction(TransformFilter.BILINEAR);
BufferedImage effectImage = rippleFilter.filter(baseImage, null);
effectImage = shadowFilter.filter(effectImage, null);
graph.drawImage(effectImage, 0, 0, null, null);
graph.dispose();
// draw lines over the image and/or text
noiseProducer.makeNoise(distortedImage, .1f, .1f, .25f, .25f);
noiseProducer.makeNoise(distortedImage, .1f, .25f, .5f, .9f);
return distortedImage;
}
示例2: gimp
import com.jhlabs.image.ShadowFilter; //导入方法依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
public void gimp(BufferedImage image) {
ShadowFilter sFilter = new ShadowFilter();
sFilter.setRadius(_radius);
sFilter.setOpacity(_opacity);
sFilter.filter(image, image);
}