API - XOOPS 2.5.11 Beta 2
By monxoops.fr
TrueColorImage Class Reference
Inheritance diagram for TrueColorImage:
Collaboration diagram for TrueColorImage:

Public Member Functions

 __construct ($handle)
 
 doCreate ($width, $height)
 
 isTrueColor ()
 
 alphaBlending ($mode)
 
 saveAlpha ($on)
 
 allocateColorAlpha ($R, $G=null, $B=null, $A=null)
 
 asPalette ($nColors=255, $dither=null, $matchPalette=true)
 
 getClosestColorAlpha ($R, $G=null, $B=null, $A=null)
 
 getExactColorAlpha ($R, $G=null, $B=null, $A=null)
 
 getChannels ()
 
 copyNoAlpha ()
 
 asTrueColor ()
 
 asProgressive ()
 
 resizeInsideRect ($width, $height, $fit='inside', $scale='down', $alignLeft='center', $alignTop='center', $mergeOpacity=100, $fillColor=null)
 
- Public Member Functions inherited from Image
 __construct ($handle)
 
 __destruct ()
 
 destroy ()
 
 getHandle ()
 
 isValid ()
 
 releaseHandle ()
 
 saveToFile ($uri)
 
 asString ($format)
 
 output ($format)
 
 getWidth ()
 
 getHeight ()
 
 allocateColor ($R, $G=null, $B=null)
 
 isTransparent ()
 
 getTransparentColor ()
 
 setTransparentColor ($color)
 
 getTransparentColorRGB ()
 
 getRGBAt ($x, $y)
 
 setRGBAt ($x, $y, $color)
 
 getColorRGB ($colorIndex)
 
 getColorAt ($x, $y)
 
 setColorAt ($x, $y, $color)
 
 getClosestColor ($R, $G=null, $B=null)
 
 getExactColor ($R, $G=null, $B=null)
 
 copyTransparencyFrom ($sourceImage, $fill=true)
 
 fill ($x, $y, $color)
 
 getMask ()
 
 resize ($width=null, $height=null, $fit='inside', $scale='any')
 
 resizeDown ($width=null, $height=null, $fit='inside')
 
 resizeUp ($width=null, $height=null, $fit='inside')
 
 rotate ($angle, $bgColor=null, $ignoreTransparent=true)
 
 merge ($overlay, $left=0, $top=0, $pct=100)
 
 resizeCanvas ($width, $height, $pos_x, $pos_y, $bg_color=null, $scale='any', $merge=false)
 
 roundCorners ($radius, $color=null, $smoothness=2, $corners=255)
 
 applyMask ($mask, $left=0, $top=0)
 
 applyFilter ($filter, $arg1=null, $arg2=null, $arg3=null, $arg4=null)
 
 applyConvolution ($matrix, $div, $offset)
 
 crop ($left=0, $top=0, $width='100%', $height='100%')
 
 autoCrop ($margin=0, $rgb_threshold=0, $pixel_cutoff=1, $base_color=null)
 
 asNegative ()
 
 asGrayscale ()
 
 mirror ()
 
 unsharp ($amount, $radius, $threshold)
 
 flip ()
 
 correctGamma ($inputGamma, $outputGamma)
 
 addNoise ($amount, $type)
 
 __call ($name, $args)
 
 __toString ()
 
 copy ()
 
 copyTo ($dest, $left=0, $top=0)
 
 getCanvas ()
 
 isTrueColor ()
 
 asTrueColor ()
 
 asPalette ($nColors=255, $dither=null, $matchPalette=true)
 
 getChannels ()
 
 copyNoAlpha ()
 
 __sleep ()
 
 __wakeup ()
 

Static Public Member Functions

static create ($width, $height)
 

Additional Inherited Members

- Protected Member Functions inherited from Image
 writeHeader ($name, $data)
 
 getOperation ($name)
 
- Protected Attributes inherited from Image
 $handle = null
 
 $handleReleased = false
 
 $canvas = null
 
 $sdata = null
 

Constructor & Destructor Documentation

