Function formatStrideForWidth
This function provides a stride value that will respect all alignment
requirements of the accelerated image-rendering code within cairo.
Examples
int stride;
ubyte[] data;
Surface surface;
stride = formatStrideForWidth(format, width);
data = new ubyte[](stride * height); //could also use malloc
surface = new ImageSurface(data, format, width, height, stride);
Parameters
Name | Description |
format | The desired Format of an image surface to be created |
width | The desired width of an image surface to be created |
Returns
the appropriate stride to use given the desired format
and width
, or
-1 if either the format
is invalid or the width
too large.
Authors
Johannes Pfau | cairoD |
Andrej Mitrovic | cairoD |
cairo team | cairo |