From a2e3026d8a398a4d08c05610c3f652dd14fcdf45 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 13 Feb 2008 08:43:57 -0500 Subject: add a bunch of comments for images and image caches. and make the number of resized pictures saved in an image tunable per-icon cache. --- render/render.h | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'render/render.h') diff --git a/render/render.h b/render/render.h index e79727df..7053664d 100644 --- a/render/render.h +++ b/render/render.h @@ -234,11 +234,18 @@ struct _RrImagePic { pictures */ struct _RrImage { gint ref; - struct _RrImageCache *cache; + RrImageCache *cache; - struct _RrImagePic **original; + /*! An array of "originals", that is of RrPictures that have been added + to the image in various sizes, and that have not been resized. These + are explicitly added to the RrImage. */ + RrImagePic **original; gint n_original; - struct _RrImagePic **resized; + /*! An array of "resized" pictures. When an "original" RrPicture + needs to be resized for drawing, it is saved in here so that it doesn't + need to be resized again. These are automatically added to the + RrImage. */ + RrImagePic **resized; gint n_resized; }; @@ -317,7 +324,10 @@ gboolean RrPixmapToRGBA(const RrInstance *inst, Pixmap pmap, Pixmap mask, gint *w, gint *h, RrPixel32 **data); -RrImageCache* RrImageCacheNew(); +/*! Create a new image cache for RrImages. + @param max_resized_saved The number of resized copies of an image to save +*/ +RrImageCache* RrImageCacheNew(gint max_resized_saved); void RrImageCacheRef(RrImageCache *self); void RrImageCacheUnref(RrImageCache *self); -- cgit v1.2.3