Function mupdf_sys::fz_new_indexed_colorspace[][src]

pub unsafe extern "C" fn fz_new_indexed_colorspace(
    ctx: *mut fz_context,
    base: *mut fz_colorspace,
    high: c_int,
    lookup: *mut c_uchar
) -> *mut fz_colorspace

Create an indexed colorspace.

The supplied lookup table is high palette entries long. Each entry is n bytes long, where n is given by the number of colorants in the base colorspace, one byte per colorant.

Ownership of lookup is passed it; it will be freed on destruction, so must be heap allocated.

The colorspace will keep an additional reference to the base colorspace that will be dropped on destruction.

The returned reference should be dropped when it is finished with.

Colorspaces are immutable once created.