com.octo.captcha.component.image.textpaster
Class DoubleTextPaster
java.lang.Object
com.octo.captcha.component.image.textpaster.AbstractTextPaster
com.octo.captcha.component.image.textpaster.DoubleTextPaster
- All Implemented Interfaces:
- TextPaster
public class DoubleTextPaster
- extends AbstractTextPaster
Pastes two times the attributed string with a random decalage from width/20 and height/2
Constructor Summary |
DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color textColor)
|
DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator)
|
DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator,
java.lang.Boolean manageColorPerGlyph)
|
Method Summary |
java.awt.image.BufferedImage |
pasteText(java.awt.image.BufferedImage background,
java.text.AttributedString attributedWord)
Pastes the attributed string on the backround image and return the final image. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DoubleTextPaster
public DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
java.awt.Color textColor)
- Parameters:
minAcceptedWordLength
- Max length of a wordmaxAcceptedWordLength
- Min length of a wordtextColor
- Unique color of text
DoubleTextPaster
public DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator)
- Parameters:
minAcceptedWordLength
- Max length of a wordmaxAcceptedWordLength
- Min length of a wordcolorGenerator
- color generator of text
DoubleTextPaster
public DoubleTextPaster(java.lang.Integer minAcceptedWordLength,
java.lang.Integer maxAcceptedWordLength,
ColorGenerator colorGenerator,
java.lang.Boolean manageColorPerGlyph)
- Parameters:
minAcceptedWordLength
- Max length of a wordmaxAcceptedWordLength
- Min length of a wordcolorGenerator
- color generator of textmanageColorPerGlyph
- Boolean to set if each glyph can have a new color from the color generator
pasteText
public java.awt.image.BufferedImage pasteText(java.awt.image.BufferedImage background,
java.text.AttributedString attributedWord)
- Pastes the attributed string on the backround image and return the final image. Implementation must take into
account the fact that the text must be readable by human and non by programs. Pastes two times the attributed
string with a random decalage from width/20 and height/2
- Returns:
- the final image
Copyright 2003-2009 JCaptcha. All Rights Reserved.