Class ASCIIArtist

Description

ASCIIArtist class

Located in /ASCIIArtist.php (line 46)


	
			
Method Summary
 array getErrors ()
 string getHTMLErrors ()
 string getHTMLImage ()
 integer getImageHeight ()
 integer getImageWidth ()
 string getVersion ()
 boolean isError ()
 void renderHTMLImage ([integer $mode = 1], [integer $resolution = 2], [string $fixedChar = 'W'], [boolean $flipH = false], [boolean $flipV = false])
 void setErrorCSS (string $css)
 boolean setFile (string $filename)
 void setImageCSS (string $css)
Methods
getErrors (line 397)

Returns the unformatted error messages as an array

array getErrors ()
getHTMLErrors (line 409)

Returns the error messages as HTML

string getHTMLErrors ()
getHTMLImage (line 366)

Returns the rendered ASCII HTML image and CSS

  • return: The rendered HTML image and CSS
  • access: public
string getHTMLImage ()
getImageHeight (line 485)

Returns the height of the original bitmap image in pixels

  • access: public
integer getImageHeight ()
getImageWidth (line 496)

Returns the width of the original bitmap image in pixels

  • access: public
integer getImageWidth ()
getVersion (line 249)

Returns the class version number

  • return: The class version number
  • access: public
string getVersion ()
isError (line 384)

Checks if an error has occured

boolean isError ()
renderHTMLImage (line 297)

Renders the image into HTML

The following modes are implemented:

  1. = black/white using $replaceCharacters by brightness,
  2. = colourized using $replaceCharacters by brightness,
  3. = colourized using a fixed character definded by $fixedChar.
A resolution of 1 means that every pixel is being replaced, whereas 5 for example means a scanned block of 5 pixel height and width, resulting in less data to replace.

void renderHTMLImage ([integer $mode = 1], [integer $resolution = 2], [string $fixedChar = 'W'], [boolean $flipH = false], [boolean $flipV = false])
  • integer $mode: Current version can handle mode 1, 2 or 3
  • integer $resolution: Resolution for scanning the bitmap.
  • string $fixedChar: Needed for mode 3
  • boolean $flipH: Flip output horizontally?
  • boolean $flipV: Flip output vertically?
setErrorCSS (line 273)

Formatting error messages using CSS

  • access: public
void setErrorCSS (string $css)
  • string $css: Stylesheet for error message
setFile (line 447)

Tries to set the given bitmap image as source for the ASCII image and determines width and height

If $filename begins with "http://" (not case sensitive), an HTTP 1.0 connection is opened to the specified server, the page is requested using the HTTP GET method. If filename begins with "ftp://" (not case sensitive), an ftp connection to the specified server is opened. If the server does not support passive mode ftp, this will fail. If filename is one of "php://stdin", "php://stdout", or "php://stderr", the corresponding stdio stream will be opened. If filename begins with anything else, the file will be opened from the filesystem.

  • access: public
boolean setFile (string $filename)
  • string $filename
setImageCSS (line 262)

Formatting the HTML Image using CSS

Tip: Use width-fixed fonts such as Courier only.

  • access: public
void setImageCSS (string $css)
  • string $css: Stylesheet for the image

Documentation generated on Sun, 4 Jan 2004 14:03:04 +0100 by phpDocumentor 1.2.3