[][src]Function imagequant_sys::liq_image_create_rgba

pub unsafe extern "C" fn liq_image_create_rgba(
    attr: &liq_attr,
    bitmap: *const u8,
    width: c_int,
    height: c_int,
    gamma: f64
) -> *mut liq_image

Creates an object that represents the image pixels to be used for quantization and remapping.

The pixel array must be contiguous run of RGBA pixels (alpha is the last component, 0 = transparent, 255 = opaque).

The first argument is attributes object from liq_attr_create(). The same attr object should be used for the entire process, from creation of images to quantization.

The pixels array must not be modified or freed until this object is freed with liq_image_destroy(). See also liq_image_set_memory_ownership().

width and height are dimensions in pixels. An image 10x10 pixel large will need a 400-byte array.

gamma can be 0 for images with the typical 1/2.2 gamma. Otherwise gamma must be > 0 and < 1, e.g. 0.45455 (1/2.2) or 0.55555 (1/1.8). Generated palette will use the same gamma unless liq_set_output_gamma() is used. If liq_set_output_gamma is not used, then it only affects whether brighter or darker areas of the image will get more palette colors allocated.

Returns NULL on failure, e.g. if pixels is NULL or width/height is <= 0.