Skip to main content

Module image

Module image 

Source
Expand description

Images: the codecs, ports of those include/mln/util/image.hpp declares (decodeImage, encodePNG), from platform/default/src/mln/util/{image,jpeg_reader,png_reader,png_writer}.cpp.

C++ throws std::runtime_error; here the functions return Err(message) with the same message.

Port-only: decoder::decode is how the map’s code decodes images: with decode_image natively, and with the browser’s decoders on wasm.

The style’s images, as the renderer’s layouts request them, are in image_store, and the sprite parser in sprite.

Modules§

sprite
Sprites: the sprite parser, whose load_sprite and parse_sprite take and return owned values, as a job does. The map’s style loader fetches a sprite’s index and image and runs load_sprite on its thread pool.

Structs§

ImageStore

Enums§

ImageType
What a layout uses an image as.

Functions§

decode_image
Decodes data, choosing the format by its magic bytes. Data of no type it recognizes fails with ErrorKind::Unsupported, and an image that doesn’t decode with ErrorKind::InvalidArgument.
decode_png
encode_png