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


Java ShadowFilter类代码示例

本文整理汇总了Java中com.jhlabs.image.ShadowFilter的典型用法代码示例。如果您正苦于以下问题:Java ShadowFilter类的具体用法?Java ShadowFilter怎么用?Java ShadowFilter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ShadowFilter类属于com.jhlabs.image包,在下文中一共展示了ShadowFilter类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
 
开发者ID:ycaihua,项目名称:kaptcha,代码行数:42,代码来源:ShadowGimpy.java

示例2: gimp

import com.jhlabs.image.ShadowFilter; //导入依赖的package包/类
@Override
public void gimp(BufferedImage image) {
    ShadowFilter sFilter = new ShadowFilter();
    sFilter.setRadius(_radius);
    sFilter.setOpacity(_opacity);
    applyFilter(image, sFilter);
}
 
开发者ID:rookiefly,项目名称:simplecaptcha,代码行数:8,代码来源:DropShadowGimpyRenderer.java

示例3: 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);
}
 
开发者ID:icode,项目名称:ameba-utils,代码行数:11,代码来源:DropShadowGimpyRenderer.java

示例4: createFilterList

import com.jhlabs.image.ShadowFilter; //导入依赖的package包/类
/**
 * Create and return model for filter selection combobox.
 * 
 * @return
 */
private ComboBoxModel createFilterList() {
    DefaultComboBoxModel model = new DefaultComboBoxModel();
    model.addElement(new DisplayInfo<BufferedImageOp>("- none - ", null));
    model.addElement(new DisplayInfo<BufferedImageOp>(new AverageFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BlockFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BorderFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BoxBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new BumpFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ChromeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ContrastFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new CrystallizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DespeckleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DiffuseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DiffusionFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DilateFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DisplaceFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new DitherFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EdgeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EmbossFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new EqualizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ErodeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new FlareFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GainFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GammaFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GaussianFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GlintFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GlowFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new GrayFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new InvertFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new InvertAlphaFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LensBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LevelsFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new LifeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MarbleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MarbleTexFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MedianFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MinimumFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MirrorFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new MotionBlurFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new NoiseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OilFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OpacityFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new OutlineFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new PointillizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new PosterizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new QuantizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new RaysFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ReduceNoiseFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new RippleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ShadowFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SharpenFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SkeletonFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SmearFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SolarizeFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SparkleFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SphereFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new SwimFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new ThresholdFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new TwirlFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new UnsharpFilter()));
    model.addElement(new DisplayInfo<BufferedImageOp>(new WaterFilter()));
    return model;
}
 
开发者ID:RockManJoe64,项目名称:swingx,代码行数:70,代码来源:PainterDemo.java


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