Function mupdf_sys::fz_new_test_device[][src]

pub unsafe extern "C" fn fz_new_test_device(
    ctx: *mut fz_context,
    is_color: *mut c_int,
    threshold: f32,
    options: c_int,
    passthrough: *mut fz_device
) -> *mut fz_device

Create a device to test for features.

Currently only tests for the presence of non-grayscale colors.

is_color: Possible values returned: 0: Definitely greyscale 1: Probably color (all colors were grey, but there were images or shadings in a non grey colorspace). 2: Definitely color

threshold: The difference from grayscale that will be tolerated. Typical values to use are either 0 (be exact) and 0.02 (allow an imperceptible amount of slop).

options: A set of bitfield options, from the FZ_TEST_OPT set.

passthrough: A device to pass all calls through to, or NULL. If set, then the test device can both test and pass through to an underlying device (like, say, the display list device). This means that a display list can be created and at the end we’ll know if it’s colored or not.

In the absence of a passthrough device, the device will throw an exception to stop page interpretation when color is found.