summaryrefslogtreecommitdiff
path: root/src/gd.c
diff options
context:
space:
mode:
authorChristoph M. Becker <cmbecker69@gmx.de>2016-10-02 18:29:28 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2016-10-02 18:29:28 +0200
commit9a43a7b3fd99a162f593c6ce784ff4c2f2e03df8 (patch)
tree3dd5c0efa33aa58efcd000a1a650d2069e85d87a /src/gd.c
parentd6d2dec0fba0c92dfcf3d1c480ba2c41bae74853 (diff)
downloadlibgd-9a43a7b3fd99a162f593c6ce784ff4c2f2e03df8.tar.gz
Test and document the effects (aka. alpha blending modes)
Diffstat (limited to 'src/gd.c')
-rw-r--r--src/gd.c64
1 files changed, 48 insertions, 16 deletions
diff --git a/src/gd.c b/src/gd.c
index 4a1eb91..0f80faa 100644
--- a/src/gd.c
+++ b/src/gd.c
@@ -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)
{