tahoma2d/toonz/sources/stopmotion/jpgconverter.h

61 lines
1.2 KiB
C
Raw Normal View History

2020-04-27 16:15:39 +12:00
#pragma once
#ifndef JPGCONVERTER_H
#define JPGCONVERTER_H
//#include "opencv2/opencv.hpp"
#include "turbojpeg.h"
#ifdef WITH_CANON
// Canon Includes
#include "EDSDK.h"
#include "EDSDKErrors.h"
#include "EDSDKTypes.h"
#endif
// Toonz Includes
#include "traster.h"
#include "tfilepath.h"
#include <QObject>
#include <QThread>
class QCamera;
class QCameraInfo;
//=============================================================================
// JpgConverter
//-----------------------------------------------------------------------------
class JpgConverter : public QThread {
Q_OBJECT
#ifdef WITH_CANON
EdsStreamRef m_stream;
#endif
TRaster32P m_finalImage;
2020-05-27 14:31:52 +12:00
// bool m_scale = false;
2020-04-27 16:15:39 +12:00
int m_scaleWidth = 0;
public:
JpgConverter();
~JpgConverter();
static void saveJpg(TRaster32P, TFilePath path);
static bool loadJpg(TFilePath path, TRaster32P& image);
#ifdef WITH_CANON
void setStream(EdsStreamRef stream);
2020-05-27 14:31:52 +12:00
// void setScale(bool scale) { m_scale = scale; }
2020-04-27 16:15:39 +12:00
void setScaleWidth(bool scaleWidth) { m_scaleWidth = scaleWidth; }
TRaster32P getImage() { return m_finalImage; }
void convertFromJpg();
protected:
void run() override;
#endif
signals:
void imageReady(bool);
};
//#endif
#endif // JPGCONVERTER_H