summaryrefslogtreecommitdiff
path: root/ext/gd/libgd/gd.h
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2013-02-28 17:24:23 +0100
committerPierre Joye <pierre.php@gmail.com>2013-02-28 17:24:23 +0100
commita991360344ed5bca7c20f74a10891d0fc52f0c9f (patch)
tree5dd0cd6b3687f6ed5e5f7db253d4f224f0cbda47 /ext/gd/libgd/gd.h
parent82765a07800fe39f662bb45fd18199d007e0dc23 (diff)
downloadphp-git-a991360344ed5bca7c20f74a10891d0fc52f0c9f.tar.gz
- add image crop support
Diffstat (limited to 'ext/gd/libgd/gd.h')
-rw-r--r--ext/gd/libgd/gd.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/ext/gd/libgd/gd.h b/ext/gd/libgd/gd.h
index c4a47af7fd..adef026b6f 100644
--- a/ext/gd/libgd/gd.h
+++ b/ext/gd/libgd/gd.h
@@ -209,6 +209,31 @@ typedef struct {
/* Text functions take these. */
typedef gdFont *gdFontPtr;
+
+/**
+ * Group: Types
+ *
+ * typedef: gdRect
+ * Defines a rectilinear region.
+ *
+ * x - left position
+ * y - right position
+ * width - Rectangle width
+ * height - Rectangle height
+ *
+ * typedef: gdRectPtr
+ * Pointer to a <gdRect>
+ *
+ * See also:
+ * <gdSetInterpolationMethod>
+ **/
+typedef struct
+{
+ int x, y;
+ int width, height;
+}
+gdRect, *gdRectPtr;
+
/* For backwards compatibility only. Use gdImageSetStyle()
for MUCH more flexible line drawing. Also see
gdImageSetBrush(). */
@@ -690,6 +715,31 @@ void gdImageFlipBoth(gdImagePtr im);
#define GD_FLIP_VERTICAL 2
#define GD_FLIP_BOTH 3
+/**
+ * Group: Crop
+ *
+ * Constants: gdCropMode
+ * GD_CROP_DEFAULT - Default crop mode (4 corners or background)
+ * GD_CROP_TRANSPARENT - Crop using the transparent color
+ * GD_CROP_BLACK - Crop black borders
+ * GD_CROP_WHITE - Crop white borders
+ * GD_CROP_SIDES - Crop using colors of the 4 corners
+ *
+ * See also:
+ * <gdImageAutoCrop>
+ **/
+enum gdCropMode {
+ GD_CROP_DEFAULT = 0,
+ GD_CROP_TRANSPARENT,
+ GD_CROP_BLACK,
+ GD_CROP_WHITE,
+ GD_CROP_SIDES
+};
+
+gdImagePtr gdImageCrop(gdImagePtr src, const gdRectPtr crop);
+gdImagePtr gdImageCropAuto(gdImagePtr im, const unsigned int mode);
+gdImagePtr gdImageCropThreshold(gdImagePtr im, const unsigned int color, const float threshold);
+
#define GD_CMP_IMAGE 1 /* Actual image IS different */
#define GD_CMP_NUM_COLORS 2 /* Number of Colours in pallette differ */
#define GD_CMP_COLOR 4 /* Image colours differ */