Gtk2::G...::Cache(3)
π Gtk2::Gdk::Pixbuf::Draw::Cache β bestie edition π
okay so this is the page for Gtk2::G...::Cache(3), from the User Contributed Perl Documentation collection (yes that's the whole manual name, it's a mouthful, we move). it's giving "niche but iconic" fr fr π
β¨ NAME β¨
Gtk2::Gdk::Pixbuf::Draw::Cache β the Cache for drawing scaled pixbufs π
πΈ DESCRIPTION πΈ
Gtk2::Gdk::Pixbuf::Draw::Cache gives you a cache, and bestie, this cache is supposed to be used by the Gtk2::ImageView::Tool whenever it's redrawing the Gtk2::ImageView. that's literally its whole job. no cap. β¨
π¦ HIERARCHY π¦
look at this little family tree, so cute:
Glib::Boxed
+----Gtk2::Gdk::Pixbuf::Draw::Cache
π METHODS π
π cache = Gtk2::Gdk::Pixbuf::Draw::Cache->new
Returns a new pixbuf draw cache. fresh out the box, brand new, main character energy. π
π $cache->draw ($opts, $drawable)
the args, bestie:
$opts(Gtk2::Gdk::Pixbuf::Draw::Opts)$drawable(Gtk2::Gdk::Drawable)
this redraws the area specified in the pixbuf draw options, but like, in an efficient way, because it uses caching. we love an efficient queen. π₯
and the deets:
- cache : a
GdkPixbufDrawCache - opts : the
Gtk2::Gdk::Pixbuf::Draw::Optsto use in this draw - drawable : a
GdkDrawableto draw on
π $cache->free
Deallocates a pixbuf draw cache and all its data. it's over, it's done, say goodbye ππ
π§ $cache->invalidate
Force the pixbuf draw cache to scale the pixbuf at the next draw. forceful. iconic. π
Gtk2::Gdk::Pixbuf::Draw::Cache tries to minimize the number of scale operations needed by caching the last drawn pixbuf. and ngl, it would be inefficient to check the individual pixels inside the pixbuf, so instead it assumes that if the memory address of the pixbuf has not changed, then the cache is good to use. lowkey clever, highkey risky.
HOWEVER. π when the image data is modified, this assumption breaks β which is exactly why you must use this method to tell the draw cache about it. don't skip this step bestie, fr fr.
β method = Gtk2::Gdk::Pixbuf::Draw::Cache->get_method ($old, $new)
args, one more time:
$old(Gtk2::Gdk::Pixbuf::Draw::Opts)$new(Gtk2::Gdk::Pixbuf::Draw::Opts)
Gets the fastest method to draw the specified draw options. old is assumed to be the last PixbufDrawOpts used, and new is the one to use this time. speedrun strats πβοΈπ¨
π ENUMS AND FLAGS π
enum Gtk2::Gdk::Pixbuf::Draw::Method
the whole lineup, no notes:
'scale'/'GDK_PIXBUF_DRAW_METHOD_SCALE''contains'/'GDK_PIXBUF_DRAW_METHOD_CONTAINS''scroll'/'GDK_PIXBUF_DRAW_METHOD_SCROLL'
π«Ά SEE ALSO π«Ά
Gtk2::ImageViewGlib::Boxed
go read those too, iykyk π
π COPYRIGHT π
Copyright (C) 2007 by Jeffrey Ratcliffe.
This software is licensed under the GPL-3; see Gtk2::ImageView for a full notice.
and that's the whole page babes β¨ this was perl v5.42.0, dated 2025-07-25, living its life as Gtk2::G...::Cache(3). slay, stay cached, and remember: invalidate when you mutate ππ¦π
π¦ where this page comes from
- fedora 43: perl-Gtk2-ImageView 0.05-35.fc43 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms