Struct captcha::Captcha [] [src]

pub struct Captcha { /* fields omitted */ }

A CAPTCHA.

Methods

impl Captcha
[src]

Returns an empty CAPTCHA.

Applies the filter f to the CAPTCHA.

This method is used to add noise, grids, etc or to transform the shape of the CAPTCHA.

Sets another font that is used for the characters.

Calling this method does not have an effect on the font of the characters which have already been added to the CAPTCHA. The new font is only applied to the characters which are written to the CAPTCHA after this method is called.

Saves the CAPTCHA to a image file.

The format that is written is determined from the filename's extension. On error Err is returned.

Adds a random character using the current font.

Adds a red box to the CAPTCHA representing the area which contains text.

Returns the geometry of the area which contains text in the CAPTCHA.

Crops the CAPTCHA to the given geometry.

Crops the CAPTCHA to the given width and height with the text centered withing this box.

Returns the characters that have been added to this CAPTCHA.

Returns the characters that have been added to this CAPTCHA collected into a string.

Adds the given number of random characters to the CAPTCHA using the current font.

Returns the CAPTCHA as a png image.

Returns None on error.

Returns a tuple which contains the characters that have been added to this CAPTCHA as a string and the image encoded as a PNG.

Returns None on error.