[ Index ]
 

Code source de vtiger CRM 5.0.2

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Image/Canvas/ -> Tool.php (sommaire)

Image_Canvas Canvas based creation of images to facilitate different output formats

Author: Jesper Veggerby <pear.nosey@veggerby.dk>
Copyright: Copyright (C) 2003, 2004 Jesper Veggerby Hansen
License: http://www.gnu.org/copyleft/lesser.html LGPL License 2.1
Version: CVS: $Id: Tool.php,v 1.3 2005/08/22 20:52:11 nosey Exp $
Poids: 217 lignes (8 kb)
Inclus ou requis: 2 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 class

Image_Canvas_Tool:: (6 méthodes):
  fontMap()
  mid()
  mirror()
  controlPoint()
  bezier()
  getAngle()


Classe: Image_Canvas_Tool  - X-Ref

This class contains a set of tool-functions.

These functions are all to be called statically

fontMap($name, $type = '.ttf')   X-Ref
Maps a font name to an actual font file (fx. a .ttf file)

Used to translate names (i.e. 'Courier New' to 'cour.ttf' or
'/Windows/Fonts/Cour.ttf')

Font names are translated using the tab-separated file
Image/Canvas/Tool/fontmap.txt.

The translated font-name (or the original if no translation) exists is
then returned if it is an existing file, otherwise the file is searched
first in the path specified by IMAGE_CANVAS_SYSTEM_FONT_PATH defined in
Image/Canvas.php, then in the Image/Canvas/Fonts folder. If a font is
still not found and the name is not beginning with a '/' the search is
left to the library, otherwise the font is deemed non-existing.

param: string $name The name of the font
param: string $type The needed file type of the font
return: string The filename of the font

mid($p1, $p2)   X-Ref
Return the average of 2 points

param: double P1 1st point
param: double P2 2nd point
return: double The average of P1 and P2

mirror($p1, $p2, $factor = 1)   X-Ref
Mirrors P1 in P2 by a amount of Factor

param: double $p1 1st point, point to mirror
param: double $o2 2nd point, mirror point
param: double $factor Mirror factor, 0 returns $p2, 1 returns a pure
return: double $p1 mirrored in $p2 by Factor

controlPoint($p1, $p2, $factor, $smoothFactor = 0.75)   X-Ref
Calculates a Bezier control point, this function must be called for BOTH
X and Y coordinates (will it work for 3D coordinates!?)

param: double $p1 1st point
param: double $p2 Point to
param: double $factor Mirror factor, 0 returns P2, 1 returns a pure
return: double P1 mirrored in P2 by Factor

bezier($t, $p1, $p2, $p3, $p4)   X-Ref
Calculates a Bezier point, this function must be called for BOTH X and Y
coordinates (will it work for 3D coordinates!?)

param: double $t A position between $p2 and $p3, value between 0 and 1
param: double $p1 Point to use for calculating control points
param: double $p2 Point 1 to calculate bezier curve between
param: double $p3 Point 2 to calculate bezier curve between
param: double $p4 Point to use for calculating control points
return: double The bezier value of the point t between $p2 and $p3 using

getAngle($x0, $y0, $x1, $y1)   X-Ref
Gets the angle / slope of a line relative to horizontal (left -> right)

param: double $x0 The starting x point
param: double $y0 The starting y point
param: double $x1 The ending x point
param: double $y1 The ending y point
param: double The angle in degrees of the line



Généré le : Sun Feb 25 10:22:19 2007 par Balluche grâce à PHPXref 0.7