PHP Imlib2 Classes - Imlib - Class: ImlibImage

Packageindex | Classtrees | Modulegroups | Elementlist | Report | XML Files
File: /home/matt/src/cvs/imlib/docs/class.ImlibImage.php ##### PHP Imlib2 Classes - Imlib # ImlibImage ImlibImage Handles image loading and saving, parameters, manipulation, and rendering.
#### public class ImlibImage Handles image loading and saving, parameters, manipulation, and rendering. This class contains methods for the loading and saving of image files. Alsocontained in this class are functions for getting and setting image parameters,image modification, and rendering.
Authors | Matt McClanahan <cardinal@dodds.net>
Version | 0.3
## Public Method Summary
void | #### ImlibImage() ImlibImage constructor
void | #### blend_onto_image(int $dst, bool $alpha, int $sx, int $sy, int $sw, int $sh, int $dx, int $dy, int $dw, int $dh, bool $dither, bool $blend, bool $alias) Blend a region of the current image onto the region of another ImlibImage
void | #### blur(int $r) Blur an image with a given blur radius
object ImlibImage | #### create_clone() Create a clone of the current instance, return a new ImlibImage
object ImlibImage | #### create_cropped(int $sx, int $sy, int $sw, int $sh) Create a cropped ImlibImage from a region of the current instance, return a new ImlibImage
object ImlibImage | #### create_cropped_scaled(int $sx, int $sy, int $sw, int $sh, int $dw, int $dh) Create a cropped, scaled ImlibImage from a region of the current instance, return a new ImlibImage
int | #### create(int $width, int $height) Create an image resource to use with this instance
object ImlibImage | #### create_rotated(float $degrees, [ float $radians ]) Create a rotated ImlibImage, return a new ImlibImage
object ImlibImage | #### create_scaled(integer $width, [ integer $height ]) Create a scaled ImlibImage, return a new ImlibImage
void | #### dump([ integer $quality ]) Output the raw image data of the current instance to stdout
void | #### flip_diagonal() Flip the current image diagonally
void | #### flip_horizontal() Flip the current image horizontally
void | #### flip_vertical() Flip the current image vertically
void | #### free() Free the current instance and image resource
mixed | #### get_filename() Get the current filename, if it's set
string | #### get_format() Get the current image format. The default is png.
integer | #### get_height() Get the current image's height
integer | #### get_id() Get the current image's resource id#
integer | #### get_width() Get the current image's width
boolean | #### has_alpha() Check if the image has an alpha channel
void | #### modify_alpha(int $alpha) Set the alpha channel of an image
integer | #### load(string $infile, [ integer $err ]) Load an image file into the current instance
bool | #### save(string $outfile, [ integer $quality ]) Save the current instance to a file
void | #### set_format(string $format) Set the image format for the current instance
void | #### sharpen(int $r) Sharpen an image with a given sharpen radius
void | #### tile() Seamlessly tile the current image both horizontally and vertically
void | #### tile_horizontal() Seamlessly tile the current image horizontally
void | #### tile_vertical() Seamlessly tile the current image vertically
## Private Method Summary
mixed | #### _get_cb(string $cb) Callback for functions which query the current instance's attributes
void | #### _no_param_cb(string $cb) Callback for functions which flip or tile the current instance
## Private Field Summary
integer | #### $id The image resource id#
## Public Method Details
#### ImlibImage
public void ImlibImage( )
| ImlibImage constructor
Returns | void
#### blend_onto_image
public void blend_onto_image( int $dst, bool $alpha, int $sx, int $sy, int $sw, int $sh, int $dx, int $dy, int $dw, int $dh, bool $dither, bool $blend, bool $alias )
| Blend a region of the current image onto the region of another ImlibImage
Parameter
int | $dst | ``
| id# of the destination image
bool | $alpha | ``
| alpha
int | $sx | ``
| left source X coordinate
int | $sy | ``
| left source Y coordinate
int | $sw | ``
| width
int | $sh | ``
| height
int | $dx | ``
| left destination X coordinate
int | $dy | ``
| left destination Y coordinate
int | $dw | ``
| width
int | $dh | ``
| height
bool | $dither | ``
bool | $blend | ``
bool | $alias | ``
Returns | void
#### blur
public void blur( int $r )
| Blur an image with a given blur radius
Parameter
int | $r | ``
| radius
Returns | void
#### create_clone
public object ImlibImage create_clone( )
| Create a clone of the current instance, return a new ImlibImage
Returns | object ImlibImage
#### create_cropped
public object ImlibImage create_cropped( int $sx, int $sy, int $sw, int $sh )
| Create a cropped ImlibImage from a region of the current instance, return a new ImlibImage
Parameter
int | $sx | ``
| left X coordinate to crop from
int | $sy | ``
| left Y coordinate to crop from
int | $sw | ``
| to crop
int | $sh | ``
| to crop
Returns | object ImlibImage
#### create_cropped_scaled
public object ImlibImage create_cropped_scaled( int $sx, int $sy, int $sw, int $sh, int $dw, int $dh )
| Create a cropped, scaled ImlibImage from a region of the current instance, return a new ImlibImage
Parameter
int | $sx | ``
| left X coordinate to crop from
int | $sy | ``
| left Y coordinate to crop from
int | $sw | ``
| to crop
int | $sh | ``
| to crop
int | $dw | ``
| to scale the cropped region to
int | $dh | ``
| to scale the cropped region to
Returns | object ImlibImage
#### create
public int create( int $width, int $height )
| Create an image resource to use with this instance
Parameter
int | $width | ``
| of the image
int | $height | ``
| of the image
Returns | int Resource id# that was created
See Also | get_id(), $id
#### create_rotated
public object ImlibImage create_rotated( float $degrees, [ float $radians ] )
| Create a rotated ImlibImage, return a new ImlibImage If radians is specified, degrees will be ignored.
Parameter
float | $degrees | ``
| to rotate the image
float | $radians | `= >>0<<`
| to rotate the image
Returns | object ImlibImage
#### create_scaled
public object ImlibImage create_scaled( integer $width, [ integer $height ] )
| Create a scaled ImlibImage, return a new ImlibImage If $height is not specified, it will be calculated from the dimensionsof the current image, so that the aspect ratio is preserved.
Parameter
integer | $width | ``
| to scale the new image to
integer | $height | `= >>0<<`
| to scale the new image to (Optional)
Returns | object ImlibImage
#### dump
public void dump( [ integer $quality ] )
| Output the raw image data of the current instance to stdout
Parameter
integer | $quality | `= >>75<<`
| or compression level to use
Returns | void
#### flip_diagonal
public void flip_diagonal( )
| Flip the current image diagonally
Returns | void
#### flip_horizontal
public void flip_horizontal( )
| Flip the current image horizontally
Returns | void
#### flip_vertical
public void flip_vertical( )
| Flip the current image vertically
Returns | void
#### free
public void free( )
| Free the current instance and image resource
Returns | void
#### get_filename
public mixed get_filename( )
| Get the current filename, if it's set
Returns | mixed Filename string or false.
#### get_format
public string get_format( )
| Get the current image format. The default is png.
Returns | string Image format
#### get_height
public integer get_height( )
| Get the current image's height
Returns | integer Image height
#### get_id
public integer get_id( )
| Get the current image's resource id#
Returns | integer Current resource id#
See Also | $id, create()
#### get_width
public integer get_width( )
| Get the current image's width
Returns | integer Image width
#### has_alpha
public boolean has_alpha( )
| Check if the image has an alpha channel
Returns | boolean
#### modify_alpha
public void modify_alpha( int $alpha )
| Set the alpha channel of an image
Parameter
int | $alpha | ``
| alpha level to set for the image
Returns | void
#### load
public integer load( string $infile, [ integer $err ] )
| Load an image file into the current instance
Parameter
string | $infile | ``
integer | $err | `= >>0<<`
| error number. 0 for no error.
Returns | integer Resource id# or false if load failed
#### save
public bool save( string $outfile, [ integer $quality ] )
| Save the current instance to a file
Parameter
string | $outfile | ``
integer | $quality | `= >>75<<`
| or compression level to use
Returns | bool False if the save failed
#### set_format
public void set_format( string $format )
| Set the image format for the current instance
Parameter
string | $format | ``
| format
Returns | void
#### sharpen
public void sharpen( int $r )
| Sharpen an image with a given sharpen radius
Parameter
int | $r | ``
| radius
Returns | void
#### tile
public void tile( )
| Seamlessly tile the current image both horizontally and vertically
Returns | void
#### tile_horizontal
public void tile_horizontal( )
| Seamlessly tile the current image horizontally
Returns | void
#### tile_vertical
public void tile_vertical( )
| Seamlessly tile the current image vertically
Returns | void
## Private Method Details
#### _get_cb
private mixed _get_cb( string $cb )
| Callback for functions which query the current instance's attributes
Parameter
string | $cb | ``
| name of the function to call
Returns | mixed String or int
#### _no_param_cb
private void _no_param_cb( string $cb )
| Callback for functions which flip or tile the current instance
Parameter
string | $cb | ``
| name of the function to call
Returns | void
## Private Field Details
#### $id
private integer $id >>``<< The image resource id#
See Also | create(), get_id()
Packageindex | Classtrees | Modulegroups | Elementlist | Report | XML Files
PHPDoc 1.0beta