play.libs
Class Images.Captcha

java.lang.Object
  extended by java.io.InputStream
      extended by play.libs.Images.Captcha
All Implemented Interfaces:
Closeable
Enclosing class:
Images

public static class Images.Captcha
extends InputStream

A captcha image.


Field Summary
 play.ns.nl.captcha.backgrounds.BackgroundProducer background
           
 List<Font> fonts
           
 play.ns.nl.captcha.gimpy.GimpyRenderer gimpy
           
 int h
           
 Color noise
           
 String text
           
 Color textColor
           
 int w
           
 
Constructor Summary
Images.Captcha(int w, int h)
           
 
Method Summary
 Images.Captcha addNoise()
          Add noise to the captcha.
 Images.Captcha addNoise(String color)
          Add noise to the captcha.
 String getText()
          Tell the captche to draw a text and retrieve it
 String getText(int length)
          Tell the captche to draw a text of the specified size and retrieve it
 String getText(int length, String chars)
           
 String getText(String color)
          Tell the captche to draw a text using the specified color (ex.
 String getText(String color, int length)
          Tell the captche to draw a text of the specified size using the specified color (ex.
 String getText(String color, int length, String chars)
           
 int read()
           
 int read(byte[] b)
           
 Images.Captcha setBackground(String color)
          Set a solid background.
 Images.Captcha setBackground(String from, String to)
          Set a gradient background.
 Images.Captcha setSquigglesBackground()
          Set a squiggles background
 
Methods inherited from class java.io.InputStream
available, close, mark, markSupported, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

text

public String text

background

public play.ns.nl.captcha.backgrounds.BackgroundProducer background

gimpy

public play.ns.nl.captcha.gimpy.GimpyRenderer gimpy

textColor

public Color textColor

fonts

public List<Font> fonts

w

public int w

h

public int h

noise

public Color noise
Constructor Detail

Images.Captcha

public Images.Captcha(int w,
                      int h)
Method Detail

getText

public String getText()
Tell the captche to draw a text and retrieve it


getText

public String getText(String color)
Tell the captche to draw a text using the specified color (ex. #000000) and retrieve it


getText

public String getText(int length)
Tell the captche to draw a text of the specified size and retrieve it


getText

public String getText(String color,
                      int length)
Tell the captche to draw a text of the specified size using the specified color (ex. #000000) and retrieve it


getText

public String getText(int length,
                      String chars)

getText

public String getText(String color,
                      int length,
                      String chars)

addNoise

public Images.Captcha addNoise()
Add noise to the captcha.


addNoise

public Images.Captcha addNoise(String color)
Add noise to the captcha.


setBackground

public Images.Captcha setBackground(String from,
                                    String to)
Set a gradient background.


setBackground

public Images.Captcha setBackground(String color)
Set a solid background.


setSquigglesBackground

public Images.Captcha setSquigglesBackground()
Set a squiggles background


read

public int read()
         throws IOException
Specified by:
read in class InputStream
Throws:
IOException

read

public int read(byte[] b)
         throws IOException
Overrides:
read in class InputStream
Throws:
IOException


Guillaume Bort & zenexity - Distributed under Apache 2 licence, without any warrantly