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