phpDocumentor Gd
Classes
[ class tree: Gd ] [ index: Gd ] [ all elements ]

Class: GdFunctionality

Source Location: /modules/gd/classes/GdFunctionality.class

Class GdFunctionality

Method Summary
array   checkResource()   Check if a resource that is based on $filename is valid
boolean   chmod()   Set file permissions according to preferences
string   copy()   The copy method from GalleryPlatform, which we need to be able to overwrite in tests
int   filesize()   The filesize method from GalleryPlatform, which we need to be able to overwrite in tests
boolean   functionExists()   Just check if a function exists or not.
array   gd_info()   Return an array of information about the currently installed GD version
array   getImageSize()   Return the size (width, height) of an image file.
bool   imagealphablending()   Set the blending mode for an image
int   imagecolorallocate()   Allocate a color for an image.
array   imagecolorallocatealpha()   Allocate a color for an image.
int   imagecolorat()   Get the index of the color of a pixel.
array('red'   imagecolorsforindex()   Get the colors for an index.
The   imagecolortransparent()   Get / set the transparent color.
GalleryStatus   imageCopy()   Copy part of an image
GalleryStatus   imageCopyMerge()   Copy and merge part of an image
GalleryStatus   imageCopyResampled()   Copy and resize part of an image with resampling
GalleryStatus   imageCopyResized()   Copy and resize part of an image
array   imageCreate()   Create a new palette based image with specified width and height
array   imageCreateFromGif()   Create a new image from GIF file or URL.
array   imageCreateFromJpeg()   Create a new image from JPEG file or URL.
array   imageCreateFromPng()   Create a new image from PNG file or URL.
array   imageCreateFromWbmp()   Create a new image from WBMP (wap-bmp) file or URL.
array   imageCreateFromXbm()   Create a new image from XBM file or URL.
array   imageCreateFromXpm()   Create a new image from XPM file or URL.
array   imageCreateTruecolor()   Create a new true color image with specified width and height
void   imagedestroy()   Destroy an image
bool   imagefilledrectangle()   Draw a filled rectangle spanned by 2 points.
GalleryStatus   imageGif()   Output GIF image to file.
GalleryStatus   imageJpeg()   Output JPEG image to file.
GalleryStatus   imagePng()   Output PNG image to file.
array   imageRotate()   Copy and merge part of an image
array   imagesavealpha()   Set the flag to save full alpha channel information (as opposed to single-color transparency) when saving PNG images
bool   imagesetpixel()   set the color of a pixel.
int   imageSx()   Get image width
int   imageSy()   Get image height
true   imagetruecolortopalette()   Convert a true color image to a palette image.
int   imageTypes()   Return an integer representing the known imageTypes
GalleryStatus   imageWbmp()   Output WBMP image to file.
GalleryStatus   imageXbm()   Output XBM image to file.
boolean   isValidFile()   Helper functionality to see if a filename is readable
array   phpinfo()  
string   tempnam()   The tempnam method from the GalleryPlatform we will need to overwrite in our testcases
string   unlink()   The unlink method from GalleryPlatform, which we need to be able to overwrite in tests

[ Top ]
Methods
checkResource  [line 220]

  array checkResource( $res, $filename  )

Check if a resource that is based on $filename is valid

Parameters:
   $res: 
   $filename: 

API Tags:
Return:  GalleryStatus resource GD resource


[ Top ]
chmod  [line 101]

  boolean chmod( string $file  )

Set file permissions according to preferences

Parameters:
string   $file:  file path

API Tags:
Return:  true on success


[ Top ]
copy  [line 70]

  string copy( $src, $dest  )

The copy method from GalleryPlatform, which we need to be able to overwrite in tests

Parameters:
   $src: 
   $dest: 


[ Top ]
filesize  [line 90]

  int filesize( $file  )

The filesize method from GalleryPlatform, which we need to be able to overwrite in tests

Parameters:
   $file: 


[ Top ]
functionExists  [line 113]

  boolean functionExists( $fct  )

Just check if a function exists or not.

This is here so we can substitute the function-checker routine in our phpunit testcases.

Parameters:
   $fct: 

API Tags:
Return:  true if exists


[ Top ]
gd_info  [line 134]

  array gd_info( )

Return an array of information about the currently installed GD version

Requires:

  • PHP 4 >= 4.3.0, PHP 5


API Tags:
Return:  GalleryStatus array the output of gd_info


[ Top ]
getImageSize  [line 146]

  array getImageSize( $filename  )

Return the size (width, height) of an image file.

Parameters:
   $filename: 

API Tags:
Return:  (x, y)


[ Top ]
imagealphablending  [line 586]

  bool imagealphablending( resource $res, bool $blendmode  )

Set the blending mode for an image

Parameters:
resource   $res: 
bool   $blendmode: 

API Tags:
Return:  true on success, false on failure


[ Top ]
imagecolorallocate  [line 621]

  int imagecolorallocate( resource $res, int $red, int $green, int $blue  )

Allocate a color for an image.

Parameters:
resource   $res: 
int   $red: 
int   $green: 
int   $blue: 

API Tags:
Return:  a color identifier, false on failure


[ Top ]
imagecolorallocatealpha  [line 604]

  array imagecolorallocatealpha( resource $res, int $red, int $green, int $blue, int $alpha  )

Allocate a color for an image.

Requires:

  • PHP 4 >= 4.3.2 or PHP 5

Parameters:
resource   $res: 
int   $red: 
int   $green: 
int   $blue: 
int   $alpha: 

API Tags:
Return:  GalleryStatus int a color identifier, false on failure


[ Top ]
imagecolorat  [line 672]

  int imagecolorat( resource $res, int $x, int $y  )

Get the index of the color of a pixel.

Parameters:
resource   $res: 
int   $x: 
int   $y: 

API Tags:
Return:  The index of the color


[ Top ]
imagecolorsforindex  [line 694]

  array('red' imagecolorsforindex( resource $res, int $index  )

Get the colors for an index.

Parameters:
resource   $res: 
int   $index: 

API Tags:
Return:  => int, 'green' => int, 'blue' => int, 'alpha' => int)


[ Top ]
imagecolortransparent  [line 646]

  The imagecolortransparent( resource $res, [int $color = null]  )

Get / set the transparent color.

Parameters:
resource   $res: 
int   $color:  (optional) A color identifier

API Tags:
Return:  identifier of the new (or current, if none is specified) transparent color.


[ Top ]
imageCopy  [line 502]

  GalleryStatus imageCopy( $dstRes, $srcRes, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH  )

Copy part of an image

Requires:

  • any PHP >= 3.0.6

Parameters:
   $dstRes: 
   $srcRes: 
   $dstX: 
   $dstY: 
   $srcX: 
   $srcY: 
   $srcW: 
   $srcH: 


[ Top ]
imageCopyMerge  [line 485]

  GalleryStatus imageCopyMerge( $dstRes, $srcRes, $dstX, $dstY, $srcX, $srcY, $srcW, $srcH, $pct  )

Copy and merge part of an image

Requires:

  • PHP 4 >= 4.0.1 or PHP 5

Parameters:
   $dstRes: 
   $srcRes: 
   $dstX: 
   $dstY: 
   $srcX: 
   $srcY: 
   $srcW: 
   $srcH: 
   $pct: 


[ Top ]
imageCopyResampled  [line 444]

  GalleryStatus imageCopyResampled( $dstRes, $srcRes, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH  )

Copy and resize part of an image with resampling

Requires:

  • PHP 4 >= 4.0.6 or PHP 5
  • GD >= 2.0.1

Parameters:
   $dstRes: 
   $srcRes: 
   $dstX: 
   $dstY: 
   $srcX: 
   $srcY: 
   $dstW: 
   $dstH: 
   $srcW: 
   $srcH: 


[ Top ]
imageCopyResized  [line 466]

  GalleryStatus imageCopyResized( $dstRes, $srcRes, $dstX, $dstY, $srcX, $srcY, $dstW, $dstH, $srcW, $srcH  )

Copy and resize part of an image

Requires:

  • any PHP

Parameters:
   $dstRes: 
   $srcRes: 
   $dstX: 
   $dstY: 
   $srcX: 
   $srcY: 
   $dstW: 
   $dstH: 
   $srcW: 
   $srcH: 


[ Top ]
imageCreate  [line 161]

  array imageCreate( $width, $height  )

Create a new palette based image with specified width and height

Requires:

  • any PHP

Parameters:
   $width: 
   $height: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromGif  [line 242]

  array imageCreateFromGif( $filename  )

Create a new image from GIF file or URL.

Requires

  • any PHP version
  • GD with GIF support

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromJpeg  [line 266]

  array imageCreateFromJpeg( $filename  )

Create a new image from JPEG file or URL.

Requires:

  • any PHP >= 3.0.16
  • GD >= 1.8 (for JPEG support)

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromPng  [line 281]

  array imageCreateFromPng( $filename  )

Create a new image from PNG file or URL.

Requires:

  • any PHP >= 3.0.13
  • GD (with PNG support)

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromWbmp  [line 296]

  array imageCreateFromWbmp( $filename  )

Create a new image from WBMP (wap-bmp) file or URL.

Requires:

  • PHP 4 >= 4.0.1 or PHP 5
  • GD >= 1.8 (for WBMP support)

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromXbm  [line 311]

  array imageCreateFromXbm( $filename  )

Create a new image from XBM file or URL.

Requires:

  • PHP 4 >= 4.0.1 or PHP 5
  • GD

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateFromXpm  [line 326]

  array imageCreateFromXpm( $filename  )

Create a new image from XPM file or URL.

Requires:

  • PHP 4 >= 4.0.1 or PHP 5
  • GD

Parameters:
   $filename: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imageCreateTruecolor  [line 187]

  array imageCreateTruecolor( $width, $height  )

Create a new true color image with specified width and height

Requires:

  • PHP 4 >= 4.0.6 or PHP 5
  • GD >= 2.0.1
Danger: The imageCreateTruecolor() function is defined even if the GD library does not support it! If called in this situation, the call will generate a "Fatal error", which cannot be catched. So we have to make sure to call this method ONLY if we are sure to have GD >= 2.0.1 (which at the current stage of this module will always be the case, since this is the minimal required version).

Parameters:
   $width: 
   $height: 

API Tags:
Return:  GalleryStatus res GD-resource


[ Top ]
imagedestroy  [line 555]

  void imagedestroy( object $res  )

Destroy an image

Parameters:
object   $res:  image resource


[ Top ]
imagefilledrectangle  [line 635]

  bool imagefilledrectangle( resource $res, int $x1, int $y1, int $x2, int $y2, $color  )

Draw a filled rectangle spanned by 2 points.

Parameters:
resource   $res: 
int   $x1:  x coordinate of point 1
int   $y1:  y coordinate of point 1
int   $x2:  x coordinate of point 2
int   $y2:  y coordinate of point 2
   $color: 

API Tags:
Return:  true on success, false on failure


[ Top ]
imageGif  [line 340]

  GalleryStatus imageGif( $res, $filename  )

Output GIF image to file.

Requires:

  • any PHP
  • GD with GIF support

Parameters:
   $res: 
   $filename: 


[ Top ]
imageJpeg  [line 361]

  GalleryStatus imageJpeg( $res, $filename, $quality  )

Output JPEG image to file.

Requires:

  • any PHP >= 3.0.16
  • GD >= 1.8

Parameters:
   $res: 
   $filename: 
   $quality: 


[ Top ]
imagePng  [line 382]

  GalleryStatus imagePng( $res, $filename  )

Output PNG image to file.

Requires:

  • any PHP 3>= 3.0.13
  • GD

Parameters:
   $res: 
   $filename: 


[ Top ]
imageRotate  [line 538]

  array imageRotate( $srcRes, $angle, $bgdColor  )

Copy and merge part of an image

Requires:

  • PHP 4 >= 4.3.0 or PHP 5

Parameters:
   $srcRes: 
   $angle: 
   $bgdColor: 

API Tags:
Return:  GalleryStatus resource new gd resource


[ Top ]
imagesavealpha  [line 571]

  array imagesavealpha( resource $res, $saveflag, bool $saveFlag  )

Set the flag to save full alpha channel information (as opposed to single-color transparency) when saving PNG images

Requires:

  • PHP 4 >= 4.3.2 or PHP 5

Parameters:
resource   $res: 
bool   $saveFlag: 
   $saveflag: 

API Tags:
Return:  GalleryStatus bool true on success, false on failure


[ Top ]
imagesetpixel  [line 684]

  bool imagesetpixel( resource $res, int $x, int $y, int $color  )

set the color of a pixel.

Parameters:
resource   $res: 
int   $x: 
int   $y: 
int   $color:  A color identifier

API Tags:
Return:  true on success, false on failure


[ Top ]
imageSx  [line 516]

  int imageSx( $res  )

Get image width

Parameters:
   $res: 

API Tags:
Return:  the width of the image


[ Top ]
imageSy  [line 525]

  int imageSy( $res  )

Get image height

Parameters:
   $res: 

API Tags:
Return:  the height of the image


[ Top ]
imagetruecolortopalette  [line 661]

  true imagetruecolortopalette( resource $res, bool $dither, int $ncolors  )

Convert a true color image to a palette image.

Parameters:
resource   $res: 
bool   $dither: 
int   $ncolors: 

API Tags:
Return:  on success, false on failure


[ Top ]
imageTypes  [line 121]

  int imageTypes( )

Return an integer representing the known imageTypes



[ Top ]
imageWbmp  [line 403]

  GalleryStatus imageWbmp( $res, $filename  )

Output WBMP image to file.

Requires:

  • PHP 3>= 3.0.15 or PHP 4 >= 4.0.1 or PHP 5
  • GD >= 1.8 (for WBMP support)

Parameters:
   $res: 
   $filename: 


[ Top ]
imageXbm  [line 423]

  GalleryStatus imageXbm( $res, $filename  )

Output XBM image to file.

Requires:

  • PHP 5

Parameters:
   $res: 
   $filename: 


[ Top ]
isValidFile  [line 203]

  boolean isValidFile( $filename  )

Helper functionality to see if a filename is readable

Parameters:
   $filename: 


[ Top ]
phpinfo  [line 48]

  array phpinfo( [ $section = null]  )

Parameters:
   $section: 

API Tags:
Return:  GalleryStatus string phpinfo output


[ Top ]
tempnam  [line 60]

  string tempnam( $tmpDir, $prefix  )

The tempnam method from the GalleryPlatform we will need to overwrite in our testcases

Parameters:
   $tmpDir: 
   $prefix: 


[ Top ]
unlink  [line 80]

  string unlink( $file  )

The unlink method from GalleryPlatform, which we need to be able to overwrite in tests

Parameters:
   $file: 


[ Top ]

Documentation generated on Fri, 03 Oct 2008 05:15:38 -0700 by phpDocumentor 1.3.0RC6