[][src]Crate ikon

A robust, flexible framework for creating encoders and decoders for various icon formats.

Overview

Ikon is intended to be used as a framework for developers interested in creating encoders and decoders for various icon formats such as .ico files and favicon schemes. It does not come with any encoders or decoders out of the box.

Instead, it simply automates much of the hard work of encoding, decoding and resampling different image formats, as well as provides powerfull abstractions, allowing developers to concentrate on the more relevant problems.

Icons are represented as maps between keys and images. An entry is a key-value pair contained in an icon. The type of the keys of an icon is what determines how it can be indexed.

Keys

Each icon format is associated with a particular type of key. The type of the keys of an icon is what determines how it can be indexed. Each key can only be associated with a single image.

Since the keys of an icon also encode information about the dimensions of it's associated image, Encode::Key and Decode::Key are required to implement AsSize.

Resampling

Raster graphics are scaled using resampling filters, which are represented by functions that take a source image and a size and return a re-scaled image.

This allows the users of ikon and any of it's dependant crates to provide their custom resampling filters. Common resampling filters are provided in the resample module. The resample module also exposes the resample::apply function, which applies a resampling filter to an image and checks if the outputted result matches the dimensions specified by the filter's arguments.

Re-exports

pub extern crate image;
pub extern crate resvg;
pub use resvg::raqote;
pub use resvg::usvg;

Modules

decode

Traits, types and functions to assist in dencoding commonly used icon formats.

encode

Traits, types and functions to assist in encoding commonly used icon formats.

resample

A collection of commonly used resampling filters.

Enums

Image

A uniun type for raster and vector graphics.

Traits

AsSize

A trait for types that represent the dimesions of an icon.