com.octo.captcha.component.image.wordtoimage
Class FilteredComposedWordToImage
java.lang.Object
com.octo.captcha.component.image.wordtoimage.AbstractWordToImage
com.octo.captcha.component.image.wordtoimage.ComposedWordToImage
com.octo.captcha.component.image.wordtoimage.FilteredComposedWordToImage
- All Implemented Interfaces:
- WordToImage
Deprecated. since beta-4 : use DeformedComposedWordToImage, that now use the new deformation component.
public class FilteredComposedWordToImage
- extends ComposedWordToImage
This implementation uses filters to distord the image. It takes three array of filters : for the background
image, for the text only, and for the final image it proceeds as folows :
- Checks the word length
- Creates an java.text.AttributedString from the word
- Create an image for the background using the abstact
method getBackround
- Apply background filters
- Apply font to the AttributedString using the abstract
method getFont
- Create a transparent backround
- Put the text on the transparent backround using the
abstact method pasteText
- Apply the text filters
- Paste the transparent image using an alpha
composite
- Apply the final filters
- Return the newly created image
|
Method Summary |
java.awt.image.BufferedImage |
getImage(java.lang.String word)
Deprecated. Creates an image of the provided String This method is a skeleton for creation algorithm. it proceeds as folows :
Checks the word length Creates an java.text.AttributedString from the word Create an
image for the background using the abstact method getBackround Apply background filters Apply
font to the AttributedString using the abstract method getFont Create a transparent backround
Put the text on the transparent backround using the abstact method pasteText Apply the text filters
Paste the transparent image using an alpha composite Apply the final filters Return
the newly created image |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FilteredComposedWordToImage
public FilteredComposedWordToImage(FontGenerator fontGenerator,
BackgroundGenerator background,
TextPaster textPaster,
java.awt.image.ImageFilter[] backgroundFilters,
java.awt.image.ImageFilter[] textFilters,
java.awt.image.ImageFilter[] finalFilters)
- Deprecated.
- Composed word to image that applys filters
- Parameters:
fontGenerator - a AbstractFontGenerator to implement the getFont() methodbackground - a AbstractBackgroundGenerator to implement the getBackround() methodtextPaster - a AbstractTextParser to implement the pasteText() methodbackgroundFilters - to be apply on the background imagetextFilters - to be apply on the text imagefinalFilters - to be apply on the final image
getImage
public java.awt.image.BufferedImage getImage(java.lang.String word)
throws CaptchaException
- Deprecated.
- Creates an image of the provided String This method is a skeleton for creation algorithm. it proceeds as folows :
- Checks the word length
- Creates an java.text.AttributedString from the word
- Create an
image for the background using the abstact method getBackround
- Apply background filters
- Apply
font to the AttributedString using the abstract method getFont
- Create a transparent backround
- Put the text on the transparent backround using the abstact method pasteText
- Apply the text filters
- Paste the transparent image using an alpha composite
- Apply the final filters
- Return
the newly created image
- Specified by:
getImage in interface WordToImage- Overrides:
getImage in class AbstractWordToImage
- Returns:
- an image representation of the word
- Throws:
CaptchaException - if word is invalid or if image generation fails.
Copyright 2003-2009 JCaptcha. All Rights Reserved.