/usr/local/src/gd/gd/docs/naturaldocs/tmp/gdfx.c

# gdfx.c

Summary

gdfx.c |
Functions |
gdImageStringFTCircle | Draw text curved along the top and bottom of a circular area of an image.
gdImageSquareToCircle | Apply polar coordinate transformation to an image.
gdImageSharpen | Sharpen an image.

### Functions

### gdImageStringFTCircle

> char* gdImageStringFTCircle ( | gdImagePtr |  | im,
> | int |  | cx,
> | int |  | cy,
> | double |  | radius,
> | double |  | textRadius,
> | double |  | fillPortion,
> | char | * | font,
> | double |  | points,
> | char | * | top,
> | char | * | bottom,
> | int |  | fgcolor | )

Draw text curved along the top and bottom of a circular area of an image.

#### Parameters

im | The image to draw onto.
cx | The x-coordinate of the center of the circular area.
cy | The y-coordinate of the center of the circular area.
radius | The radius of the circular area.
textRadius | The height of each character; if textRadius is 1/2 of radius, characters extend halfway from the edge to the center.
fillPortion | The percentage of the 180 degrees of the circular area assigned to each section of text, that is actually occupied by text. The value has to be in range 0.0 to 1.0, with useful values from about 0.4 to 0.9; 0.9 looks better than 1.0 which is rather crowded.
font | The fontlist that is passed to gdImageStringFT.
points | The point size, which functions as a hint. Although the size of the text is determined by radius, textRadius and fillPortion, a point size that ‘hints’ appropriately should be passed. If it’s known that the text will be large, a large point size such as 24.0 should be passed to get the best results.
top | The text to draw clockwise at the top of the circular area.
bottom | The text to draw counterclockwise at the bottom of the circular area.
fgcolor | The font color.

#### Returns

NULL on success, or an error string on failure.

### gdImageSquareToCircle

> gdImagePtr gdImageSquareToCircle ( | gdImagePtr | im,
> | int | radius | )

Apply polar coordinate transformation to an image.

The X axis of the original will be remapped to theta (angle) and the Y axis of the original will be remapped to rho (distance from center).

#### Parameters

im | The image, which must be square, i.e. width == height.
radius | The radius of the new image, i.e. width == height == radius * 2.

#### Returns

The transformed image, or NULL on failure.

### gdImageSharpen

> void gdImageSharpen ( | gdImagePtr | im,
> | int | pct | )

Sharpen an image.

Uses a simple 3x3 convolution kernel and makes use of separability. It’s faster, but less flexible, than full-blown unsharp masking. Silently does nothing to non-truecolor images and for pct<0, as it’s not a useful blurring function.

#### Parameters

pct | The sharpening percentage, which can be greater than 100.

#### Author

Paul Troughton (paul<dot>troughton<at>ieee<dot>org)

> char* gdImageStringFTCircle ( | gdImagePtr |  | im,
> | int |  | cx,
> | int |  | cy,
> | double |  | radius,
> | double |  | textRadius,
> | double |  | fillPortion,
> | char | * | font,
> | double |  | points,
> | char | * | top,
> | char | * | bottom,
> | int |  | fgcolor | )

Draw text curved along the top and bottom of a circular area of an image.

> gdImagePtr gdImageSquareToCircle ( | gdImagePtr | im,
> | int | radius | )

Apply polar coordinate transformation to an image.

> void gdImageSharpen ( | gdImagePtr | im,
> | int | pct | )

Sharpen an image.

> char * gdImageStringFT ( |  | gdImage | * | im,
> |  | int | * | brect,
> |  | int |  | fg,
> | const | char | * | fontlist,
> |  | double |  | ptsize,
> |  | double |  | angle,
> |  | int |  | x,
> |  | int |  | y,
> | const | char | * | string | )

Render an UTF-8 string onto a gd image.
Close