|
c2ephp
|
Class for a single image in a C16File. More...
Inheritance diagram for C16Frame:
Collaboration diagram for C16Frame:Public Member Functions | |
| C16Frame ($reader, $encoding='565') | |
| SetEncoding ($encoding) | |
| Encode () | |
| Encodes the C16Frame into a C16 binary string. | |
| GetGDImage () | |
| Gets the GD Image resource for this sprite frame. Deprecated | |
| GetWidth () | |
| Gets the width of the frame in pixels. | |
| GetHeight () | |
| Gets the height of the frame in pixels. | |
| GetPixel ($x, $y) | |
| Gets the colour of the pixel at the given position. | |
| SetPixel ($x, $y, $r, $g, $b) | |
| Sets the colour of a pixel. | |
| ToSpriteFrame ($type) | |
| Converts this SpriteFrame into one of another type. | |
| ToPNG () | |
| Converts this SpriteFrame into a PNG. | |
Class for a single image in a C16File.
Definition at line 8 of file C16Frame.php.
| C16Frame::C16Frame | ( | $ | reader, |
| $ | encoding = '565' |
||
| ) |
brief Initialise a C16Frame
| $reader | An IReader or GD image resource. |
| $encoding | The encoding of the C16 frame (555 or 565). Defaults to 565 |
Definition at line 28 of file C16Frame.php.
| C16Frame::Encode | ( | ) |
Encodes the C16Frame into a C16 binary string.
Produces a string suitable for use as a PHOT block, for example. This is called automatically by C16File's Compile function.
Definition at line 127 of file C16Frame.php.
| SpriteFrame::GetGDImage | ( | ) | [inherited] |
Gets the GD Image resource for this sprite frame. Deprecated
Definition at line 47 of file SpriteFrame.php.
| SpriteFrame::GetHeight | ( | ) | [inherited] |
Gets the height of the frame in pixels.
Definition at line 57 of file SpriteFrame.php.
| SpriteFrame::GetPixel | ( | $ | x, |
| $ | y | ||
| ) | [inherited] |
Gets the colour of the pixel at the given position.
Returns an array like the following:
Array
(
[red] => 226
[green] => 222
[blue] => 252
[alpha] => 0
) | $x | The x-coordinate of the pixel to get. |
| $y | The y-coordinate of the pixel to get. |
Definition at line 76 of file SpriteFrame.php.
| SpriteFrame::GetWidth | ( | ) | [inherited] |
Gets the width of the frame in pixels.
Definition at line 53 of file SpriteFrame.php.
| C16Frame::SetEncoding | ( | $ | encoding | ) |
Definition at line 57 of file C16Frame.php.
| SpriteFrame::SetPixel | ( | $ | x, |
| $ | y, | ||
| $ | r, | ||
| $ | g, | ||
| $ | b | ||
| ) | [inherited] |
Sets the colour of a pixel.
| $x | The x-coordinate of the pixel to change. |
| $y | The y-coordinate of the pixel to change. |
| $r | The red component of the pixel. 0-255. |
| $g | The green component of the pixel. 0-255. |
| $b | The blue component of the pixel. 0-255. |
Definition at line 91 of file SpriteFrame.php.
| SpriteFrame::ToPNG | ( | ) | [inherited] |
Converts this SpriteFrame into a PNG.
Definition at line 155 of file SpriteFrame.php.
| SpriteFrame::ToSpriteFrame | ( | $ | type | ) | [inherited] |
Converts this SpriteFrame into one of another type.
This is called internally by SpriteFile, and is not really for public use. A way of converting I'd approve of more is to create a SpriteFile of the right type and then call AddFrame.
| $type | The type of SpriteFrame to convert this to. |
Definition at line 134 of file SpriteFrame.php.