QSFML
|
sf::Image ↔ QImage compatibility layer More...
#include <Image.hpp>
Public Member Functions | |
Image () | |
Default constructor. More... | |
Image (const QImage &qImg) | |
Constructor taking reference to QImage. More... | |
QImage | asQImage () |
Converts to QImage. More... | |
void | loadFromQImage (const QImage &qImg) |
Load image from QImage. More... | |
sf::Image ↔ QImage compatibility layer
Very simple class that inherits sf::Image. Its only additional purpose is being able to create QImage and to be loaded from such.
qsf::Image::Image | ( | ) |
Default constructor.
Calls sf::Image's default constructor.
qsf::Image::Image | ( | const QImage & | qImg | ) |
Constructor taking reference to QImage.
[in] | qImg | – const reference to QImage |
Calls loadFromQImage(img) to create qsf::Image.
QImage qsf::Image::asQImage | ( | ) |
Converts to QImage.
Creates QImage using sf::Image data, way faster than creating qsf::Image from QImage, as sf::Image always uses RGBA8888 format.
void qsf::Image::loadFromQImage | ( | const QImage & | qImg | ) |
Load image from QImage.
[in] | qImg | – const reference to QImage |
Creates qsf::Image using QImage's data, slow as it has to copy QImage (to ensure, that it has proper format) and then copies it again into sf::Image backend.