MIRA
|
Functions | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img8U1 &img) |
Create QImage from 8bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img< int8, 1 > &img) |
Create QImage from 8bit signed image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img8U3 &img) |
Create QImage from 3-channel 8bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img8U4 &img) |
Create QImage from 4-channel 8bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img16U1 &img, uint16_t minVal, uint16_t maxVal) |
Create QImage from 16bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img16S1 &img, int16_t minVal, int16_t maxVal) |
Create QImage from 16bit signed image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img32F1 &img, float minVal, float maxVal) |
Create QImage from float image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img64F1 &img, double minVal, double maxVal) |
Create QImage from double image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img<> &img) |
Create QImage from generic image, checks actual format and calls the respective specific overload for handling. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | makeQImage (const Img<> &img, double minVal, double maxVal) |
Create QImage from generic image, checks actual format and calls the respective specific overload for handling. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | asQImage (Img8U1 &img) |
Create QImage wrapper for 8bit unsigned image (sharing img's memory). More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | asQImage (const Img8U1 &img) |
Create QImage from 8bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | asQImage (Img8U4 &img) |
Create QImage wrapper for 4-channel 8bit unsigned image (sharing img's memory) More... | |
MIRA_GUI_WIDGETS_EXPORT QImage | asQImage (const Img8U4 &img) |
Create (const) QImage wrapper for 4-channel 8bit unsigned image. More... | |
MIRA_GUI_WIDGETS_EXPORT void | fromQImage (const QImage &qimage, Img<> &oImg) |
Convert a QImage to an image. More... | |
MIRA_GUI_WIDGETS_EXPORT void | setTransform (QGraphicsItem *item, const RigidTransform2f &t) |
Applies a transform (translation and rotation) to a graphics scene item. More... | |
MIRA_GUI_WIDGETS_EXPORT QString | getOpenFileName (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=NULL, QFileDialog::Options options=QFileDialog::DontUseNativeDialog) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More... | |
MIRA_GUI_WIDGETS_EXPORT QString | getSaveFileName (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), const QString &filter=QString(), QString *selectedFilter=NULL, QFileDialog::Options options=QFileDialog::DontUseNativeDialog, const QStringList &enforceExtension=QStringList()) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More... | |
MIRA_GUI_WIDGETS_EXPORT QString | getExistingDirectory (QWidget *parent=NULL, const QString &caption=QString(), const QString &dir=QString(), QFileDialog::Options options=QFileDialog::DontUseNativeDialog|QFileDialog::ShowDirsOnly) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences. More... | |
MIRA_GUI_WIDGETS_EXPORT void | initPainterFrom (QPainter &painter, const QWidget &widget) |
Init painter's pen, background and font from widget. More... | |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img8U1 & | img | ) |
Create QImage from 8bit unsigned image.
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img< int8, 1 > & | img | ) |
Create QImage from 8bit signed image.
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img8U3 & | img | ) |
Create QImage from 3-channel 8bit unsigned image.
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img8U4 & | img | ) |
Create QImage from 4-channel 8bit unsigned image.
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img16U1 & | img, |
uint16_t | minVal, | ||
uint16_t | maxVal | ||
) |
Create QImage from 16bit unsigned image.
Pixel values are mapped from (minVal,maxVal) interval to (0,255) (and saturated).
XInvalidParameter | if maxVal <= minVal. |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img16S1 & | img, |
int16_t | minVal, | ||
int16_t | maxVal | ||
) |
Create QImage from 16bit signed image.
Pixel values are mapped from (minVal,maxVal) interval to (0,255) (and saturated).
XInvalidParameter | if maxVal <= minVal. |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img32F1 & | img, |
float | minVal, | ||
float | maxVal | ||
) |
Create QImage from float image.
Pixel values are mapped from (minVal,maxVal) interval to (0,255) (and saturated).
XInvalidParameter | if maxVal <= minVal. |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img64F1 & | img, |
double | minVal, | ||
double | maxVal | ||
) |
Create QImage from double image.
Pixel values are mapped from (minVal,maxVal) interval to (0,255) (and saturated).
XInvalidParameter | if maxVal <= minVal. |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img<> & | img | ) |
Create QImage from generic image, checks actual format and calls the respective specific overload for handling.
XNotImplemented | if conversion is not implemented for image pixel format. |
XInvalidParameter | if image pixel format is other than 8bit (single or multi channel). |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::makeQImage | ( | const Img<> & | img, |
double | minVal, | ||
double | maxVal | ||
) |
Create QImage from generic image, checks actual format and calls the respective specific overload for handling.
Pixel values are mapped from (minVal,maxVal) interval to (0,255) (and saturated).
XNotImplemented | if conversion is not implemented for image pixel format. |
XInvalidParameter | if image pixel format is 8bit (single or multi channel). |
XInvalidParameter | if maxVal <= minVal. |
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::asQImage | ( | Img8U1 & | img | ) |
Create QImage wrapper for 8bit unsigned image (sharing img's memory).
QImage requires all image data to be 32bit-aligned, so this throws XInvalidParameter if img.step() does not return a multiple of 4.
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::asQImage | ( | const Img8U1 & | img | ) |
Create QImage from 8bit unsigned image.
QImage requires all image data to be 32bit-aligned, so this throws XInvalidParameter if img.step() does not return a multiple of 4.
The required setColorTable() will trigger a deep-copy internally (as originally shared image data is read-only in the const& case), so the resulting QImage will NOT share memory of the input img and there is no real advantage over makeQImage().
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::asQImage | ( | Img8U4 & | img | ) |
Create QImage wrapper for 4-channel 8bit unsigned image (sharing img's memory)
MIRA_GUI_WIDGETS_EXPORT QImage mira::QtUtils::asQImage | ( | const Img8U4 & | img | ) |
Create (const) QImage wrapper for 4-channel 8bit unsigned image.
This will share img's memory, but mark it read-only. Non-const access to the QImage will result in automatic deep-copying.
MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::fromQImage | ( | const QImage & | qimage, |
Img<> & | oImg | ||
) |
Convert a QImage to an image.
MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::setTransform | ( | QGraphicsItem * | item, |
const RigidTransform2f & | t | ||
) |
Applies a transform (translation and rotation) to a graphics scene item.
MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getOpenFileName | ( | QWidget * | parent = NULL , |
const QString & | caption = QString() , |
||
const QString & | dir = QString() , |
||
const QString & | filter = QString() , |
||
QString * | selectedFilter = NULL , |
||
QFileDialog::Options | options = QFileDialog::DontUseNativeDialog |
||
) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.
MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getSaveFileName | ( | QWidget * | parent = NULL , |
const QString & | caption = QString() , |
||
const QString & | dir = QString() , |
||
const QString & | filter = QString() , |
||
QString * | selectedFilter = NULL , |
||
QFileDialog::Options | options = QFileDialog::DontUseNativeDialog , |
||
const QStringList & | enforceExtension = QStringList() |
||
) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.
[in] | enforceExtension | If a non-empty list is provided as argument, the method will make sure one of these extensions is selected, replacing the extension entered by the user with the first element in the list if necessary. |
MIRA_GUI_WIDGETS_EXPORT QString mira::QtUtils::getExistingDirectory | ( | QWidget * | parent = NULL , |
const QString & | caption = QString() , |
||
const QString & | dir = QString() , |
||
QFileDialog::Options | options = QFileDialog::DontUseNativeDialog|QFileDialog::ShowDirsOnly |
||
) |
Enforce the use of non-native FileDialog-methods to prevent platform depending behavior differences.
MIRA_GUI_WIDGETS_EXPORT void mira::QtUtils::initPainterFrom | ( | QPainter & | painter, |
const QWidget & | widget | ||
) |
Init painter's pen, background and font from widget.
Replaces QPainter::initFrom(QPaintDevice*) deprecated in Qt5.15.