Package railo.runtime.img.filter

Examples of railo.runtime.img.filter.MarbleFilter


  public static final int DIFFICULTY_LOW=0;
  public static final int DIFFICULTY_MEDIUM=1;
  public static final int DIFFICULTY_HIGH=2;

  public BufferedImage generate(String text,int width, int height, String[] fonts, boolean useAntiAlias, Color fontColor,int fontSize, int difficulty) throws CaptchaException {
    MarbleFilter mf = new MarbleFilter();
    try {
      mf.setEdgeAction("WRAP");
    } catch (ExpressionException e1) {}
    mf.setAmount(0.1F);
    BufferedImage src=super.generate(text, width, height, fonts, useAntiAlias, fontColor, fontSize, difficulty);
   
    if(difficulty==DIFFICULTY_LOW) mf.setTurbulence(0.0f);
    else if(difficulty==DIFFICULTY_MEDIUM) mf.setTurbulence(0.10f);
    else mf.setTurbulence(0.2f);
   
    try {
      mf.setInterpolation("NEAREST_NEIGHBOUR");
    } catch (ExpressionException e) {}
   
    BufferedImage dst = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    mf.filter(src, dst);
    return dst;
  }
View Full Code Here

TOP

Related Classes of railo.runtime.img.filter.MarbleFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.