ImageGear for C and C++ on Windows v21.0 - Updated
API Reference Guide / Core Component API Reference / Core Component Functions Reference / FX Functions / IG_FX_solarize
In This Topic
    IG_FX_solarize
    In This Topic

    The Solarize effect mimics the accidental exposure of photographic film to light, by inverting the colors of pixels whose lightness exceeds a given threshold.

    Declaration:

     
    Copy Code
    AT_ERRCOUNT ACCUAPI IG_FX_solarize(
            HIGEAR hIGear,
            AT_INT nThreshold
    );
    

    Arguments:

    Name Type Description
    hIGear HIGEAR Image to which to apply the effect.
    nThreshold AT_INT Specifies minimum intensity at which the pixels should be inverted.

    Return Value:

    Returns the number of ImageGear errors that occurred during this function call.

    Supported Raster Image Formats:

    All pixel formats supported by ImageGear for C and C++, except:
    Indexed RGB – 1 bpp;
    Indexed RGB with non-grayscale palette;
    Grayscale – 1 bpp;
    Images that have a Grayscale LUT attached to them.

    Sample:

    Image Processing

    Remarks:

    To calculate the threshold, use the following formula:

     
    Copy Code
    2^bpc (i.e., 24bit RGB is 8bpc, 2^8 = 256, hence the range is 0 to 256)