|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.octo.captcha.component.image.wordtoimage.AbstractWordToImage com.octo.captcha.component.image.wordtoimage.ComposedWordToImage com.octo.captcha.component.image.wordtoimage.DeformedComposedWordToImage
public class DeformedComposedWordToImage
This implementation uses deformation components to distord the image. It takes three array of deformations : for the background image, for the text only, and for the final image it proceeds as folows :
Constructor Summary | |
---|---|
DeformedComposedWordToImage(FontGenerator fontGenerator,
BackgroundGenerator background,
TextPaster textPaster,
ImageDeformation[] backgroundDeformation,
ImageDeformation[] textDeformation,
ImageDeformation[] finalDeformation)
Composed word to image that applys filters |
|
DeformedComposedWordToImage(FontGenerator fontGenerator,
BackgroundGenerator background,
TextPaster textPaster,
ImageDeformation backgroundDeformation,
ImageDeformation textDeformation,
ImageDeformation finalDeformation)
Composed word to image that applys filters |
Method Summary | |
---|---|
java.awt.image.BufferedImage |
getImage(java.lang.String word)
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 |
---|
public DeformedComposedWordToImage(FontGenerator fontGenerator, BackgroundGenerator background, TextPaster textPaster, ImageDeformation backgroundDeformation, ImageDeformation textDeformation, ImageDeformation finalDeformation)
fontGenerator
- a AbstractFontGenerator to implement the getFont() methodbackground
- a AbstractBackgroundGenerator to implement the getBackround() methodtextPaster
- a AbstractTextParser to implement the pasteText() methodbackgroundDeformation
- to be apply on the background imagetextDeformation
- to be apply on the text imagefinalDeformation
- to be apply on the final imagepublic DeformedComposedWordToImage(FontGenerator fontGenerator, BackgroundGenerator background, TextPaster textPaster, ImageDeformation[] backgroundDeformation, ImageDeformation[] textDeformation, ImageDeformation[] finalDeformation)
fontGenerator
- a AbstractFontGenerator to implement the getFont() methodbackground
- a AbstractBackgroundGenerator to implement the getBackround() methodtextPaster
- a AbstractTextParser to implement the pasteText() methodbackgroundDeformation
- to be apply on the background imagetextDeformation
- to be apply on the text imagefinalDeformation
- to be apply on the final imageMethod Detail |
---|
public java.awt.image.BufferedImage getImage(java.lang.String word) throws CaptchaException
getImage
in interface WordToImage
getImage
in class AbstractWordToImage
CaptchaException
- if word is invalid or if image generation fails.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |