Module guih.lib.blbfor

An api used for reading/writing Blit Byte Format images.

".bbf" note that this DOES NOT document the internal functions of the api even tho they are accessible

Functions

open (filename, mode, width, height, layers[, FG[, BG[, SYM[, meta]]]]) Opens a file for writing/reading.
blit_read_handle:get_pixel (layer, x, y[, return_blit]) Reads a pixel from the image.
blit_read_handle:get_line (layer, y) Reads a line from the image.
blit_write_handle:set_pixel (layer, x, y, char, fg, bg) Writes a single pixel to the image.
blit_write_handle:set_line (layer, y, char, fg, bg) Writes an entire line of blit to the image.
blit_write_handle:flush () Flushes the image into its file
blit_write_handle:close () Closes the image and saves it into its file.


Functions

open (filename, mode, width, height, layers[, FG[, BG[, SYM[, meta]]]])
Opens a file for writing/reading.

Parameters:

  • filename string the name of the file to open
  • mode string the mode to open the file in ("w" or "r")
  • width number the width of the image to write
  • height number the height of the image to write
  • layers number the amount of layers to write
  • FG number the foreground color to fill the new image with (optional)
  • BG number the background color to fill the new image with (optional)
  • SYM number the symbol to fill the new image with (optional)
  • meta table the custom metadata to save in the new image (optional)

Returns:

    blit_read_handle/blit_write_handle the handle to work with the file
blit_read_handle:get_pixel (layer, x, y[, return_blit])
Reads a pixel from the image.

Parameters:

  • layer number the layer to read the pixel from
  • x number the x coordinate of the pixel
  • y number the y coordinate of the pixel
  • return_blit boolean should the pixel data be returned in the blit format (optional)

Returns:

  1. string the symbol of the pixel
  2. number/string the foreground color of the pixel
  3. number/string the background color of the pixel
blit_read_handle:get_line (layer, y)
Reads a line from the image.

Parameters:

  • layer number the layer to read the line from
  • y number the y coordinate of the line

Returns:

  1. string the text of the line
  2. string the foreground color of the line (blit string)
  3. string the background color of the line (blit string)
blit_write_handle:set_pixel (layer, x, y, char, fg, bg)
Writes a single pixel to the image.

Parameters:

  • layer number the layer to write the pixel on
  • x number the x coordinate of the pixel
  • y number the y coordinate of the pixel
  • char number the symbol of the pixel
  • fg number the foreground color of the pixel
  • bg number the background color of the pixel
blit_write_handle:set_line (layer, y, char, fg, bg)
Writes an entire line of blit to the image.

Parameters:

  • layer number the layer to write the line on
  • y number the y coordinate of the line
  • char string the text to write to that line
  • fg string the foreground color of the line (blit string)
  • bg string the background color of the line (blit string)
blit_write_handle:flush ()
Flushes the image into its file
blit_write_handle:close ()
Closes the image and saves it into its file.
generated by LDoc 1.4.6 Last updated 2022-06-23 16:51:50