Package: gdk

Function gdk:texture-download

Lambda List

gdk:texture-download (texture data stride)

Arguments

texture -- a gdk:texture object
data -- a pointer to enough memory to be filled with the downloaded data of texture
stride -- rowstride in bytes

Details

Downloads the texture into local memory. This may be an expensive operation, as the actual texture data may reside on a GPU or on a remote display server.

The data format of the downloaded data is equivalent to the :argb32 value of the cairo:format-t enumeration, so every downloaded pixel requires 4 bytes of memory.

Examples

Downloading a texture into a Cairo image surface:
(let ((surface (cairo:image-surface-reate :argb32
                                          (gdk:texture-width texture)
                                          (gdk:texture-height texture))))
  (gdk:texture-download texture
                        (cairo:image-surface-data surface)
                        (cairo:image-surface-stride surface))
  (cairo:surface-mark-dirty surface)
  ... )    
 

See also

#2023-4-12