com.octo.captcha.component.image.wordtoimage
Class FilteredComposedWordToImage

java.lang.Object
  extended by com.octo.captcha.component.image.wordtoimage.AbstractWordToImage
      extended by com.octo.captcha.component.image.wordtoimage.ComposedWordToImage
          extended by 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 :


Constructor Summary
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
 
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 com.octo.captcha.component.image.wordtoimage.ComposedWordToImage
getImageHeight, getImageWidth, getMaxAcceptedWordLenght, getMaxAcceptedWordLength, getMinAcceptedWordLenght, getMinAcceptedWordLength, getMinFontSize
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

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() method
background - a AbstractBackgroundGenerator to implement the getBackround() method
textPaster - a AbstractTextParser to implement the pasteText() method
backgroundFilters - to be apply on the background image
textFilters - to be apply on the text image
finalFilters - to be apply on the final image
Method Detail

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 :

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.