/** * Adds an element to the objects element list, the new Image_Graph_elements parent is automatically set * @param Image_Graph_Common $element The new Image_Graph_element * @return Image_Graph_Common The new Image_Graph_element */ function &add(& $element) { $this->_debug("Adding element \"".$element->_identification()); $this->_elements[] = &$element; $element->_setParent($this); return $element; }
/** * Sets the parent. The parent chain should ultimately be a GraPHP object * @see Image_Graph_Common * @param Image_Graph_Common Parent The parent * @access private */ function _setParent(& $parent) { parent::_setParent($parent); if ((!$this->_alpha) or (!$GLOBALS['_Image_Graph_gd2'])) { $this->_index = ImageColorAllocate($this->_canvas(), $this->_red, $this->_green, $this->_blue); } else { $this->_index = ImageColorResolveAlpha($this->_canvas(), $this->_red, $this->_green, $this->_blue, $this->_alpha); } }