Functions
decode
decode(path, model?) -> int<collection.IMAGE>
- path
string
- The path to grab the image from. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.IMAGE>
decode_string
decode_string(name, encoding, data, model?) -> int<collection.IMAGE>
- name
string
- encoding
int<image.Encoding>
- data
string
- model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.IMAGE>
decode_config
decode_config(path) -> int, int, bool
- path
string
- The path to grab the image from.
int
- The width of the image.int
- The height of the image.bool
- If the image can be decoded.
decode_config_string
decode_config_string(encoding, data) -> int, int, bool
- encoding
int<image.Encoding>
- data
string
int
- The width of the image.int
- The height of the image.bool
- If the image can be decoded.
decode_into
decode_into(path, id, model?)
- path
string
- The path to grab the image from. - id
int<collection.INT>
- Image ID to overwrite with decoded image. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
decode_into_string
decode_into_string(name, encoding, data, id, model?)
- name
string
- encoding
int<image.Encoding>
- data
string
- id
int<collection.INT>
- Image ID to overwrite with decoded image. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
decode_cached
decode_cached(path, model?) -> int<collection.CRATE_CACHEDIMAGE>
- path
string
- The path to grab the image from. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.CRATE_CACHEDIMAGE>
decode_cached_string
decode_cached_string(encoding, data, model?) -> int<collection.CRATE_CACHEDIMAGE>
- encoding
int<image.Encoding>
- data
string
- model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.CRATE_CACHEDIMAGE>
decode_png_data
decode_png_data(path, model?) -> int<collection.IMAGE>, []struct<image.PNGDataChunk>
- path
string
- The path to grab the image from. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.IMAGE>
[]struct<image.PNGDataChunk>
decode_png_data_string
decode_png_data_string(name, data, model?) -> int<collection.IMAGE>, []struct<image.PNGDataChunk>
- name
string
- data
string
- model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
int<collection.IMAGE>
[]struct<image.PNGDataChunk>
decode_favicon
decode_favicon(path, encoding, model?) -> []int<collection.IMAGE>
Decodes an ICO type favicon file into an array of images.
- path
string
- The path to grab the image from. - encoding
int<image.Encoding>
- The encoding to use for the extracted images. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
[]int<collection.IMAGE>
decode_favicon_string
decode_favicon_string(name, data, encoding, model?) -> []int<collection.IMAGE>
Decodes an ICO type favicon into an array of images.
- name
string
- data
string
- encoding
int<image.Encoding>
- The encoding to use for the extracted images. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
[]int<collection.IMAGE>
decode_favicon_cursor
decode_favicon_cursor(path, encoding, model?) -> []int<collection.IMAGE>, []int
Decodes a CUR type favicon file into an array of images and hotspots.
- path
string
- The path to grab the image from. - encoding
int<image.Encoding>
- The encoding to use for the extracted images. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
[]int<collection.IMAGE>
[]int
- Pairs of ints representing the hotspot of each cursor. e.g. [x1, y1, x2, y2, ...]
decode_favicon_cursor_string
decode_favicon_cursor_string(name, data, encoding, model?) -> []int<collection.IMAGE>, []int
Decodes a CUR type favicon into an array of images and hotspots.
- name
string
- data
string
- encoding
int<image.Encoding>
- The encoding to use for the extracted images. - model
int<image.ColorModel>
- Used only to specify default when there is an unsupported color model.
[]int<collection.IMAGE>
[]int
- Pairs of ints representing the hotspot of each cursor. e.g. [x1, y1, x2, y2, ...]
decode_favicon_config
decode_favicon_config(path) -> struct<io.FaviconConfig>
- path
string
- The path to grab the image from.
struct<io.FaviconConfig>
decode_favicon_config_string
decode_favicon_config_string(data) -> struct<io.FaviconConfig>
- data
string
struct<io.FaviconConfig>
decode_gif
decode_gif(path, name, encoding, model?) -> struct<image.GIF>
- path
string
- name
string
- encoding
int<image.Encoding>
- model
int<image.Model>
struct<image.GIF>
decode_gif_string
decode_gif_string(data, name, encoding, model?) -> struct<image.GIF>
- data
string
- name
string
- encoding
int<image.Encoding>
- model
int<image.Model>
struct<image.GIF>
load_embedded
load_embedded(embedded, model?) -> int<collection.IMAGE>
- embedded
int<io.Embedded>
- model
int<image.ColorModel>
- Used only to specify default of unsupported color models.
int<collection.IMAGE>
encode
encode(id, path)
- id
int<collection.IMAGE>
- The image id to encode and save to file. - path
string
- The directory path to save the file to.
encode_string
encode_string(id) -> string
@blocking
- id
int<collection.IMAGE>
- The image id to encode and save to file.
string
encode_png_data
encode_png_data(id, chunks, path)
- id
int<collection.IMAGE>
- The image id to encode and save to file. - chunks
[]struct<image.PNGDataChunk>
- The PNG data chunks to encode with the image. - path
string
- The directory path to save the file to.
encode_png_data_string
encode_png_data_string(id, chunks) -> string
@blocking
- id
int<collection.IMAGE>
- The image id to encode and save to file. - chunks
[]struct<image.PNGDataChunk>
- The PNG data chunks to encode with the image.
string
encode_favicon
encode_favicon(name, ids, path)
@blocking
- name
string
- The name of the favicon file, without the extension. - ids
[]int<collection.IMAGE>
- List of image ids to encode and save into a favicon. - path
string
- The directory path to save the file to.
encode_favicon_string
encode_favicon_string(ids) -> string
@blocking
- ids
[]int<collection.IMAGE>
- List of image ids to encode and save into a favicon.
string
encode_favicon_cursor
encode_favicon_cursor(name, ids, hotspots, path)
@blocking
- name
string
- The name of the favicon file, without the extension. - ids
[]int<collection.IMAGE>
- List of image ids to encode and save into a favicon. - hotspots
[]int
- Pairs of ints representing the hotspot of each cursor. - path
string
- The directory path to save the file to.
encode_favicon_cursor_string
encode_favicon_cursor_string(ids, hotspots) -> string
@blocking
- ids
[]int<collection.IMAGE>
- List of image ids to encode and save into a favicon. - hotspots
[]int
- Pairs of ints representing the hotspot of each cursor.
string
encode_gif
encode_gif(name, gif, path)
@blocking
- name
string
- Excluding the extension. - gif
struct<image.GIF>
- path
string
- The directory path to save the file to.
encode_gif_string
encode_gif_string(gif) -> string
@blocking
- name
string
- Excluding the extension. - gif
struct<image.GIF>
string
encode_webp
encode_webp(id, path, preset, lossy, level)
- id
int<collection.IMAGE>
- The image id to encode and save to file. - path
string
- The directory path to save the file to. - preset
int<image.WebPPreset>
- lossy
bool
- level
float
encode_webp_string
encode_webp_string(id, preset, lossy, lvel) -> string
@blocking
- id
int<collection.IMAGE>
- The image id to encode and save to file. - preset
int<image.WebPPreset>
- lossy
bool
- level
float
string
load_palette
load_palette(path) -> []struct<image.Color>
Use to load a hex color palette file; For example, from lospec.
- path
string
- Path to a .hex file for the palette.
[]struct<image.Color>
save_palette
save_palette(path, colors)
Discards alpha channels.
- path
string
- File to save hex data to, filename should end in .hex. - colors
[]struct<image.Color>
remove
remove(path, all?)
- path
string
- all
bool
- If to remove all directories going to the given path.
exists
exists(path) -> bool, bool
- path
string
bool
- If the file exists.bool
- If the file is a directory.
dir
dir(path) -> []string
- path
string
[]string
- Array containing all file paths in the directory.
dir_img
dir_img(path) -> []string
- path
string
- The directory path to scan for images.
[]string
- Array containing paths to each valid image in the directory.
dir_txt
dir_txt(path) -> []string
- path
string
- The directory path to scan for txt.
[]string
- Array containing paths to each valid txt in the directory.
dir_json
dir_json(path) -> []string
- path
string
- The directory path to scan for json.
[]string
- Array containing paths to each valid json in the directory.
dir_dir
dir_dir(path) -> []string
- path
string
- The directory path to scan for directories.
[]string
- Array containing paths to each valid dir in the directory.
dir_filter
dir_filter(path, filter) -> []string
- path
string
- The directory path to scan. - filter
[]string
- Array of file extensions to include.
[]string
- Array containing paths to all files that match the filter.
dir_recursive
dir_recursive(path) -> []string
- path
string
- The directory path to scan for files, within all sub-directories.
[]string
- Array containing paths to each valid file in the directory and sub-directories.
dir_recursive_filter
dir_recursive_filter(path, filter) -> []string
- path
string
- The directory path to scan for files, within all sub-directories. - filter
[]string
- Array of file extensions to include.
[]string
- Array containing paths to each valid file in the directory and sub-directories.
mkdir
mkdir(path, all?)
- path
string
- all
bool
- If to create all directories going to the given path.
path_join
path_join(paths...) -> string
- paths
string...
string
wd
wd() -> string
Returns the dir of the currently running workflow.
string
default_input
default_input() -> string
Returns the default input directory specified in the config file.
string
default_output
default_output() -> string
Returns the default output directory specified in the config file.
string
base
base(pth) -> string
Returns the name of the file only, without the extension or trailing path.
- pth
string
string
path_to
path_to(pth) -> string
Returns the path to a file.
- pth
string
string
ext
ext(pth) -> string
Returns the ext of the file only.
- pth
string
string
Constants
Embedded
EMBEDDED_ICONCIRCLE_16x16
EMBEDDED_ICONCIRCLE_32x32
EMBEDDED_ICON_16x16
EMBEDDED_ICON_32x32
EMBEDDED_ICON_180x180
EMBEDDED_ICON_192x192
EMBEDDED_ICON_512x512
ICOType
ICOTYPE_ICO
ICOTYPE_CUR
Structs
FaviconConfig
- type
int<io.ICOType>
- The type of favicon. - count
int
- The number of images in the favicon. - largest
int
- The index of the largest image in the favicon. - entries
[]struct<io.ICOEntry>
- The entries of the favicon.
ICOEntry
- width
int
- The width of the image. - height
int
- The height of the image. - data1
int
- The x hotspot of the cursor; always 0 for icons. - data2
int
- The y hotspot of the cursor; always 0 for icons.