[cairo] i am not clear about the STRIDE parameter present in cairo_image_surface_create_for_data ()...

Gerdus van Zyl gerdusvanzyl at gmail.com
Mon Apr 14 07:56:30 PDT 2008


The stride is how many pieces of information make up a row of pixels. eg.
ARGB is 4xWidth.
Since cairo 1.6 you should use the cairo_format_stride_for_width function to
get the correct stride (which may differ with cairo optimizations).

~Gerdus

On Mon, Apr 14, 2008 at 4:19 PM, Rajeshwaran Paulchamy <
Rajeshwaran.Paulchamy at toshiba-tesi.com> wrote:

>  i have created a surface using the format *CAIRO_FORMAT_A1*
>
>
>
>             surface           =
> cairo_image_surface_create_for_data
>
>
>                                         (imgarray,
>
>
>                                        *CAIRO_FORMAT_A1*,
>
>
>                                        16,  /*width*/
>
>
>                                        18,  /*height*/
>
>                                                 *2   /*stride*/  * );
>
>
>
> then i have rendered the image by using below.
>
>
>
>                         cairo_mask_surface     (      cr,
>
>
> surface,
>
>
> 20,
>
>
> 60);
>
>
>
> the result i have received as below.
>
>
>
> [image: *]
>
>
>
>
>
> but the result should be come as below
>
>
>
>
>
> please help me,  in the api *cairo_image_surface_create_for_data ()* what
> will be the value*, *i have to give to the *STRIDE* parameter to get  the
> correct output,*  *
>
> * *
>
> i am not clear about *STRIDE* parameter. what is the exact definition for
> this? CAIRO document definition not able to understand by me.
>
>
>
> cheers,
>
> rajeshwaran paulchamy.
>
> The information contained in this e-mail message and in any
> attachments/annexure/appendices is confidential to the
> recipient and may contain privileged information.
> If you are not the intended recipient, please notify the
> sender and delete the message along with any
> attachments/annexure/appendices. You should not disclose,
> copy or otherwise use the information contained in the
> message or any annexure. Any views expressed in this e-mail
> are those of the individual sender except where the sender
> specifically states them to be the views of
> Toshiba Embedded Software India Pvt. Ltd. (TESI),Bangalore.
>
> Although this transmission and any attachments are believed to be
> free of any virus or other defect that might affect any computer
> system into which it is received and opened, it is the responsibility
> of the recipient to ensure that it is virus free and no responsibility
> is accepted by Toshiba Embedded Software India Pvt. Ltd, for any loss or
> damage arising in any way from its use.
>
>
>
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cairographics.org/archives/cairo/attachments/20080414/4e50a52b/attachment.html 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/jpeg
Size: 1343 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080414/4e50a52b/attachment-0001.jpeg 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/gif
Size: 1962 bytes
Desc: not available
Url : http://lists.cairographics.org/archives/cairo/attachments/20080414/4e50a52b/attachment-0001.gif 


More information about the cairo mailing list