### Fluent Builder Usage Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Example of chaining builder methods to construct an ImageCaptcha. ```java ImageCaptcha image = addBackground().addContent().addNoise().addFilter().addBorder().build(); ``` -------------------------------- ### Get Background Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/GradiatedBackgroundProducer.html Generates a background image of the specified dimensions. ```java public BufferedImage getBackground(int width, int height) ``` -------------------------------- ### Get Vocalization Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Generates a Sample object containing the audio vocalization for a specific character. ```java public final Sample getVocalization(char number) ``` -------------------------------- ### Get CAPTCHA Image Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.html Method to retrieve the generated CAPTCHA image. ```java public BufferedImage getImage() ``` -------------------------------- ### Sample(String filename) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html Constructs a new Sample instance from a specified file path. ```APIDOC ## Sample(String filename) ### Description Creates a new Sample object by reading audio data from the provided file path. ### Parameters - **filename** (String) - Required - The path to the audio file. ``` -------------------------------- ### Sample Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html Constructors for initializing a Sample from a file path or an InputStream. ```java public Sample(String filename) ``` ```java public Sample(InputStream is) ``` -------------------------------- ### Build Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Finalizes the configuration and returns the AudioCaptcha instance. ```java public AudioCaptcha build() ``` -------------------------------- ### Sample(InputStream is) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html Constructs a new Sample instance from an InputStream. ```APIDOC ## Sample(InputStream is) ### Description Creates a new Sample object by reading audio data from an InputStream. ### Parameters - **is** (InputStream) - Required - The input stream containing the audio data. ``` -------------------------------- ### Sample Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html Methods for retrieving the audio stream or string representation of the sample. ```java public AudioInputStream getAudioInputStream() ``` ```java public String toString() ``` -------------------------------- ### AudioCaptcha.create() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/class-use/AudioCaptcha.html Creates a new instance of AudioCaptcha with default basic settings. ```APIDOC ## static AudioCaptcha create() ### Description Returns a new AudioCaptcha instance initialized with basic default settings. ### Returns - **AudioCaptcha** - A new instance of the audio CAPTCHA. ``` -------------------------------- ### AudioCaptcha.Builder.build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/class-use/AudioCaptcha.html Constructs an AudioCaptcha instance using the configured builder settings. ```APIDOC ## AudioCaptcha build() ### Description Builds and returns the audio CAPTCHA object based on the configuration provided to the builder. ### Returns - **AudioCaptcha** - The fully constructed audio CAPTCHA object. ``` -------------------------------- ### Configuration Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Methods for setting offsets, randomizing offsets, and configuring color suppliers. ```java public AbstractWordRenderer.Builder yOffset(double yOffset) ``` ```java public AbstractWordRenderer.Builder xOffset(double xOffset) ``` ```java public AbstractWordRenderer.Builder randomiseYOffset() ``` ```java public AbstractWordRenderer.Builder randomColor(Color color, Color... colors) ``` ```java public AbstractWordRenderer.Builder randomColor(List colors) ``` -------------------------------- ### build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Finalizes the configuration and returns the constructed ImageCaptcha object. ```APIDOC ### Method public ImageCaptcha build() ### Description Builds the image CAPTCHA described by this builder object. ### Returns - **ImageCaptcha** - The resulting ImageCaptcha instance. ``` -------------------------------- ### ImageCaptcha.create() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/class-use/ImageCaptcha.html Creates a new ImageCaptcha instance with default basic settings. ```APIDOC ## static ImageCaptcha create() ### Description Returns a new ImageCaptcha instance configured with default basic settings. ### Returns - **ImageCaptcha** - A new instance of ImageCaptcha. ``` -------------------------------- ### Implement the build method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/Builder.html The method signature for generating the final object instance. ```java T build() ``` -------------------------------- ### Constructor Definitions Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html Constructors for initializing the noise producer with default or custom color and width settings. ```java public CurvedLineNoiseProducer() ``` ```java public CurvedLineNoiseProducer(Color lineColor, float lineWidth) ``` -------------------------------- ### build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.Builder.html Builds and returns a configured DefaultWordRenderer instance. ```APIDOC ### Method `public DefaultWordRenderer build()` ### Description Builds and returns an object of type `DefaultWordRenderer` based on the current state of the builder. ### Returns - **DefaultWordRenderer** - The constructed renderer instance. ``` -------------------------------- ### Sample Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html The class declaration for Sample. ```java public class Sample extends Object ``` -------------------------------- ### Default Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Initializes a producer using built-in voices. ```java public RandomNumberVoiceProducer() ``` -------------------------------- ### Build Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/FastWordRenderer.Builder.html Method to construct and return a FastWordRenderer instance. ```java public FastWordRenderer build() ``` -------------------------------- ### Implement getVocalization Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/VoiceProducer.html Method signature for generating an audio sample for a given character. ```java Sample getVocalization(char letter) ``` -------------------------------- ### Implement the getBackground method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/BackgroundProducer.html Method signature for generating a background image of a specific width and height. ```java BufferedImage getBackground(int width, int height) ``` -------------------------------- ### AudioCaptcha.Builder Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Methods available for configuring and building an AudioCaptcha instance. ```APIDOC ## AudioCaptcha.Builder ### Description A builder class for creating instances of `AudioCaptcha`. ### Methods - **addContent()**: Adds content using the default `NumbersContentProducer`. - **addContent(int length)**: Adds content of a specified length using the default `NumbersContentProducer`. - **addContent(ContentProducer contentProducer)**: Adds content using a custom `ContentProducer`. - **addVoice()**: Adds the default `RandomNumberVoiceProducer`. - **addVoice(VoiceProducer voiceProducer)**: Adds a custom `VoiceProducer`. - **addNoise()**: Adds background noise using the default `RandomNoiseProducer`. - **addNoise(NoiseProducer noiseProducer)**: Adds noise using a custom `NoiseProducer`. - **build()**: Returns the configured `AudioCaptcha` instance. ``` -------------------------------- ### Initialize LatinContentProducer Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/LatinContentProducer.html Constructors for creating a LatinContentProducer instance with default or specified length. ```java public LatinContentProducer() ``` ```java public LatinContentProducer(int length) ``` -------------------------------- ### SaltAndPepperNoiseProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/SaltAndPepperNoiseProducer.html Constructs a new SaltAndPepperNoiseProducer with default settings. ```APIDOC ## SaltAndPepperNoiseProducer() ### Description Constructs a new instance of the SaltAndPepperNoiseProducer using default noise density settings. ### Constructor `public SaltAndPepperNoiseProducer()` ``` -------------------------------- ### TransparentBackgroundProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/TransparentBackgroundProducer.html Constructor for creating a new instance of TransparentBackgroundProducer. ```APIDOC ## Constructor: TransparentBackgroundProducer() ### Description Creates a new instance of the TransparentBackgroundProducer class. ### Signature `public TransparentBackgroundProducer()` ``` -------------------------------- ### ImageCaptcha.create() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.html Creates a new ImageCaptcha instance with default settings including dimensions and content production. ```APIDOC ## static ImageCaptcha create() ### Description Returns a new ImageCaptcha with basic settings: 200x50 dimensions (unless overridden by system properties), a LatinContentProducer with length 5, and a DefaultWordRenderer. ### Returns - **ImageCaptcha** - A new instance of the CAPTCHA. ``` -------------------------------- ### FlatColorBackgroundProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/FlatColorBackgroundProducer.html Constructor that initializes a new FlatColorBackgroundProducer using the default color. ```APIDOC ## Constructor: FlatColorBackgroundProducer() ### Description Creates a new instance of FlatColorBackgroundProducer that uses the default color for the background. ### Signature `public FlatColorBackgroundProducer()` ``` -------------------------------- ### SquigglesBackgroundProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/SquigglesBackgroundProducer.html Constructor to initialize a new instance of the SquigglesBackgroundProducer. ```APIDOC ### Constructor `public SquigglesBackgroundProducer()` Creates a new instance of the producer used to add squiggles to a CAPTCHA background. ``` -------------------------------- ### GradiatedBackgroundProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/GradiatedBackgroundProducer.html Constructor creating a producer with default dark gray and white colors. ```APIDOC ## GradiatedBackgroundProducer() ### Description Creates a new instance of GradiatedBackgroundProducer using default colors (dark gray to white). ``` -------------------------------- ### Implement makeNoise Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/NoiseProducer.html The method signature for applying noise to a BufferedImage. ```java void makeNoise(BufferedImage image) ``` -------------------------------- ### AudioCaptcha.getAudio() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Retrieves the audio sample for the CAPTCHA. ```APIDOC ## Sample getAudio() ### Description Returns the audio sample for this CAPTCHA. ### Returns - **Sample** - The CAPTCHA audio data. ``` -------------------------------- ### FlatColorBackgroundProducer(Color color) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/FlatColorBackgroundProducer.html Constructor that initializes a new FlatColorBackgroundProducer with a specified color. ```APIDOC ## Constructor: FlatColorBackgroundProducer(Color color) ### Description Creates a new instance of FlatColorBackgroundProducer using the provided color. ### Parameters - **color** (Color) - The color to be used for the background. ### Signature `public FlatColorBackgroundProducer(Color color)` ``` -------------------------------- ### ImageCaptcha.Builder.build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/class-use/ImageCaptcha.html Builds an ImageCaptcha instance based on the current builder configuration. ```APIDOC ## ImageCaptcha build() ### Description Builds the image CAPTCHA described by the current builder object. ### Returns - **ImageCaptcha** - The constructed ImageCaptcha instance. ``` -------------------------------- ### AbstractContentProducer Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/AbstractContentProducer.html Constructor for initializing the producer with a specific length and source character set. ```java public AbstractContentProducer(int length, char[] srcChars) ``` -------------------------------- ### Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/SaltAndPepperNoiseProducer.html Constructors for initializing the noise producer with default or custom density. ```java public SaltAndPepperNoiseProducer() ``` ```java public SaltAndPepperNoiseProducer(double noiseDensity) ``` -------------------------------- ### Constructor Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/TransparentBackgroundProducer.html The constructor for creating a new TransparentBackgroundProducer instance. ```java public TransparentBackgroundProducer() ``` -------------------------------- ### Implement getContent Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ContentProducer.html The method signature for retrieving the generated CAPTCHA string. ```java String getContent() ``` -------------------------------- ### FastWordRenderer.Builder.build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/class-use/FastWordRenderer.html The build method is used to construct an instance of FastWordRenderer. ```APIDOC ## FastWordRenderer.Builder.build() ### Description Constructs and returns a new instance of FastWordRenderer. ### Method Builder.build() ### Returns - **FastWordRenderer** - The configured renderer instance. ``` -------------------------------- ### Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/StraightLineNoiseProducer.html Constructors for initializing the noise producer with default or custom parameters. ```java public StraightLineNoiseProducer() ``` ```java public StraightLineNoiseProducer(Color lineColor, int lineWidth) ``` -------------------------------- ### Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/GradiatedBackgroundProducer.html Constructors for initializing the producer with default or custom colors. ```java public GradiatedBackgroundProducer() ``` ```java public GradiatedBackgroundProducer(Color fromColor, Color toColor) ``` -------------------------------- ### RandomNoiseProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/RandomNoiseProducer.html Constructor that initializes the producer to use built-in noise files (radio_tuning.wav, restaurant.wav, swimming.wav). ```APIDOC ## RandomNoiseProducer() ### Description Initializes a new instance of RandomNoiseProducer that uses built-in noise files for audio processing. ### Signature `public RandomNoiseProducer()` ``` -------------------------------- ### FastWordRenderer.Builder() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/FastWordRenderer.Builder.html Constructs a new instance of the FastWordRenderer.Builder. ```APIDOC ### Constructor `public Builder()` Creates a new builder instance for configuring a `FastWordRenderer`. ``` -------------------------------- ### FlatColorBackgroundProducer Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/FlatColorBackgroundProducer.html Constructors for initializing the background producer with either a default color or a specific color. ```java public FlatColorBackgroundProducer() ``` ```java public FlatColorBackgroundProducer(Color color) ``` -------------------------------- ### Build ImageCaptcha instance Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Finalizes the configuration and returns the constructed ImageCaptcha object. ```java public ImageCaptcha build() ``` -------------------------------- ### Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html Constructors for initializing the GaussianNoiseProducer with default or custom parameters. ```java public GaussianNoiseProducer() ``` ```java public GaussianNoiseProducer(int standardDeviation, int mean) ``` -------------------------------- ### GradiatedBackgroundProducer(Color fromColor, Color toColor) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/GradiatedBackgroundProducer.html Constructor taking custom from and to Color values. ```APIDOC ## GradiatedBackgroundProducer(Color fromColor, Color toColor) ### Description Creates a new instance of GradiatedBackgroundProducer with specified start and end colors. ### Parameters - **fromColor** (Color) - Required - The starting color of the gradient. - **toColor** (Color) - Required - The ending color of the gradient. ``` -------------------------------- ### Sample getVocalization(char letter) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/VoiceProducer.html Generates a vocalization for a single character, returning it as a Sample object. ```APIDOC ## Method: getVocalization ### Description Generates a vocalization for a single character. ### Signature `Sample getVocalization(char letter)` ### Parameters - **letter** (char) - The character to vocalize. ### Returns - **Sample** - A Sample object containing the vocalization of the provided character. ``` -------------------------------- ### Create AudioCaptcha Instance Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Generates a new AudioCaptcha instance with default settings including a 5-digit number sequence. ```java public static AudioCaptcha create() ``` -------------------------------- ### FiveLetterFirstNameContentProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/FiveLetterFirstNameContentProducer.html Constructor for creating a new instance of the FiveLetterFirstNameContentProducer. ```APIDOC ## Constructor: FiveLetterFirstNameContentProducer() ### Description Constructs a new FiveLetterFirstNameContentProducer instance. ### Signature `public FiveLetterFirstNameContentProducer()` ``` -------------------------------- ### CurvedLineNoiseProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html Initializes a new instance of CurvedLineNoiseProducer using default color and line width settings. ```APIDOC ## Constructor: CurvedLineNoiseProducer() ### Description Creates a new CurvedLineNoiseProducer instance with default color and line width. ### Signature `public CurvedLineNoiseProducer()` ``` -------------------------------- ### ChineseContentProducer Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ChineseContentProducer.html Constructors for initializing the producer with either default or specified string lengths. ```java public ChineseContentProducer() ``` ```java public ChineseContentProducer(int length) ``` -------------------------------- ### ArabicContentProducer(int length) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ArabicContentProducer.html Constructor for creating an ArabicContentProducer instance with a specified content length. ```APIDOC ## ArabicContentProducer(int length) ### Description Initializes a new instance of the ArabicContentProducer class with a custom content length. ### Signature `public ArabicContentProducer(int length)` ### Parameters - **length** (int) - Required - The desired length of the generated Arabic content string. ``` -------------------------------- ### ArabicContentProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ArabicContentProducer.html Constructor for creating an ArabicContentProducer instance that generates content of the default length. ```APIDOC ## ArabicContentProducer() ### Description Initializes a new instance of the ArabicContentProducer class with the default content length. ### Signature `public ArabicContentProducer()` ``` -------------------------------- ### ArabicContentProducer Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ArabicContentProducer.html Constructors for initializing an ArabicContentProducer with either default or specified length. ```java public ArabicContentProducer() ``` ```java public ArabicContentProducer(int length) ``` -------------------------------- ### getAudioInputStream() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html Retrieves the AudioInputStream associated with the sample. ```APIDOC ## getAudioInputStream() ### Description Returns the AudioInputStream for the current sample. ### Returns - **AudioInputStream** - The audio stream for this sample. ``` -------------------------------- ### RandomNoiseProducer(String[] noiseFiles) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/RandomNoiseProducer.html Constructor that initializes the producer with a custom array of noise filenames. ```APIDOC ## RandomNoiseProducer(String[] noiseFiles) ### Description Initializes a new instance of RandomNoiseProducer with a specific set of noise files. ### Parameters - **noiseFiles** (String[]) - Required - An array of noise filenames to be used for random selection. ``` -------------------------------- ### AudioCaptcha.Builder Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Constructor for the builder instance. ```java public Builder() ``` -------------------------------- ### LatinContentProducer(int length) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/LatinContentProducer.html Constructor for creating a LatinContentProducer with a specified content length. ```APIDOC ## LatinContentProducer(int length) ### Description Initializes a new instance of the LatinContentProducer class with a specific length for the generated content. ### Signature `public LatinContentProducer(int length)` ### Parameters - **length** (int) - The desired length of the generated content string. ``` -------------------------------- ### render(String word, BufferedImage image) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.html Renders the provided word onto the specified BufferedImage. ```APIDOC ## void render(String word, BufferedImage image) ### Description Renders the specified word onto the provided BufferedImage. ### Parameters - **word** (String) - The string to be rendered. - **image** (BufferedImage) - The image onto which the word will be rendered. ``` -------------------------------- ### Locale-based Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Initializes a producer with a specific language locale. ```java public RandomNumberVoiceProducer(Locale language) ``` -------------------------------- ### SaltAndPepperNoiseProducer(double noiseDensity) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/SaltAndPepperNoiseProducer.html Constructs a new SaltAndPepperNoiseProducer with a specified noise density. ```APIDOC ## SaltAndPepperNoiseProducer(double noiseDensity) ### Description Constructs a new instance of the SaltAndPepperNoiseProducer with a custom noise density. ### Constructor `public SaltAndPepperNoiseProducer(double noiseDensity)` ### Parameters - **noiseDensity** (double) - Required - The density of the noise to be applied (must be in the range of 0 to 1). ### Throws - **IllegalArgumentException** - Thrown when the noise density is not in the range of 0 to 1. ``` -------------------------------- ### Retrieve CAPTCHA Audio Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Returns the audio sample associated with the CAPTCHA instance. ```java public Sample getAudio() ``` -------------------------------- ### Render Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html Abstract method to render a word onto a BufferedImage. ```java public abstract void render(String word, BufferedImage image) ``` -------------------------------- ### RandomNoiseProducer Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/RandomNoiseProducer.html Constructors for initializing the noise producer with either default built-in files or a custom array of filenames. ```java public RandomNoiseProducer() ``` ```java public RandomNoiseProducer(String[] noiseFiles) ``` -------------------------------- ### Create ImageCaptcha Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.html Method to create a new ImageCaptcha instance with default settings. ```java public static ImageCaptcha create() ``` -------------------------------- ### LatinContentProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/LatinContentProducer.html Constructor for creating a LatinContentProducer that returns content of the default length. ```APIDOC ## LatinContentProducer() ### Description Initializes a new instance of the LatinContentProducer class with the default content length. ### Signature `public LatinContentProducer()` ``` -------------------------------- ### String getContent() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ContentProducer.html Retrieves the generated string of characters to be used as the CAPTCHA answer. ```APIDOC ## String getContent() ### Description Returns a string of characters to be used as the answer for the CAPTCHA. ### Returns - **String** - The generated CAPTCHA content. ``` -------------------------------- ### Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html The protected constructor for the builder. ```java protected Builder() ``` -------------------------------- ### GaussianNoiseProducer(int standardDeviation, int mean) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html Constructor to create a GaussianNoiseProducer with specified standard deviation and mean. ```APIDOC ## GaussianNoiseProducer(int standardDeviation, int mean) ### Description Constructs a new GaussianNoiseProducer instance with custom statistical parameters. ### Parameters - **standardDeviation** (int) - The standard deviation of the Gaussian noise. - **mean** (int) - The mean of the Gaussian noise. ``` -------------------------------- ### DefaultWordRenderer.Builder() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.Builder.html Constructs a new instance of the DefaultWordRenderer.Builder. ```APIDOC ### Constructor `public Builder()` Creates a new builder instance for configuring a `DefaultWordRenderer`. ``` -------------------------------- ### ChineseContentProducer(int length) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ChineseContentProducer.html Constructor for creating a ChineseContentProducer instance with a specified content length. ```APIDOC ## ChineseContentProducer(int length) ### Description Initializes a new instance of the ChineseContentProducer class with a custom content length. ### Signature `public ChineseContentProducer(int length)` ### Parameters - **length** (int) - Required - The length of the content to be generated. ``` -------------------------------- ### makeNoise Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html Applies the curved line noise to the provided BufferedImage. ```java public void makeNoise(BufferedImage image) ``` -------------------------------- ### NumbersContentProducer Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/NumbersContentProducer.html Constructors for initializing a NumbersContentProducer with either default or specified length. ```java public NumbersContentProducer() ``` ```java public NumbersContentProducer(int length) ``` -------------------------------- ### getBackground(int width, int height) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/SquigglesBackgroundProducer.html Generates a background image with squiggles of the specified dimensions. ```APIDOC ### Method `public BufferedImage getBackground(int width, int height)` ### Description Returns a background image that can be added to a CAPTCHA image. ### Parameters - **width** (int) - Required - The width of the background image. - **height** (int) - Required - The height of the background image. ### Returns - **BufferedImage** - A background image of the specified width and height. ``` -------------------------------- ### ChineseContentProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ChineseContentProducer.html Constructor for creating a ChineseContentProducer instance that generates content of the default length. ```APIDOC ## ChineseContentProducer() ### Description Initializes a new instance of the ChineseContentProducer class with the default content length. ### Signature `public ChineseContentProducer()` ``` -------------------------------- ### Constructor Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/SquigglesBackgroundProducer.html The constructor for the SquigglesBackgroundProducer class. ```java public SquigglesBackgroundProducer() ``` -------------------------------- ### mix(Sample sample1, double volume1, Sample sample2, double volume2) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Mixer.html Mixes two audio samples together with individual volume multipliers. ```APIDOC ## static Sample mix(Sample sample1, double volume1, Sample sample2, double volume2) ### Description Returns a new Sample representing the mix of sample1 and sample2. The volume of each sample is adjusted by its respective multiplier (volume1 and volume2). ### Parameters - **sample1** (Sample) - Required - The first audio sample. - **volume1** (double) - Required - The volume multiplier for the first sample. - **sample2** (Sample) - Required - The second audio sample. - **volume2** (double) - Required - The volume multiplier for the second sample. ### Returns - **Sample** - The resulting mixed Sample. ### Throws - **NullPointerException** - If either sample1 or sample2 is null. ``` -------------------------------- ### NumbersContentProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/NumbersContentProducer.html Constructor for creating a NumbersContentProducer instance that returns content of a default length. ```APIDOC ### Constructor: NumbersContentProducer() Creates a new instance of NumbersContentProducer that generates numeric content using the default length. ``` -------------------------------- ### getBackground(int width, int height) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/TransparentBackgroundProducer.html Generates a transparent background image with the specified dimensions. ```APIDOC ## Method: getBackground(int width, int height) ### Description Returns a transparent background image that can be added to a CAPTCHA image. ### Signature `public BufferedImage getBackground(int width, int height)` ### Parameters - **width** (int) - The required width of the background image. - **height** (int) - The required height of the background image. ### Returns - **BufferedImage** - A background image of the specified width and height. ``` -------------------------------- ### NumbersContentProducer(int length) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/NumbersContentProducer.html Constructor for creating a NumbersContentProducer instance with a specified length for the generated numeric string. ```APIDOC ### Constructor: NumbersContentProducer(int length) Creates a new instance of NumbersContentProducer with a specific length for the generated numeric content. #### Parameters - **length** (int) - Required - The length of the returned content strings. Must be a positive integer. #### Throws - **IllegalArgumentException** - Thrown if the provided length is not positive. ``` -------------------------------- ### makeNoise(BufferedImage image) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/SaltAndPepperNoiseProducer.html Applies the salt and pepper noise effect to the provided image. ```APIDOC ## makeNoise(BufferedImage image) ### Description Applies salt and pepper noise to the given BufferedImage, randomly changing pixels to black or white. ### Method `public void makeNoise(BufferedImage image)` ### Parameters - **image** (BufferedImage) - Required - The image to which the noise will be applied. ``` -------------------------------- ### FishEyeImageFilter Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/FishEyeImageFilter.html Constructors for initializing the filter with default or custom line colors. ```java public FishEyeImageFilter() ``` ```java public FishEyeImageFilter(Color hColor, Color vColor) ``` -------------------------------- ### makeNoise(BufferedImage image) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html Applies Gaussian noise to the provided BufferedImage. ```APIDOC ## makeNoise(BufferedImage image) ### Description Applies Gaussian noise to the specified BufferedImage based on the producer's configuration. ### Parameters - **image** (BufferedImage) - The image to which the noise is to be applied. ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/TransparentBackgroundProducer.html The class definition for TransparentBackgroundProducer. ```java public class TransparentBackgroundProducer extends Object implements BackgroundProducer ``` -------------------------------- ### RandomNumberVoiceProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Constructor for creating a RandomNumberVoiceProducer instance using built-in voices. ```APIDOC ## RandomNumberVoiceProducer() ### Description Constructs a new RandomNumberVoiceProducer object that provides built-in voices to vocalize digits. ### Signature `public RandomNumberVoiceProducer()` ``` -------------------------------- ### getBackground(int width, int height) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/FlatColorBackgroundProducer.html Generates a background image of the specified dimensions. ```APIDOC ## Method: getBackground(int width, int height) ### Description Returns a BufferedImage of the specified width and height, filled with the producer's configured color. ### Parameters - **width** (int) - The required width of the background image. - **height** (int) - The required height of the background image. ### Returns - **BufferedImage** - A background image of the requested dimensions. ### Signature `public BufferedImage getBackground(int width, int height)` ``` -------------------------------- ### Add Voice Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Methods to configure the voice producer for the CAPTCHA. ```java public AudioCaptcha.Builder addVoice() ``` ```java public AudioCaptcha.Builder addVoice(VoiceProducer voiceProducer) ``` -------------------------------- ### Constructor Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/FiveLetterFirstNameContentProducer.html The constructor for the FiveLetterFirstNameContentProducer class. ```java public FiveLetterFirstNameContentProducer() ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html The base class definition for the builder. ```java public abstract static class AbstractWordRenderer.Builder extends Object implements Builder ``` -------------------------------- ### GaussianNoiseProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html Constructor to create a GaussianNoiseProducer with default standard deviation and mean. ```APIDOC ## GaussianNoiseProducer() ### Description Constructs a new GaussianNoiseProducer instance using default values for standard deviation and mean. ### Signature `public GaussianNoiseProducer()` ``` -------------------------------- ### CurvedLineNoiseProducer(Color, float) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html Initializes a new instance of CurvedLineNoiseProducer with a specified color and line width. ```APIDOC ## Constructor: CurvedLineNoiseProducer(Color lineColor, float lineWidth) ### Description Creates a new CurvedLineNoiseProducer instance with custom color and line width. ### Parameters - **lineColor** (Color) - The color of the noise line. - **lineWidth** (float) - The width of the noise line. ### Signature `public CurvedLineNoiseProducer(Color lineColor, float lineWidth)` ``` -------------------------------- ### Mix Audio Samples Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Mixer.html Mixes two Sample objects with specified volume multipliers. ```java public static Sample mix(Sample sample1, double volume1, Sample sample2, double volume2) ``` -------------------------------- ### AudioCaptcha.getCreated() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Retrieves the creation timestamp of the CAPTCHA. ```APIDOC ## OffsetDateTime getCreated() ### Description Returns the timestamp indicating when the CAPTCHA was created. ### Returns - **OffsetDateTime** - The creation timestamp. ``` -------------------------------- ### RandomNumberVoiceProducer(Locale language) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Constructor for creating a RandomNumberVoiceProducer instance with a specified language locale. ```APIDOC ## RandomNumberVoiceProducer(Locale language) ### Description Constructs a new RandomNumberVoiceProducer object using the specified language locale. If the provided language is not supported, the default language is used. ### Parameters - **language** (Locale) - Required - A Locale representing the desired language. ### Signature `public RandomNumberVoiceProducer(Locale language)` ``` -------------------------------- ### Add Background Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Methods for adding a background to the CAPTCHA. ```java public ImageCaptcha.Builder addBackground() ``` ```java public ImageCaptcha.Builder addBackground(BackgroundProducer backgroundProducer) ``` -------------------------------- ### AudioCaptcha.getContent() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Retrieves the text content associated with the CAPTCHA. ```APIDOC ## String getContent() ### Description Returns the string content of this CAPTCHA. ### Returns - **String** - The CAPTCHA content. ``` -------------------------------- ### makeNoise(BufferedImage) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html Applies the curved line noise effect to the provided BufferedImage. ```APIDOC ## Method: makeNoise(BufferedImage image) ### Description Adds a randomly curved line to the specified image. ### Parameters - **image** (BufferedImage) - The image to which the noise will be added. ### Signature `public void makeNoise(BufferedImage image)` ``` -------------------------------- ### getBackground(int width, int height) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/BackgroundProducer.html Generates a background image of the specified dimensions for use in a CAPTCHA. ```APIDOC ## BufferedImage getBackground(int width, int height) ### Description Returns a background image that can be added to a CAPTCHA image. ### Parameters - **width** (int) - Required - The required width of the background image. - **height** (int) - Required - The required height of the background image. ### Returns - **BufferedImage** - A background image of the specified width and height. ``` -------------------------------- ### makeNoise(BufferedImage) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/StraightLineNoiseProducer.html Adds a straight line of noise to the provided BufferedImage. ```APIDOC ## Method: makeNoise(BufferedImage image) ### Description Draws a straight line across the specified image to serve as visual noise. ### Parameters - **image** (BufferedImage) - The image to which the noise will be applied. ### Signature `public void makeNoise(BufferedImage image)` ``` -------------------------------- ### addNoise(List samples) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/NoiseProducer.html Concatenates a list of audio samples, applies background noise, and returns the resulting processed sample. ```APIDOC ## Method: addNoise(List samples) ### Description Concatenates the provided list of samples, adds background noise to the audio, and returns the resulting Sample object. ### Signature `Sample addNoise(List samples)` ### Parameters - **samples** (List) - A list of Sample objects to be processed. ### Returns - **Sample** - The concatenated Sample with added background noise. ``` -------------------------------- ### StretchImageFilter Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/StretchImageFilter.html Constructors for initializing the filter with default or custom scale multipliers. ```java public StretchImageFilter() ``` ```java public StretchImageFilter(double xScale, double yScale) ``` -------------------------------- ### SC_AUDIO_FORMAT Field Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Sample.html The static AudioFormat constant used for all Sample instances. ```java public static final AudioFormat SC_AUDIO_FORMAT ``` -------------------------------- ### Define the BackgroundProducer interface Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/BackgroundProducer.html The core interface definition for objects capable of producing background images. ```java public interface BackgroundProducer ``` -------------------------------- ### StraightLineNoiseProducer() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/StraightLineNoiseProducer.html Constructs a new StraightLineNoiseProducer instance using default values for line color and width. ```APIDOC ## Constructor: StraightLineNoiseProducer() ### Description Initializes a new instance of the StraightLineNoiseProducer class with default configuration. ### Signature `public StraightLineNoiseProducer()` ``` -------------------------------- ### DefaultWordRenderer.Builder build Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.Builder.html The build method used to construct and return a DefaultWordRenderer instance. ```java public DefaultWordRenderer build() ``` -------------------------------- ### Field Definitions Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Protected fields for configuring the renderer properties. ```java protected double xOffset ``` ```java protected double yOffset ``` ```java protected Supplier colorSupplier ``` ```java protected Supplier fontSupplier ``` -------------------------------- ### Builder Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Constructor for initializing the builder with specific dimensions. ```java public Builder(int width, int height) ``` -------------------------------- ### Retrieve color supplier Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html Returns the supplier for the color used in rendering. ```java protected Supplier colorSupplier() ``` -------------------------------- ### ShearImageFilter Constructors Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/ShearImageFilter.html Constructors for initializing the filter with or without a specific color. ```java public ShearImageFilter() ``` ```java public ShearImageFilter(Color color) ``` -------------------------------- ### Implement addNoise Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/NoiseProducer.html The method signature for processing a list of samples and returning the noise-injected result. ```java Sample addNoise(List samples) ``` -------------------------------- ### getVocalization(char number) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html Generates an audio sample representing the vocalization of a specific numeric character. ```APIDOC ## getVocalization(char number) ### Description Generates a vocalization for a single character. ### Parameters - **number** (char) - Required - The character to vocalize. ### Returns - **Sample** - A Sample object containing the vocalization. ### Signature `public final Sample getVocalization(char number)` ``` -------------------------------- ### AbstractWordRenderer Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html Protected constructor for initializing renderer offsets and suppliers. ```java protected AbstractWordRenderer(double xOffset, double yOffset, Supplier colorSupplier, Supplier fontSupplier) ``` -------------------------------- ### concatenate(List samples) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Mixer.html Concatenates a list of audio samples into a single new Sample. ```APIDOC ## static Sample concatenate(List samples) ### Description Returns the concatenation of the supplied Sample objects as a new Sample. If the provided list is empty, a new empty Sample is returned. ### Parameters - **samples** (List) - Required - A list of Sample objects to be concatenated. ### Returns - **Sample** - The resulting concatenated Sample. ### Throws - **NullPointerException** - If the provided samples list is null. ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/GradiatedBackgroundProducer.html The class definition for GradiatedBackgroundProducer. ```java public class GradiatedBackgroundProducer extends Object implements BackgroundProducer ``` -------------------------------- ### T build() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/Builder.html The build method is used to construct and return an instance of the generic type T based on the current state of the builder. ```APIDOC ## T build() ### Description Builds and returns an object of type T based on the state of this builder instance. ### Signature `T build()` ### Returns - **T** - The constructed object of type T. ``` -------------------------------- ### FishEyeImageFilter() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/FishEyeImageFilter.html Constructs a new FishEyeImageFilter instance using default line colors. ```APIDOC ## FishEyeImageFilter() ### Description Initializes a new FishEyeImageFilter with default horizontal and vertical line colors. ### Signature `public FishEyeImageFilter()` ``` -------------------------------- ### addNoise(List samples) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/RandomNoiseProducer.html Concatenates a list of samples and adds a random background noise sample from the configured list. ```APIDOC ## addNoise(List samples) ### Description Concatenates the provided list of samples and overlays a random background noise sample, returning the resulting combined Sample. ### Parameters - **samples** (List) - Required - A list of Sample objects to be concatenated and processed. ### Returns - **Sample** - The resulting Sample object containing the concatenated audio with added noise. ``` -------------------------------- ### LatinContentProducer Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/index-all.html Constructors for generating random strings using a subset of the Latin alphabet. ```APIDOC ## LatinContentProducer() ### Description Constructor for object returning content of default length. ## LatinContentProducer(int length) ### Description Constructor taking a length specifier. ### Parameters - **length** (int) - The length of the generated string. ``` -------------------------------- ### Retrieve String Representation Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Returns a string representation of the AudioCaptcha object. ```java public String toString() ``` -------------------------------- ### addNoise Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/RandomNoiseProducer.html Concatenates a list of samples and adds a random background noise sample. ```java public Sample addNoise(List samples) ``` -------------------------------- ### Define the Builder interface Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/Builder.html The base interface for generic object construction. ```java public interface Builder ``` -------------------------------- ### StraightLineNoiseProducer(Color, int) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/StraightLineNoiseProducer.html Constructs a new StraightLineNoiseProducer instance with a specified line color and line width. ```APIDOC ## Constructor: StraightLineNoiseProducer(Color lineColor, int lineWidth) ### Description Initializes a new instance of the StraightLineNoiseProducer class with custom line styling. ### Parameters - **lineColor** (Color) - The color of the noise line. - **lineWidth** (int) - The thickness of the noise line. ### Signature `public StraightLineNoiseProducer(Color lineColor, int lineWidth)` ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html The class definition for GaussianNoiseProducer. ```java public class GaussianNoiseProducer extends Object implements NoiseProducer ``` -------------------------------- ### AbstractContentProducer Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/AbstractContentProducer.html The base class definition for content producers. ```java public abstract class AbstractContentProducer extends Object implements ContentProducer ``` -------------------------------- ### Apply Noise Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/GaussianNoiseProducer.html Method to apply Gaussian noise to a provided BufferedImage. ```java public void makeNoise(BufferedImage image) ``` -------------------------------- ### StretchImageFilter() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/StretchImageFilter.html Constructs a new StretchImageFilter instance using default scale multipliers (x=1.0, y=3.0). ```APIDOC ## StretchImageFilter() ### Description Constructs a new StretchImageFilter instance using default scale multipliers of 1.0 for the x-axis and 3.0 for the y-axis. ``` -------------------------------- ### ImageFilter Method Signatures Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/ImageFilter.html Methods for transforming images and applying BufferedImageOp filters. ```java void filter(BufferedImage image) ``` ```java static void applyFilter(BufferedImage img, BufferedImageOp filter) ``` -------------------------------- ### Concatenate Audio Samples Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Mixer.html Concatenates a list of Sample objects into a single new Sample. ```java public static Sample concatenate(List samples) ``` -------------------------------- ### RippleImageFilter() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/RippleImageFilter.html Constructs a new RippleImageFilter instance. ```APIDOC ## RippleImageFilter() ### Description Constructs a new instance of the RippleImageFilter class. ### Signature `public RippleImageFilter()` ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/SaltAndPepperNoiseProducer.html The class definition for SaltAndPepperNoiseProducer. ```java public class SaltAndPepperNoiseProducer extends Object implements NoiseProducer ``` -------------------------------- ### AudioCaptcha.Builder Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html The class definition for the AudioCaptcha builder. ```java public static class AudioCaptcha.Builder extends Object implements Builder ``` -------------------------------- ### Render Method Signature Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.html The signature for the render method used to draw a word onto a BufferedImage. ```java public void render(String word, BufferedImage image) ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/SquigglesBackgroundProducer.html The class definition for SquigglesBackgroundProducer. ```java public class SquigglesBackgroundProducer extends Object implements BackgroundProducer ``` -------------------------------- ### Add Content Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Methods to add content to the CAPTCHA using default or custom producers. ```java public AudioCaptcha.Builder addContent() ``` ```java public AudioCaptcha.Builder addContent(int length) ``` ```java public AudioCaptcha.Builder addContent(ContentProducer contentProducer) ``` -------------------------------- ### Retrieve Creation Timestamp Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Returns the timestamp indicating when the CAPTCHA was created. ```java public OffsetDateTime getCreated() ``` -------------------------------- ### Retrieve CAPTCHA Content Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Returns the expected string content of the CAPTCHA. ```java public String getContent() ``` -------------------------------- ### AudioCaptcha Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html The primary class for audio CAPTCHA generation. ```java public final class AudioCaptcha extends Object ``` -------------------------------- ### Add Noise Methods Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.Builder.html Methods to add background noise to the CAPTCHA. ```java public AudioCaptcha.Builder addNoise() ``` ```java public AudioCaptcha.Builder addNoise(NoiseProducer noiseProducer) ``` -------------------------------- ### Class Declaration for ChineseContentProducer Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ChineseContentProducer.html The class definition showing inheritance from AbstractContentProducer. ```java public class ChineseContentProducer extends AbstractContentProducer ``` -------------------------------- ### DefaultWordRenderer.Builder Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.Builder.html The constructor for initializing a new builder instance. ```java public Builder() ``` -------------------------------- ### ImageCaptcha.getImage() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.html Retrieves the visual representation of the CAPTCHA. ```APIDOC ## BufferedImage getImage() ### Description Returns the generated image for the current CAPTCHA instance. ### Returns - **BufferedImage** - The CAPTCHA image. ``` -------------------------------- ### Set random font from list Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Configures the font supplier to randomly select from a provided list of fonts. No changes occur if the list is empty. ```java public AbstractWordRenderer.Builder randomFont(List fonts) ``` -------------------------------- ### ShearImageFilter() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/ShearImageFilter.html Constructs a new ShearImageFilter instance using the default color. ```APIDOC ## ShearImageFilter() ### Description Creates a new instance of ShearImageFilter with the default color settings. ### Signature `public ShearImageFilter()` ``` -------------------------------- ### applyFilter(BufferedImage img, BufferedImageOp filter) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/ImageFilter.html Applies a specified BufferedImageOp filter to the provided BufferedImage. ```APIDOC ## static void applyFilter(BufferedImage img, BufferedImageOp filter) ### Description Applies a given BufferedImageOp filter to the specified BufferedImage. ### Parameters - **img** (BufferedImage) - The image to apply the filter to. - **filter** (BufferedImageOp) - The filter operation to apply. ``` -------------------------------- ### Define LatinContentProducer class Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/LatinContentProducer.html Class declaration for LatinContentProducer extending AbstractContentProducer. ```java public class LatinContentProducer extends AbstractContentProducer ``` -------------------------------- ### Define WordRenderer Interface Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/WordRenderer.html The interface definition for rendering CAPTCHA content. ```java public interface WordRenderer ``` -------------------------------- ### FastWordRenderer.Builder Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/FastWordRenderer.Builder.html The class definition for the builder, extending AbstractWordRenderer.Builder. ```java public static class FastWordRenderer.Builder extends AbstractWordRenderer.Builder ``` -------------------------------- ### Retrieve font supplier Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html Returns the supplier for the font used in rendering. ```java protected Supplier fontSupplier() ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/FiveLetterFirstNameContentProducer.html The class definition for FiveLetterFirstNameContentProducer. ```java public class FiveLetterFirstNameContentProducer extends Object implements ContentProducer ``` -------------------------------- ### ImageCaptcha.getContent() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.html Retrieves the text content associated with the CAPTCHA. ```APIDOC ## String getContent() ### Description Returns the secret content string of this CAPTCHA. ### Returns - **String** - The CAPTCHA content. ``` -------------------------------- ### color(Color color) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Sets the color supplier to provide a specific color for the rendered text. ```APIDOC ### Method `public AbstractWordRenderer.Builder color(Color color)` ### Description Sets the `AbstractWordRenderer.colorSupplier()` to provide a specified `Color`. ### Parameters - **color** (Color) - The `Color` to be supplied by `AbstractWordRenderer.colorSupplier()` ### Returns - **AbstractWordRenderer.Builder** - Returns this builder instance. ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/producer/RandomNumberVoiceProducer.html The class definition for RandomNumberVoiceProducer. ```java public class RandomNumberVoiceProducer extends Object implements VoiceProducer ``` -------------------------------- ### Set random font from varargs Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Configures the font supplier to randomly select from a provided list of fonts. ```java public AbstractWordRenderer.Builder randomFont(Font font, Font... fonts) ``` -------------------------------- ### ArabicContentProducer Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/content/ArabicContentProducer.html The class definition for ArabicContentProducer, which extends AbstractContentProducer. ```java public class ArabicContentProducer extends AbstractContentProducer ``` -------------------------------- ### FlatColorBackgroundProducer Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/backgrounds/FlatColorBackgroundProducer.html The class definition for FlatColorBackgroundProducer, which implements the BackgroundProducer interface. ```java public final class FlatColorBackgroundProducer extends Object implements BackgroundProducer ``` -------------------------------- ### randomFont(Font font, Font... fonts) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Sets the font supplier to randomly select from a provided set of fonts. ```APIDOC ### Method `public AbstractWordRenderer.Builder randomFont(Font font, Font... fonts)` ### Description Sets `AbstractWordRenderer.fontSupplier()` to randomly select a `Font` from the given `Font`s. ### Parameters - **font** (Font) - The first `Font` - **fonts** (Font...) - Additional `Font`s (optional) ### Returns - **AbstractWordRenderer.Builder** - Returns this builder instance. ``` -------------------------------- ### Builder Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html The class definition for ImageCaptcha.Builder. ```java public static class ImageCaptcha.Builder extends Object implements Builder ``` -------------------------------- ### AbstractWordRenderer Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html The base class definition for word rendering implementations. ```java public abstract class AbstractWordRenderer extends Object implements WordRenderer ``` -------------------------------- ### Define NoiseProducer Interface Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/noise/NoiseProducer.html The base interface for implementing custom noise generation logic. ```java public interface NoiseProducer ``` -------------------------------- ### Mixer Class Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/Mixer.html The Mixer class is a final utility class for audio sample operations. ```java public final class Mixer extends Object ``` -------------------------------- ### Retrieve x-axis offset Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.html Returns the horizontal offset for word rendering. ```java protected double xOffset() ``` -------------------------------- ### addNoise() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Adds noise to the CAPTCHA image. The version without parameters uses a default CurvedLineNoiseProducer, while the version with a parameter allows specifying a custom NoiseProducer. ```APIDOC ### Method public ImageCaptcha.Builder addNoise() public ImageCaptcha.Builder addNoise(NoiseProducer noiseProducer) ### Description Adds noise to the CAPTCHA image. If no producer is provided, a default CurvedLineNoiseProducer is used. ### Parameters - **noiseProducer** (NoiseProducer) - Optional - The producer used to generate noise on the image. ### Returns - **ImageCaptcha.Builder** - The builder instance for method chaining. ``` -------------------------------- ### font(Font font) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Sets the font supplier to provide a specific font. ```APIDOC ### Method `public AbstractWordRenderer.Builder font(Font font)` ### Description Sets `AbstractWordRenderer.fontSupplier()` to provide a specified `Font`. ### Parameters - **font** (Font) - The `Font` to be supplied by `AbstractWordRenderer.fontSupplier()` ### Returns - **AbstractWordRenderer.Builder** - Returns this builder instance. ``` -------------------------------- ### DefaultWordRenderer.Builder Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/DefaultWordRenderer.Builder.html The class definition for the builder, extending AbstractWordRenderer.Builder. ```java public static class DefaultWordRenderer.Builder extends AbstractWordRenderer.Builder ``` -------------------------------- ### FishEyeImageFilter(Color hColor, Color vColor) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/FishEyeImageFilter.html Constructs a new FishEyeImageFilter instance with specified colors for the horizontal and vertical grid lines. ```APIDOC ## FishEyeImageFilter(Color hColor, Color vColor) ### Description Initializes a new FishEyeImageFilter with custom colors for the grid lines. ### Parameters - **hColor** (Color) - The color to be used for horizontal lines. - **vColor** (Color) - The color to be used for vertical lines. ### Signature `public FishEyeImageFilter(Color hColor, Color vColor)` ``` -------------------------------- ### randomFont(List fonts) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Sets the font supplier to randomly select from a provided list of fonts. ```APIDOC ### Method `public AbstractWordRenderer.Builder randomFont(List fonts)` ### Description Sets `AbstractWordRenderer.fontSupplier()` to randomly select a `Font` from the provided `fonts`. If the list is empty, no changes are made. ### Parameters - **fonts** (List) - The list of `Font`s to choose from ### Returns - **AbstractWordRenderer.Builder** - Returns this builder instance. ``` -------------------------------- ### addBorder() Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/ImageCaptcha.Builder.html Draws a single-pixel wide black border around the CAPTCHA image. ```APIDOC ### Method public ImageCaptcha.Builder addBorder() ### Description Draws a single-pixel wide black border around the image. ### Returns - **ImageCaptcha.Builder** - The builder instance for method chaining. ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/StraightLineNoiseProducer.html The class definition for StraightLineNoiseProducer. ```java public class StraightLineNoiseProducer extends Object implements NoiseProducer ``` -------------------------------- ### RippleImageFilter Constructor Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/RippleImageFilter.html The default constructor for the RippleImageFilter class. ```java public RippleImageFilter() ``` -------------------------------- ### AudioCaptcha.isCorrect(String answer) Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/audio/AudioCaptcha.html Validates a user-provided string against the CAPTCHA's actual content. ```APIDOC ## boolean isCorrect(String answer) ### Description Checks if the provided answer matches the CAPTCHA content. ### Parameters - **answer** (String) - The candidate content to verify. ### Returns - **boolean** - Returns true if the answer matches, otherwise false. ``` -------------------------------- ### Class Declaration Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/noise/CurvedLineNoiseProducer.html The class definition for CurvedLineNoiseProducer. ```java public class CurvedLineNoiseProducer extends Object implements NoiseProducer ``` -------------------------------- ### Set color for AbstractWordRenderer Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/renderer/AbstractWordRenderer.Builder.html Configures the color supplier to provide a specific color. ```java public AbstractWordRenderer.Builder color(Color color) ``` -------------------------------- ### FishEyeImageFilter filter Method Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/FishEyeImageFilter.html Method to apply the fish-eye transformation to a BufferedImage in-place. ```java public void filter(BufferedImage image) ``` -------------------------------- ### ImageFilter Interface Definition Source: https://javadoc.io/doc/net.logicsquad/nanocaptcha/2.1/net/logicsquad/nanocaptcha/image/filter/ImageFilter.html The base interface for image distortion filters. ```java public interface ImageFilter ```