cairo_format_stride_for_width: cairo_format_stride_for_width

Description Usage Arguments Details Value See Also

View source: R/cairo-image-surface.R

Description

This function provides a stride value that will respect all alignment requirements of the accelerated image-rendering code within cairo. Typical usage will be of the form:

Usage

1

Arguments

format

[int] A #cairo_format_t value

width

[int] The desired width of an image surface to be created.

Details

<informalexample><programlisting> int stride; unsigned char *data; cairo_surface_t *surface;

stride = cairo_format_stride_for_width (format, width); data = malloc (stride * height); surface = cairo_image_surface_create_for_data (data, format, width, height, stride); </programlisting></informalexample>

Return value: the appropriate stride to use given the desired format and width, or -1 if either the format is invalid or the width too large.

Since: 1.6

C function prototype: int cairo_format_stride_for_width (cairo_format_t format, int width)

Value

[int]

See Also

Other cairo-image-surface: cairo_image_surface_create_for_data(), cairo_image_surface_create(), cairo_image_surface_get_data(), cairo_image_surface_get_format(), cairo_image_surface_get_height(), cairo_image_surface_get_stride(), cairo_image_surface_get_width()


coolbutuseless/cairocore documentation built on Aug. 31, 2020, 12:43 a.m.