IIXC_Page::Correction Method

From PDF XChange PDF SDK
Jump to: navigation, search

The Correction method allows Brightness, Contrast and Gamma adjustments to the tonal range of a page for each valid color channel: Red, Green and Blue. This function applies the same defined value to every pixel in the page (or the specified rectangular area) for the color specified.

Syntax

HRESULT Correction([in]  RECT*   pRect,
                   [in]  double  nRedBr,
                   [in]  double  nGreenBr,
                   [in]  double  nBlueBr,
                   [in]  double  nRedCont,
                   [in]  double  nGreenCont,
                   [in]  double  nBlueCont,
                   [in]  double  nRedGamma,
                   [in]  double  nGreenGamma,
                   [in]  double  nBlueGamma);

Parameters

pRect
[in] Pointer to RECT structure which defines the rectangular area where the function should be applied. If this parameter is NULL, the entire page will be processed.
Note:
Please note that partial processing of an area of a page is not supported for all image formats. For example, it is not supported for indexed images, because each pixel in such images does not contain a color, but an index into a color table (or palette) which is common for the entire page
nRedBr
[in] Specifies the Brightness level to be applied to the red channel of the page or area. The range of the value is from -255.0 to +255.0.
If the image doesn't contain a red channel (gray image), this parameter is ignored.
nGreenBr
[in] Specifies the Brightness level to be applied to the green channel of the page or area. The range of the value is from -255.0 to +255.0.
If the image doesn't contain a green channel (gray image), this parameter is ignored.
nBlueBr
[in] Specifies the Brightness level to be applied to the blue channel of the page or area. The range of the value is from -255.0 to +255.0.
This parameter is used as the Brightness level for images that contains only a gray channel.
nRedCont
[in] Specifies the Contrast level to be applied to the red channel of the page or area. The range of the value is from 0.0 to 2.0 (with value of 1.0 contrast level will be not changed).
If the image doesn't contain a red channel (gray image), this parameter is ignored.
nGreenCont
[in] Specifies the Contrast level to be applied to the green channel of the page or area. The range of the value is from 0.0 to 2.0 (with value of 1.0 contrast level will be not changed).
If the image doesn't contain a green channel (gray image), this parameter is ignored.
nBlueCont
[in] Specifies the Contrast level to be applied to the blue channel of the page or area. The range of the value is from 0.0 to 2.0 (with value of 1.0 contrast level will be not changed).
This parameter is used as contrast level for images that contain only a gray channel.
nRedGamma
[in] Specifies the Gamma level to be applied to the red channel of the page or area. The range of the value is from 0.125 to 8.0 (with value of 1.0 Gamma level will be not changed).
If the image doesn't contain a red channel (gray image), this parameter is ignored.
nGreenGamma
[in] Specifies the Gamma level to be applied to the green channel of the page or area. The range of the value is from 0.125 to 8.0 (with value of 1.0 Gamma level will be not changed).
If the image doesn't contain a green channel (gray image), this parameter is ignored.
nBlueGamma
[in] Specifies the Gamma level to be applied to the blue channel of the page or area. The range of the value is from 0.125 to 8.0 (with value of 1.0 Gamma level will be not changed).
If the image doesn't contain blue channel (gray image), this parameter is ignored.

Return Value

Returns S_OK if operation was successful or error code in other cases.

See Also

IIXC_Page