◆ __construct()

__construct (   $handle)

Creates the object

Parameters
resource$handle

Reimplemented from Image.

Member Function Documentation

◆ allocateColorAlpha()

allocateColorAlpha (   $R,
  $G = null,
  $B = null,
  $A = null 
)

Allocates a color and returns its index

This method accepts either each component as an integer value, or an associative array that holds the color's components in keys 'red', 'green', 'blue', 'alpha'.

Parameters
mixed$R
int$G
int$B
int$A
Returns
int

◆ alphaBlending()

alphaBlending (   $mode)

Sets alpha blending mode via imagealphablending()

Parameters
bool$mode
Returns
bool

◆ asPalette()

asPalette (   $nColors = 255,
  $dither = null,
  $matchPalette = true 
)
See also
\WideImage\ImageasPalette($nColors, $dither, $matchPalette)

Reimplemented from Image.

◆ asProgressive()

asProgressive ( )

Calls imageinterlace() using the current handler

See also
\WideImage\ImageasTrueColor()
Returns
TrueColorImage A copy of the image, with imageinterlace() applied

◆ asTrueColor()

asTrueColor ( )

(non-PHPdoc)

See also
\WideImage\ImageasTrueColor()
Returns
TrueColorImage

Reimplemented from Image.

◆ copyNoAlpha()

copyNoAlpha ( )

(non-PHPdoc)

See also
\WideImage\ImagecopyNoAlpha()

Reimplemented from Image.

◆ create()

static create (   $width,
  $height 
)
static

Factory method that creates a true-color image object

Parameters
int$width
int$height
Returns
\WideImage\TrueColorImage
Here is the caller graph for this function:

◆ doCreate()

doCreate (   $width,
  $height 
)

◆ getChannels()

getChannels ( )
See also
\WideImage\ImagegetChannels()

Reimplemented from Image.

◆ getClosestColorAlpha()

getClosestColorAlpha (   $R,
  $G = null,
  $B = null,
  $A = null 
)

Returns the index of the color that best match the given color components

This method accepts either each component as an integer value, or an associative array that holds the color's components in keys 'red', 'green', 'blue', 'alpha'.

Parameters
mixed$RRed component value or an associative array
int$GGreen component
int$BBlue component
int$AAlpha component
Returns
int The color index

◆ getExactColorAlpha()

getExactColorAlpha (   $R,
  $G = null,
  $B = null,
  $A = null 
)

Returns the index of the color that exactly match the given color components

This method accepts either each component as an integer value, or an associative array that holds the color's components in keys 'red', 'green', 'blue', 'alpha'.

Parameters
mixed$RRed component value or an associative array
int$GGreen component
int$BBlue component
int$AAlpha component
Returns
int The color index

◆ isTrueColor()

isTrueColor ( )

Returns true if the image is true-color, false otherwise

Returns
bool

Reimplemented from Image.

◆ resizeInsideRect()

resizeInsideRect (   $width,
  $height,
  $fit = 'inside',
  $scale = 'down',
  $alignLeft = 'center',
  $alignTop = 'center',
  $mergeOpacity = 100,
  $fillColor = null 
)

Resizes the image proportionally inside the given width and height. The returned image will have always the specified width and height, and any space will be filled with the given $fillCollor

Parameters
int$widthExact width in pixels
int$heightExact height in pixels
string$fit'inside' (default), 'outside' or 'fill'
string$scale'down' (default), 'up' or 'any'
mixed$alignLeftLeft position of the image over the fill space, smart coordinate
mixed$alignTopTop position of the image over the fill space, smart coordinate
int$mergeOpacityThe opacity of the image over the fill space
int | array$fillColorRGB color index or array. Background color to fill the resulting image with if it's smaller than the given size. By default (if null), the top left pixel color will be used.
Returns
TrueColorImage A new, resized image

◆ saveAlpha()

saveAlpha (   $on)

Toggle if alpha channel should be saved with the image via imagesavealpha()

Parameters
bool$on
Returns
bool

The documentation for this class was generated from the following file: