View Javadoc

1   /*
2    * JCaptcha, the open source java framework for captcha definition and integration
3    * Copyright (c)  2007 jcaptcha.net. All Rights Reserved.
4    * See the LICENSE.txt file distributed with this package.
5    */
6   
7   package com.octo.captcha.component.image.wordtoimage;
8   
9   import com.octo.captcha.CaptchaException;
10  
11  import java.awt.image.BufferedImage;
12  
13  /***
14   * <p>Provides methods to tranform a word to an image</p>.
15   *
16   * @author <a href="mailto:mag@jcaptcha.net">Marc-Antoine Garrigue</a>
17   * @version 1.0
18   */
19  public interface WordToImage {
20  
21  
22  
23  
24       /***
25        * @return the max word length accepted by this word2image service
26        */
27       int getMaxAcceptedWordLength();
28  
29       /***
30        * @return the min word length accepted by this word2image service
31        */
32       int getMinAcceptedWordLength();
33  
34  
35      /***
36       * @return the generated image height
37       */
38      int getImageHeight();
39  
40      /***
41       * @return teh generated image width
42       */
43      int getImageWidth();
44  
45      /***
46       * @return the min font size for the generated image
47       */
48      int getMinFontSize();
49  
50      /***
51       * Main method for this service Return an image with the specified
52       *
53       * @return the generated image
54       *
55       * @throws com.octo.captcha.CaptchaException
56       *          if word is invalid or an exception occurs during the image generation
57       */
58      BufferedImage getImage(String word) throws CaptchaException;
59  
60  }