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

Class: Image_3D_Color

Source Location: /Image_3D-0.4.2/Image/3D/Color.php

Class Overview


Image_3D_Color


Author(s):

Version:

  • Release: @package_version@

Copyright:

  • 1997-2005 Kore Nordmann

Variables

Methods


Child classes:

Image_3D_Color_Metal
Image_3D_Color_Metal

Inherited Variables

Inherited Methods


Class Details

[line 51]
Image_3D_Color

Base class for colors and textures.



[ Top ]


Class Variables

$_light =

[line 75]

Resulting light for this color
  • Access: protected

Type:   array


[ Top ]

$_lights =

[line 68]

Array with lights which influence this color
  • Access: protected

Type:   array


[ Top ]

$_reflection =

[line 82]

Optinal value for reflection
  • Access: protected

Type:   float


[ Top ]

$_rgbaValue =

[line 61]

Color values
  • Access: protected

Type:   array


[ Top ]



Method Detail

__construct (Constructor)   [line 99]

Image_3D_Color __construct( [mixed $red = 0.], [mixed $green = 0.], [mixed $blue = 0.], [mixed $alpha = 0.], [ $reflection = null])

Constructor for Image_3D_Color

All colors accept values in integer (0 - 255) or float (0 - 1)

  • Return: Instance of Color
  • Access: public

Parameters:

mixed   $red     red
mixed   $green     green
mixed   $blue     blue
mixed   $alpha     alpha
   $reflection     

[ Top ]

addLight   [line 210]

void addLight( Image_3D_Color $color, [mixed $intensity = .5])

Add light

Add an light which influence the object this color is created for

  • Access: public

Parameters:

Image_3D_Color   $color     Lightcolor
mixed   $intensity     Intensity

[ Top ]

calculateColor   [line 265]

void calculateColor( )

Calculate new color

Calculate color depending on the lights

  • Access: public

[ Top ]

getReflection   [line 169]

float getReflection( )

return reflection intensity
  • Return: reflection
  • Access: public

[ Top ]

getValues   [line 192]

array getValues( )

return RGBA values

Return an array with rgba-values

  1. => (float) red
  2. => (float) green
  3. => (float) blue
  4. => (float) alpha

  • Return: RGBA-Values
  • Access: public

[ Top ]

merge   [line 286]

void merge( $colors)

Merge with other colors

Merge color with other colors

  • Access: public

Parameters:

   $colors     

[ Top ]

mixAlpha   [line 137]

void mixAlpha( [mixed $alpha = 1.])

Apply alphavalue to color

Apply alpha value to color. It may be int or float. 255 / 1. means full oppacity

  • Access: public

Parameters:

mixed   $alpha     Alphavalue

[ Top ]

setReflection   [line 156]

void setReflection( float $reflection)

sets reflection intensity
  • Access: public

Parameters:

float   $reflection     reflection

[ Top ]

_calcLights   [line 225]

void _calcLights( )

Calculate lights

Calculate light depending an all lights which influence this object

  • Access: protected

[ Top ]

_mixColor   [line 248]

void _mixColor( )

Mix Color with light

Recalculate color depending on the lights

  • Access: protected

Overridden in child classes as:

Image_3D_Color_Metal::_mixColor()

[ Top ]

__toString   [line 322]

string __toString( )

Return Color as string

Return a string representation of the color

  • Return: String representation of color
  • Access: public

[ Top ]


Documentation generated on Sun, 08 Apr 2012 13:30:09 +0000 by phpDocumentor 1.4.3. PEAR Logo Copyright © PHP Group 2004.