php-internal-docs 8.4.8
Unofficial docs for php/php-src
Loading...
Searching...
No Matches
gd_crop.c File Reference
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "gd.h"

Go to the source code of this file.

Functions

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)
 

Function Documentation

◆ gdImageCrop()

gdImagePtr gdImageCrop ( gdImagePtr src,
const gdRectPtr crop )

Function: gdImageCrop Crops the src image using the area defined by the <crop> rectangle. The result is returned as a new image.

Parameters: src - Source image crop - Rectangular region to crop

Returns: <gdImagePtr> on success or NULL

Definition at line 44 of file gd_crop.c.

◆ gdImageCropAuto()

gdImagePtr gdImageCropAuto ( gdImagePtr im,
const unsigned int mode )

Function: gdImageAutoCrop Automatic croping of the src image using the given mode (see <gdCropMode>)

Parameters: im - Source image mode - crop mode

Returns: <gdImagePtr> on success or NULL

See also: <gdCropMode>

Definition at line 79 of file gd_crop.c.

◆ gdImageCropThreshold()

gdImagePtr gdImageCropThreshold ( gdImagePtr im,
const unsigned int color,
const float threshold )

Function: gdImageThresholdCrop Crop an image using a given color. The threshold argument defines the tolerance to be used while comparing the image color and the color to crop. The method used to calculate the color difference is based on the color distance in the RGB(a) cube.

Parameters: im - Source image color - color to crop threshold - tolerance (0..100)

Returns: <gdImagePtr> on success or NULL

See also: <gdCropMode>, <gdImageAutoCrop> or <gdImageCrop>

Definition at line 181 of file gd_crop.c.