6.144. sibl_gui.ui.common

common.py

Platform:
Windows, Linux, Mac Os X.
Description:
Defines common ui manipulation related objects.

Others:

6.144.1. Module Attributes

sibl_gui.ui.common.LOGGER

6.144.2. Functions

sibl_gui.ui.common.convertImage(image, type)[source]

Converts given image to given type.

Parameters:
  • image (QImage) – Image to convert.
  • type (QImage or QPixmap or QIcon) – Type to convert to.
Returns:

Converted image.

Return type:

QImage or QPixmap or QIcon

sibl_gui.ui.common.getThumbnailPath(path, size, cacheDirectory=None)[source]

Returns given image thumbnail cached path at given size.

Parameters:
  • path (unicode) – Image path.
  • size (unicode) – Thumbnail size.
  • cacheDirectory (unicode) – Thumbnails cache directory.
Returns:

Cached thumbnail path.

Return type:

unicode

sibl_gui.ui.common.extractThumbnail(path, size=u'Default', image=None, format=u'PNG', quality=-1, cacheDirectory=None)[source]

Extract given image thumbnail at given size.

Parameters:
  • path (unicode) – Image path.
  • size (unicode) – Thumbnail size.
  • image (QImage) – Image to use instead of given path one.
  • format (unicode) – Thumbnail format.
  • quality (int) – Thumbnail quality, -1 to 100.
  • cacheDirectory (unicode) – Thumbnails cache directory.
Returns:

Thumbnail image.

Return type:

QImage

sibl_gui.ui.common.loadGraphicsItem(path, type, size=u'Default')[source]

Loads a graphic item: QIcon, QImage, QPixmap.

Parameters:
  • path (unicode) – Image path.
  • type (QObject) – QIcon, QImage, QPixmap.
  • size (unicode) – Image size.
Returns:

Image. ( QIcon, QImage, QPixmap )

sibl_gui.ui.common.getGraphicsItem(path, type, size=u'Default', asynchronousLoading=True, placeholder=None, imagesCache=None)[source]

Returns a display item: QIcon, QImage, QPixmap instance.

Parameters:
  • path (unicode) – Image path.
  • type (QObject) – QIcon, QImage, QPixmap.
  • size (unicode) – Image size.
  • asynchronousLoading (bool) – Images are loaded asynchronously.
  • placeholder – Placeholder to use while loading asynchronously. ( QIcon, QImage, QPixmap )
  • imagesCache (Dictionary or AsynchronousGraphicsItemsCache) – Image cache.
Returns:

Image. ( QIcon, QImage, QPixmap )

sibl_gui.ui.common.getIcon(path, size=u'Default', asynchronousLoading=True, placeholder=None, imagesCache=None)[source]

Returns a QIcon instance.

Parameters:
  • path (unicode) – Icon image path.
  • size (unicode) – Image size.
  • asynchronousLoading (bool) – Images are loaded asynchronously.
  • placeholder (QIcon) – Placeholder to use while loading asynchronously.
  • imagesCache (Dictionary or AsynchronousGraphicsItemsCache) – Image cache.
Returns:

QIcon.

Return type:

QIcon

sibl_gui.ui.common.getPixmap(path, size=u'Default', asynchronousLoading=True, placeholder=None, imagesCache=None)[source]

Returns a QPixmap instance.

Parameters:
  • path (unicode) – Icon image path.
  • size (unicode) – Image size.
  • asynchronousLoading (bool) – Images are loaded asynchronously.
  • placeholder (QPixmap) – Placeholder to use while loading asynchronously.
  • imagesCache (Dictionary or AsynchronousGraphicsItemsCache) – Image cache.
Returns:

QPixmap.

Return type:

QPixmap

sibl_gui.ui.common.getImage(path, size=u'Default', asynchronousLoading=True, placeholder=None, imagesCache=None)[source]

Returns a QImage instance.

Parameters:
  • path (unicode) – Icon image path.
  • size (unicode) – Image size.
  • asynchronousLoading (bool) – Images are loaded asynchronously.
  • placeholder (QImage) – Placeholder to use while loading asynchronously.
  • imagesCache (Dictionary or AsynchronousGraphicsItemsCache) – Image cache.
Returns:

QImage.

Return type:

QImage

sibl_gui.ui.common.createPixmap(width=128, height=128, text=None)[source]

Create a default QPixmap instance.

Parameters:
  • width (int) – Pixmap width.
  • height (int) – Pixmap height.
  • text (unicode) – Pximap text.
Returns:

QPixmap.

Return type:

QPixmap

sibl_gui.ui.common.getImageInformationsHeader(path, graphicsItem)[source]

Returns a sibl_gui.libraries.freeImage.freeImage.ImageInformationsHeader class from given path and graphics item.

Parameters:
  • path (unicode) – Image path.
  • graphicsItem – Image graphics item. ( QImage, QPixmap, QIcon )
Returns:

Image informations header.

Return type:

ImageInformationsHeader

sibl_gui.ui.common.filterImagePath(path)[source]

Filters the image path.

Parameters:path (unicode) – Image path.
Returns:Path.
Return type:unicode
sibl_gui.ui.common.getFormattedShotDate(date, time)[source]

Returns a formatted shot date.

Parameters:
  • date (unicode) – Ibl Set date key value.
  • time (unicode) – Ibl Set time key value.
Returns:

Current shot date.

Return type:

unicode