Image object.
More...
#include <object2dimage.h>
|
| enum | { ARGB32 = 0,
RGB24,
A8,
A1
} |
| |
|
| void | setImage (unsigned char *image, int format, int width, int height, int stride) |
| | Set image. More...
|
| |
|
int | format () const |
| |
| void | createImage (int format, int width, int height) |
| | Creates an image of (width x height) More...
|
| |
| unsigned char * | data () |
| | Get the data pointer. More...
|
| |
| int | width () const |
| | Get image width. More...
|
| |
| int | height () const |
| | Get image height. More...
|
| |
| int | stride () const |
| | Get the stride in bytes. More...
|
| |
|
virtual void | draw () |
| |
|
virtual void | setContext (cairo_t *c) |
| |
|
const Trafo2D & | transform () const |
| |
|
void | setTransform (const Trafo2D &T) |
| |
|
cairo_t * | context () |
| |
|
const cairo_t * | context () const |
| |
|
bool | visible () const |
| |
|
void | setVisible (bool t) |
| |
|
void | applyTransform (cairo_t *cr) |
| |
Image object.
- Note
- Set the transform with
setTransform() sensibly, so the dimensions fit in the graph this object is added to.
◆ createImage()
| void goPlot::Object2DImage::createImage |
( |
int |
format, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
Creates an image of (width x height)
- Note
- The allocated data has stride
stride(). It is found with cairo_format_stride_for_width. Keep this in mind when working with the data!
- Parameters
-
| format | Format (see setImage) |
| width | Width |
| height | Height |
◆ data()
| unsigned char * goPlot::Object2DImage::data |
( |
| ) |
|
Get the data pointer.
- Returns
- Data pointer.
◆ height()
| int goPlot::Object2DImage::height |
( |
| ) |
const |
Get image height.
- Returns
- Height in pixels
◆ setImage()
| void goPlot::Object2DImage::setImage |
( |
unsigned char * |
image, |
|
|
int |
format, |
|
|
int |
width, |
|
|
int |
height, |
|
|
int |
stride |
|
) |
| |
Set image.
- Parameters
-
| image | Image data (must match the format) |
| format | Format, one of ARGB32, RGB24, A8, A1 (analog to Cairo) |
| width | Width of the image |
| height | Height of the image |
| stride | Stride (number of bytes in each row) |
◆ stride()
| int goPlot::Object2DImage::stride |
( |
| ) |
const |
Get the stride in bytes.
- Returns
- Stride (number of bytes per row).
◆ width()
| int goPlot::Object2DImage::width |
( |
| ) |
const |
Get image width.
- Returns
- Width in pixels
The documentation for this class was generated from the following files:
- object2dimage.h
- object2dimage.cpp