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

Handles the loading, conversion and export of Image types

Summary

Functions

Export image data to file, returns true on success

Export image as code file defining an array of bytes, returns true on success

Check if an image is ready

Load image sequence from file (frames appended to image.data)

Load image from memory buffer, fileType refers to extension: i.e. '.png'

Load image from screen buffer and (screenshot)

Load image from GPU texture data

Load image from SVG file data or string with specified size

Unload image from CPU memory (RAM)

Functions

Link to this function

export_image(image, file_name)

View Source
@spec export_image(image :: Exray.Structs.Image.t(), file_name :: binary()) ::
  exported :: boolean()

Export image data to file, returns true on success

Link to this function

export_image_as_code(image, file_name)

View Source
@spec export_image_as_code(image :: Exray.Structs.Image.t(), file_name :: binary()) ::
  exported :: boolean()

Export image as code file defining an array of bytes, returns true on success

Link to this function

export_image_to_memory(image, file_type, file_size)

View Source
@spec export_image_to_memory(
  image :: Exray.Structs.Image.t(),
  file_type :: binary(),
  file_size :: [integer()]
) :: buffer :: binary()

Export image to memory buffer

@spec image_is_ready?(image :: Exray.Structs.Image.t()) :: image_is_ready :: boolean()

Check if an image is ready

Link to this function

load_image_anim(file_name, frames)

View Source
@spec load_image_anim(file_name :: binary(), frames :: [integer()]) ::
  image :: Exray.Structs.Image.t()

Load image sequence from file (frames appended to image.data)

Link to this function

load_image_from_memory(file_type, file_data, data_size)

View Source
@spec load_image_from_memory(
  file_type :: binary(),
  file_data :: binary(),
  data_size :: integer()
) ::
  image :: Exray.Structs.Image.t()

Load image from memory buffer, fileType refers to extension: i.e. '.png'

Link to this function

load_image_from_screen()

View Source
@spec load_image_from_screen() :: image :: Exray.Structs.Image.t()

Load image from screen buffer and (screenshot)

Link to this function

load_image_from_texture(texture)

View Source
@spec load_image_from_texture(texture :: Exray.Structs.Texture.t()) ::
  image :: Exray.Structs.Image.t()

Load image from GPU texture data

Link to this function

load_image_raw(file_name, width, height, format, header_size)

View Source
@spec load_image_raw(
  file_name :: binary(),
  width :: integer(),
  height :: integer(),
  format :: integer(),
  header_size :: integer()
) :: image :: Exray.Structs.Image.t()

Load image from RAW file data

Link to this function

load_image_svg(file_name_or_string, width, height)

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

Load image from SVG file data or string with specified size

@spec unload_image(image :: Exray.Structs.Image.t()) :: :ok

Unload image from CPU memory (RAM)