Image_Tools
[ class tree: Image_Tools ] [ index: Image_Tools ] [ all elements ]

Class: Image_Tools_Swap

Source Location: /Image_Tools-1.0.0RC1/Image/Tools/Swap.php

Class Overview

Image_Tools
   |
   --Image_Tools_Swap

This class provide swap tool for manipulating an image.


Author(s):

Version:

  • Release: 1.0.0RC1

Copyright:

  • Copyright (c) 2005-2008 Firman Wandayandi <firman@php.net>

Variables

Methods


Inherited Variables

Inherited Methods

Class: Image_Tools

Image_Tools::Image_Tools()
Constructor
Image_Tools::availableMethods()
Get available methods
Image_Tools::availableOptions()
Get all available options of the subclass
Image_Tools::createImage()
Create a GD image resource from given input.
Image_Tools::createImageFromFile()
Create a GD image resource from file (JPEG, PNG, WBMP and XBM support).
Image_Tools::createImageFromString()
Create a GD image resource from a string data.
Image_Tools::display()
Display rendered image (send it to browser).
Image_Tools::factory()
Create a new instance of an image tool
Image_Tools::get()
Get the value of the option
Image_Tools::getAPIVersion()
Get the API version of the common base
Image_Tools::getResultImage()
Get rendered image.
Image_Tools::getVersion()
Get the subclass version.
Image_Tools::isGDImageResource()
Find the whether a value is the GD image resource or not.
Image_Tools::isValidOption()
Has the option a valid value? Determines, if the value given is valid for the option.
Image_Tools::postRender()
Function which called after render.
Image_Tools::preRender()
Function which called before render.
Image_Tools::render()
Render the result of a tool to the given image
Image_Tools::save()
Save rendered image to a file.
Image_Tools::set()
Set the option(s)
Image_Tools::supportsMethod()
Get the method parameters
Image_Tools::supportsOption()
Find out the whether a subclass supports the option

Class Details

[line 61]
This class provide swap tool for manipulating an image.
  • Author: Firman Wandayandi <firman@php.net>
  • Version: Release: 1.0.0RC1
  • Copyright: Copyright (c) 2005-2008 Firman Wandayandi <firman@php.net>
  • License: BSD License


[ Top ]


Class Variables

$availableMethods = array(
        'swapColor' => array(
            'format' => 'string',
            'rgb'    => 'array'
        ))

[line 99]

Available methods for Image_Tool_Swap (only public methods).
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$availableOptions = array(
        'image'     => 'mixed',
        'format'    => 'string'
    )

[line 88]

Available options for Image_Tools_Swap.
  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$options = array(
        'image'     => null,
        'format'    => 'RBG'
    )

[line 77]

Swap options:

format string Destination color format (mix 'R', 'G', 'B'), only 5 variations (RBG, BGR, BRG, GRB, GBR) </pre>

  • Access: protected

Type:   array
Overrides:   Array


[ Top ]

$version =  '1.0'

[line 112]

Image_Tools_Swap API version.
  • Access: protected

Type:   string
Overrides:   Array


[ Top ]



Method Detail

preRender   [line 124]

bool|PEAR_Error preRender( )

Function which called before render.

Overrides Image_Tools::preRender() (Function which called before render.)
[ Top ]

render   [line 146]

bool|PEAR_Error render( )

Apply swap color to image and output result.

This function swap channel color 'R', 'G', 'B' to set format.

  • Return: TRUE on success or PEAR_Error on failure.
  • Access: protected

Overrides Image_Tools::render() (Render the result of a tool to the given image)
[ Top ]

swapColor   [line 197]

array|PEAR_Error swapColor( string $format, array $rgb)

Swap RGB color channel.

This function swap color channel array to given format, e.g RGB->RBG mean red->red, green->blue and blue->green.

  • Return: Swapped color channel, an array contains keys r, g and b on success or PEAR_Error on failure.
  • Access: public

Parameters:

string   $format   —  Swap format, mix 'R', 'G' and 'B' to other string.
array   $rgb   —  RGB color, an array contains keys
  • red, green and blue, or
  • r, g and b, or
  • 0, 1 and 2

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:22:20 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.