Package dtk :: Package ui :: Module cache_pixbuf :: Class CachePixbuf

Class CachePixbuf

source code


Cache pixbuf use to cache pixbuf to avoid new pixbuf generate by scale_simple.

gtk.gdk.pixbuf.scale_simple is function will make application very slow,

We use CachePixbuf increase the call times of gtk.gdk.pixbuf.scale_simple.

Instance Methods
 
__init__(self)
Init cache pixbuf.
source code
 
scale(self, pixbuf, scale_width, scale_height, vertical_mirror=False, horizontal_mirror=False)
Scale with given sizce and return new pixbuf.
source code
 
get_cache(self)
Get pixbuf cache.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties

Inherited from object: __class__

Method Details

__init__(self)
(Constructor)

source code 

Init cache pixbuf.

Overrides: object.__init__

scale(self, pixbuf, scale_width, scale_height, vertical_mirror=False, horizontal_mirror=False)

source code 

Scale with given sizce and return new pixbuf.

Parameters:
  • pixbuf - Original pixbuf.
  • scale_width - Scale width of pixbuf.
  • scale_height - Scale height of pixbuf.
  • vertical_mirror - Whether pixbuf mirror vertically.
  • horizontal_mirror - Whether pixbuf mirror horizontally.

get_cache(self)

source code 

Get pixbuf cache.

Returns:
Return cache pixbuf.