diff options
author | Christoph M. Becker <cmbecker69@gmx.de> | 2016-10-02 18:29:28 +0200 |
---|---|---|
committer | Christoph M. Becker <cmbecker69@gmx.de> | 2016-10-02 18:29:28 +0200 |
commit | 9a43a7b3fd99a162f593c6ce784ff4c2f2e03df8 (patch) | |
tree | 3dd5c0efa33aa58efcd000a1a650d2069e85d87a /src/gd.c | |
parent | d6d2dec0fba0c92dfcf3d1c480ba2c41bae74853 (diff) | |
download | libgd-9a43a7b3fd99a162f593c6ce784ff4c2f2e03df8.tar.gz |
Test and document the effects (aka. alpha blending modes)
Diffstat (limited to 'src/gd.c')
-rw-r--r-- | src/gd.c | 64 |
1 files changed, 48 insertions, 16 deletions
@@ -3906,9 +3906,20 @@ BGD_DECLARE(int) gdImageCompare (gdImagePtr im1, gdImagePtr im2) of gdAlphaBlend(), which merges alpha in the destination color much better. */ -/* - Function: gdAlphaBlend -*/ +/** + * Function: gdAlphaBlend + * + * Blend two colors + * + * Parameters: + * dst - The color to blend onto. + * src - The color to blend. + * + * See also: + * - <gdImageAlphaBlending> + * - <gdLayerOverlay> + * - <gdLayerMultiply> + */ BGD_DECLARE(int) gdAlphaBlend (int dst, int src) { int src_alpha = gdTrueColorGetAlpha(src); @@ -3956,9 +3967,20 @@ BGD_DECLARE(int) gdAlphaBlend (int dst, int src) static int gdAlphaOverlayColor (int src, int dst, int max ); -/* - Function: gdLayerOverlay -*/ +/** + * Function: gdLayerOverlay + * + * Overlay two colors + * + * Parameters: + * dst - The color to overlay onto. + * src - The color to overlay. + * + * See also: + * - <gdImageAlphaBlending> + * - <gdAlphaBlend> + * - <gdLayerMultiply> + */ BGD_DECLARE(int) gdLayerOverlay (int dst, int src) { int a1, a2; @@ -3984,11 +4006,20 @@ static int gdAlphaOverlayColor (int src, int dst, int max ) } } -/* - Function: gdLayerMultiply - - Apply 'multiply' effect. -*/ +/** + * Function: gdLayerMultiply + * + * Overlay two colors with multiply effect + * + * Parameters: + * dst - The color to overlay onto. + * src - The color to overlay. + * + * See also: + * - <gdImageAlphaBlending> + * - <gdAlphaBlend> + * - <gdLayerOverlay> + */ BGD_DECLARE(int) gdLayerMultiply (int dst, int src) { int a1, a2, r1, r2, g1, g2, b1, b2; @@ -4014,15 +4045,16 @@ BGD_DECLARE(int) gdLayerMultiply (int dst, int src) /** * Function: gdImageAlphaBlending * - * Sets the alpha blending flag + * Set the effect for subsequent drawing operations * - * The alpha blending flag is used for truecolor images only, and specifies - * whether the alpha channel should be copied or applied each time a pixel - * is drawn. + * Note that the effect is used for truecolor images only. * * Parameters: * im - The image. - * alphaBlendingArg - Whether the alpha blending flag should be set. + * alphaBlendingArg - The effect. + * + * See also: + * - <Effects> */ BGD_DECLARE(void) gdImageAlphaBlending (gdImagePtr im, int alphaBlendingArg) { |