View Source Exray.Textures.Image.Generation (Exray v0.6.0)

Image generation functions like creating gradients, noise maps, raw color

Summary

Functions

Generate image: cellular algorithm, bigger tileSize means bigger cells

Generate image: plain color

Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient

Generate image: grayscale image from text data

Generate image: white noise

Functions

Link to this function

gen_image_cellular(width, height, tile_size)

View Source
@spec gen_image_cellular(
  width :: integer(),
  height :: integer(),
  tile_size :: integer()
) ::
  image :: Exray.Structs.Image.t()

Generate image: cellular algorithm, bigger tileSize means bigger cells

Link to this function

gen_image_checked(width, height, checks_x, checks_y, col1, col2)

View Source
@spec gen_image_checked(
  width :: integer(),
  height :: integer(),
  checks_x :: integer(),
  checks_y :: integer(),
  col1 :: Exray.Structs.Color.t(),
  col2 :: Exray.Structs.Color.t()
) :: image :: Exray.Structs.Image.t()

Generate image: checked

Link to this function

gen_image_color(width, height, color)

View Source
@spec gen_image_color(
  width :: integer(),
  height :: integer(),
  color :: Exray.Structs.Color.t()
) ::
  image :: Exray.Structs.Image.t()

Generate image: plain color

Link to this function

gen_image_gradient_linear(width, height, direction, start, finish)

View Source
@spec gen_image_gradient_linear(
  width :: integer(),
  height :: integer(),
  direction :: integer(),
  start :: Exray.Structs.Color.t(),
  finish :: Exray.Structs.Color.t()
) :: image :: Exray.Structs.Image.t()

Generate image: linear gradient, direction in degrees [0..360], 0=Vertical gradient

Link to this function

gen_image_gradient_radial(width, height, density, inner, outer)

View Source
@spec gen_image_gradient_radial(
  width :: integer(),
  height :: integer(),
  density :: float(),
  inner :: Exray.Structs.Color.t(),
  outer :: Exray.Structs.Color.t()
) :: image :: Exray.Structs.Image.t()

Generate image: radial gradient

Link to this function

gen_image_gradient_square(width, height, density, inner, outer)

View Source
@spec gen_image_gradient_square(
  width :: integer(),
  height :: integer(),
  density :: float(),
  inner :: Exray.Structs.Color.t(),
  outer :: Exray.Structs.Color.t()
) :: image :: Exray.Structs.Image.t()

Generate image: square gradient

Link to this function

gen_image_perlin_noise(width, height, offset_x, offset_y, scale)

View Source
@spec gen_image_perlin_noise(
  width :: integer(),
  height :: integer(),
  offset_x :: integer(),
  offset_y :: integer(),
  scale :: float()
) :: image :: Exray.Structs.Image.t()

Generate image: perlin noise

Link to this function

gen_image_text(width, height, text)

View Source
@spec gen_image_text(width :: integer(), height :: integer(), text :: binary()) ::
  image :: Exray.Structs.Image.t()

Generate image: grayscale image from text data

Link to this function

gen_image_white_noise(width, height, factor)

View Source
@spec gen_image_white_noise(
  width :: integer(),
  height :: integer(),
  factor :: float()
) ::
  image :: Exray.Structs.Image.t()

Generate image: white noise