Video Media Header Box contains general presentation information, * independent of the coding, for video media. * * @category Zend * @package Zend_Media * @subpackage ISO 14496 * @author Sven Vollbehr * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com) * @license http://framework.zend.com/license/new-bsd New BSD License * @version $Id$ */ final class Zend_Media_Iso14496_Box_Vmhd extends Zend_Media_Iso14496_FullBox { /** @var integer */ private $_graphicsMode = 0; /** @var Array */ private $_opcolor = array(0, 0, 0); /** * Constructs the class with given parameters and reads box related data * from the ISO Base Media file. * * @param Zend_Io_Reader $reader The reader object. * @param Array $options The options array. */ public function __construct($reader = null, &$options = array()) { parent::__construct($reader, $options); if ($reader === null) { $this->setFlags(1); return; } $this->_graphicsMode = $this->_reader->readUInt16BE(); $this->_opcolor = array ($this->_reader->readUInt16BE(), $this->_reader->readUInt16BE(), $this->_reader->readUInt16BE()); } /** * Returns the composition mode for this video track, from the following * enumerated set, which may be extended by derived specifications: * * * * @return integer */ public function getGraphicsMode() { return $this->_graphicsMode; } /** * Sets the composition mode for this video track. * * @param integer $graphicsMode The composition mode. */ public function setGraphicsMode($graphicsMode) { $this->_graphicsMode = $graphicsMode; } /** * Returns an array of 3 colour values (red, green, blue) available for use * by graphics modes. * * @return Array */ public function getOpcolor() { return $this->_opcolor; } /** * Sets the array of 3 colour values (red, green, blue) available for use * by graphics modes. * * @param Array $opcolor An array of 3 colour values */ public function setOpcolor($opcolor) { $this->_opcolor = $opcolor; } /** * Returns the box heap size in bytes. * * @return integer */ public function getHeapSize() { return parent::getHeapSize() + 8; } /** * Writes the box data. * * @param Zend_Io_Writer $writer The writer object. * @return void */ protected function _writeData($writer) { parent::_writeData($writer); $writer->writeUInt16BE($this->_graphicsMode) ->writeUInt16BE($this->_opcolor[0]) ->writeUInt16BE($this->_opcolor[1]) ->writeUInt16BE($this->_opcolor[2]); } }