API

VisualAtom.PERMConstant

https://github.com/caseman/noise/blob/bb32991ab97e90882d0e46e578060717c5b90dc5/_noise.h#L29-L61

source
VisualAtom.AtomMethod
Atom(rng::AbstractRNG, config::Config)

Arguments

  • rng::AbstractRNG: The random number generator to be used.
  • config::Config: A configuration object containing the parameter ranges.

Returns

  • Atom: A new Atom instance with randomly generated properties.
source
VisualAtom.ConfigType
Config

A struct representing the configuration for generating atom instances and images.

source
VisualAtom.ConfigMethod
Config(config_path::AbstractString)

Create a new Config instance by reading and parsing the configuration file at the specified config_path.

Arguments

  • config_path::AbstractString: Path to the configuration file (TOML format).

Returns

  • Config: A new Config instance with properties read from the configuration file.
source
VisualAtom.generate_instancesMethod
generate_instances(config::Config; save_root::AbstractString, category_id::Int, num_instances::Int)

Generate instances of Atom images based on the configuration object andsave them to the specified directory. The images will be saved in a subdirectory named after the category ID.

Arguments

  • config::Config: The configuration object containing parameter ranges for the Atom generation.
  • save_root::AbstractString: The root directory where the images will be saved.
  • category_id::Int: The category ID, used for generating the seed and naming the output subdirectory.
  • num_instances::Int: The number of instances (images) to generate and save.

Returns

  • This function does not return a value; it saves generated images to the specified directory.
source
VisualAtom.render!Method
render!(rng::AbstractRNG, atom::Atom, canvas::AbstractMatrix)

Render an atom onto a canvas, modifying the canvas in-place. The atom's properties and a random number generator are used to generate the image.

Arguments

  • rng::AbstractRNG: The random number generator to be used.
  • atom::Atom: The atom instance with properties defining its appearance.
  • canvas::AbstractMatrix: The canvas (matrix of color values) onto which the atom will be rendered.

Returns

  • canvas::AbstractMatrix: The modified canvas with the rendered atom.
source
VisualAtom.save_imagesMethod
save_images(rng::AbstractRNG, atom::Atom; save_dir::AbstractString, num_instances::Int, H::Int, W::Int)

Render and save images of the Atom instance atom onto a canvas with specified dimensions. The images will be saved in the specified directory.

Arguments

  • rng::AbstractRNG: The random number generator to be used.
  • atom::Atom: The atom instance with properties defining its appearance.
  • save_dir::AbstractString: The directory where the images will be saved.
  • num_instances::Int: The number of instances (images) to generate and save.
  • H::Int: The height of the canvas.
  • W::Int: The width of the canvas.

Returns

  • This function does not return a value; it saves generated images to the specified directory.
source
VisualAtom.uniformMethod
uniform([rng=GLOBAL_RNG], a::T, b::T) where {T<:AbstractFloat}
uniform([rng=GLOBAL_RNG], a::Real, b::Real)

Generate a random number in the interval [a, b), uniformly distributed, using the provided random number generator rng. The arguments a and b must be of the same subtype of AbstractFloat.

Arguments

  • rng::AbstractRNG: The random number generator to be used.
  • a::T: The lower bound of the interval (inclusive).
  • b::T: The upper bound of the interval (exclusive).

Returns

  • T: A random number in the interval [a, b).
source