MIRA
|
Functions | |
QImage | makeQImage (const Img8U1 &img) |
Create QImage from 8bit unsigned image. More... | |
QImage | makeQImage (const Img< int8, 1 > &img) |
Create QImage from 8bit signed image. More... | |
QImage | makeQImage (const Img8U3 &img) |
Create QImage from 3-channel 8bit unsigned image. More... | |
QImage | makeQImage (const Img8U4 &img) |
Create QImage from 4-channel 8bit unsigned image. More... | |
QImage | makeQImage (const Img16U1 &img, uint16_t minVal, uint16_t maxVal) |
Create QImage from 16bit unsigned image. More... | |
QImage | makeQImage (const Img16S1 &img, int16_t minVal, int16_t maxVal) |
Create QImage from 16bit signed image. More... | |
QImage | makeQImage (const Img32F1 &img, float minVal, float maxVal) |
Create QImage from float image. More... | |
QImage | makeQImage (const Img64F1 &img, double minVal, double maxVal) |
Create QImage from double image. More... | |
QImage | makeQImage (const Img<> &img) |
Create QImage from generic image, checks actual format and calls the respective specific overload for handling. More... | |
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... | |
QImage | asQImage (Img8U1 &img) |
Create QImage wrapper for 8bit unsigned image (sharing img's memory). More... | |
QImage | asQImage (const Img8U1 &img) |
Create QImage from 8bit unsigned image. More... | |
QImage | asQImage (Img8U4 &img) |
Create QImage wrapper for 4-channel 8bit unsigned image (sharing img's memory) More... | |
QImage | asQImage (const Img8U4 &img) |
Create (const) QImage wrapper for 4-channel 8bit unsigned image. More... | |
void | fromQImage (const QImage &qimage, Img<> &oImg) |
Convert a QImage to an image. More... | |
void | setTransform (QGraphicsItem *item, const RigidTransform2f &t) |
Applies a transform (translation and rotation) to a graphics scene item. More... | |
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... | |
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... | |
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... | |
void | initPainterFrom (QPainter &painter, const QWidget &widget) |
Init painter's pen, background and font from widget. More... | |
QImage mira::QtUtils::makeQImage | ( | const Img8U1 & | img | ) |
Create QImage from 8bit unsigned image.
Create QImage from 8bit signed image.
QImage mira::QtUtils::makeQImage | ( | const Img8U3 & | img | ) |
Create QImage from 3-channel 8bit unsigned image.
QImage mira::QtUtils::makeQImage | ( | const Img8U4 & | img | ) |
Create QImage from 4-channel 8bit unsigned image.
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. |
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. |
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. |
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. |
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). |
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. |
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.
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().
QImage mira::QtUtils::asQImage | ( | Img8U4 & | img | ) |
Create QImage wrapper for 4-channel 8bit unsigned image (sharing img's memory)
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.
void mira::QtUtils::fromQImage | ( | const QImage & | qimage, |
Img<> & | oImg | ||
) |
Convert a QImage to an image.
void mira::QtUtils::setTransform | ( | QGraphicsItem * | item, |
const RigidTransform2f & | t | ||
) |
Applies a transform (translation and rotation) to a graphics scene item.
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.
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. |
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.
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.