The image module¶
A page that can display an image, loaded using QImage.
ImagePages are instantiated quite fast. The image is only really loaded on first display.
-
class
ImageContainer
(image)[source]¶ Bases:
object
Represent an image, is shared among copies of the “same” Page.
-
class
ImageLoader
(source, autoTransform=True)[source]¶ Bases:
qpageview.image.ImageContainer
Represent an image loaded from a file or IO device.
-
class
ImagePage
(container, renderer=None)[source]¶ Bases:
qpageview.page.AbstractRenderedPage
A Page that displays an image in any file format supported by Qt.
-
autoTransform
= True¶
-
dpi
= 96¶
-
classmethod
load
(filename, renderer=None)[source]¶ Load the image and yield one ImagePage instance if loading was successful.
-
classmethod
fromImage
(image, renderer=None)[source]¶ Instantiate one ImagePage from the supplied QImage.
As the image is kept in memory, it is not advised to instantiate many Page instances this way. Use load() for images on the filesystem. The image must be valid, and have a size > 0.
-
image
(rect=None, dpiX=None, dpiY=None, paperColor=None)[source]¶ Return a QImage of the specified rectangle.
-
group
()[source]¶ Return the group the page belongs to.
This could be some document structure, so that different Page objects could refer to the same graphical contents, preventing double caching.
This object is used together with the value returned by ident() as a key to cache the page. The idea is that the contents of the page are uniquely identified by the objects returned by group() and ident().
This way, when the same document is opened in multiple page instances, only one copy resides in the (global) cache.
By default, the page object itself is returned.
-
mutex
()[source]¶ Return an object that should be locked when rendering the page.
Page are guaranteed not to be rendered at the same time when they return the same mutex object. By default, None is returned.
-
renderer
= <qpageview.image.ImageRenderer object>¶
-
-
class
ImageDocument
(sources=(), renderer=None)[source]¶ Bases:
qpageview.document.MultiSourceDocument
A Document representing a group of images.
A source may be a filename, a QIODevice or a QImage.
-
pageClass
¶ alias of
qpageview.image.ImagePage
-