Class Fox::FXImage |
|
Image class
IMAGE_KEEP: | Keep pixel data in client |
IMAGE_OWNED: | Pixel data is owned by image |
IMAGE_DITHER: | Dither image to look better |
IMAGE_NEAREST: | Turn off dithering and map to nearest color |
IMAGE_ALPHA: | Data has alpha channel |
IMAGE_OPAQUE: | Force opaque background |
IMAGE_ALPHACOLOR: | Override transparancy color |
IMAGE_SHMI: | Using shared memory image |
IMAGE_SHMP: | Using shared memory pixmap |
IMAGE_ALPHAGUESS: | Guess transparency color from corners |
Methods |
Attributes |
channels | [R] | Number of channels (3 for RGB, 4 for RGBA) [Integer] |
data | [R] | Pixel data [String] |
options | [RW] | Option flags [Integer] |
Public Class methods |
new(app, pixels=nil, options=0, width=1, height=1) {|theImage| ...} |
Create an image
Public Instance methods |
getPixel(x, y) |
Get pixel at (x, y)
setPixel(x, y, color) |
Set pixel at (x, y) to color.
restore() |
Restore client-side pixel buffer from image
render() |
Render the image from client-side pixel buffer
scale(width, height) |
Rescale pixels image to the specified width and height.
mirror(horizontal, vertical) |
Mirror image horizontally and/or vertically
rotate(degrees) |
Rotate image by degrees (counter-clockwise)
crop(x, y, width, height) |
Crop image to given rectangle
savePixels(stream) |
Save pixel data to a stream
loadPixels(stream) |
Load pixel data from a stream