First version OpenGL drawing
This commit is contained in:
+14
-2
@@ -2,6 +2,7 @@
|
||||
#include <QThreadPool>
|
||||
#include <QDir>
|
||||
#include "loadrunable.h"
|
||||
#include "rawimage.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
@@ -31,6 +32,7 @@ void Image::load()
|
||||
void Image::release()
|
||||
{
|
||||
m_pixmap = QPixmap();
|
||||
m_rawImage.reset();
|
||||
m_released = true;
|
||||
m_loading = false;
|
||||
}
|
||||
@@ -45,6 +47,11 @@ QPixmap Image::pixmap() const
|
||||
return m_pixmap;
|
||||
}
|
||||
|
||||
RawImageAbs *Image::rawImage()
|
||||
{
|
||||
return m_rawImage.get();
|
||||
}
|
||||
|
||||
ImageInfoData Image::info() const
|
||||
{
|
||||
return m_info;
|
||||
@@ -55,15 +62,20 @@ bool Image::isCurrent() const
|
||||
return !m_released;
|
||||
}
|
||||
|
||||
void Image::imageLoaded(QImage img, ImageInfoData info)
|
||||
void Image::imageLoaded(QImage img, void *rawImage, ImageInfoData info)
|
||||
{
|
||||
m_loading = false;
|
||||
if(!m_released)
|
||||
{
|
||||
m_pixmap = QPixmap::fromImage(img);
|
||||
m_rawImage.reset(static_cast<RawImageAbs*>(rawImage));
|
||||
m_info = info;
|
||||
emit pixmapLoaded(this);
|
||||
}
|
||||
else
|
||||
{
|
||||
delete rawImage;
|
||||
}
|
||||
}
|
||||
|
||||
ImageRingList::ImageRingList(QObject *parent) : QObject(parent)
|
||||
@@ -223,7 +235,7 @@ void ImageRingList::imageLoaded(Image *image)
|
||||
{
|
||||
if(image->name() == (*m_currImage)->name())
|
||||
{
|
||||
emit pixmapLoaded(image->pixmap());
|
||||
emit pixmapLoaded(image);
|
||||
emit infoLoaded(image->info());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user