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

    This function takes contrast (dblContrast), brightness (dblBrightness) and gamma (dblGamma) parameters and calculates look-up tables accordingly and sets them into the corresponding options.

    Declaration:

     
    Copy Code
    AT_ERRCOUNT  ACCUAPI  IG_dspl_gamma_correction_set(
            [IN] HIGEAR hIGear,
            [IN] DWORD dwGrpID,
            [IN] AT_MODE nFlags,
            [IN] DOUBLE dblContrast,
            [IN] DOUBLE dblBrightness,
            [IN] DOUBLE dblGamma
    );
    

    Arguments:

    Name Type Description
    hIGear HIGEAR ImageGear handle of image.
    dwGrpID DWORD Identifier of group in which to set look-up tables.
    nFlags AT_MODE

    Specify which look-up tables to set. Possible values are 0 or a combination of these flags:

    • IG_DSPL_R_CHANNEL - if this flag is set then the RedLut option is to be set.
    • IG_DSPL_G_CHANNEL - if this flag is set then the GreenLut option is to be set.
    • IG_DSPL_B_CHANNEL - if this flag is set then the BlueLut option is to be set.
    • The constant IG_DSPL_ALL_CHANNELS is defined for convenience and can be used to set all three options.
     
    Copy Code
    #define IG_DSPL_ALL_CHANNELS
    (IG_DSPL_R_CHANNEL|IG_DSPL_G_CHANNEL|I
    G_DSPL_B_CHANNEL)
    
    dblContrast DOUBLE Contrast value to use in calculations. You can use any value.
    dblBrightness DOUBLE Brightness value to use in calculations. Must be in the range from -255.0 to +255.0.
    dblGamma DOUBLE Gamma value to use in calculations. Must be greater than 0.0; however the most useful values are in the range from 1.8 to 2.2.

    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++.

    Sample:

    MFC

    Example:

     
    Copy Code
    HIGEAR           hIGear;    /* HIGEAR handle of image  */ 
    DWORD           nGrpID;    /* display group identifier */
     ...
    IG_dspl_gamma_correction_set( hIGear, nGrpID, IG_DSPL_ALL_CHANNELS, 2.0, 120.0, 2.0 );
     ...
    

    Remarks:

    All look-up tables specified in the nFlagsparameter are initialized with the same value based on the dblContrast, dblBrightness, and dblGamma values.