|
Shinya Kitaoka |
810553 |
#pragma once
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifndef TIIO_MOV_H
|
|
Toshihiro Shimizu |
890ddd |
#define TIIO_MOV_H
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#ifdef x64
|
|
Toshihiro Shimizu |
890ddd |
#include "tiio_mov_proxy.h"
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Windows include
|
|
Toshihiro Shimizu |
890ddd |
#include <windows.h></windows.h>
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// QuickTime includes
|
|
Shinya Kitaoka |
120a6e |
namespace QuickTime {
|
|
Toshihiro Shimizu |
890ddd |
#define list List
|
|
Toshihiro Shimizu |
890ddd |
#define map Map
|
|
Toshihiro Shimizu |
890ddd |
#define iterator Iterator
|
|
Toshihiro Shimizu |
890ddd |
#define float_t Float_t
|
|
Shinya Kitaoka |
6526c7 |
#define int_fast8_t QT_int_fast8_t
|
|
Shinya Kitaoka |
6526c7 |
#define int_fast16_t QT_int_fast16_t
|
|
Shinya Kitaoka |
6526c7 |
#define uint_fast16_t QT_uint_fast16_t
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "QTML.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "Movies.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "Script.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "FixMath.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "Sound.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "QuickTimeComponents.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#include "tquicktime.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef list
|
|
Toshihiro Shimizu |
890ddd |
#undef map
|
|
Toshihiro Shimizu |
890ddd |
#undef iterator
|
|
Toshihiro Shimizu |
890ddd |
#undef float_t
|
|
Shinya Kitaoka |
6526c7 |
#undef QT_int_fast8_t
|
|
Shinya Kitaoka |
6526c7 |
#undef QT_int_fast16_t
|
|
Shinya Kitaoka |
6526c7 |
#undef QT_uint_fast16_t
|
|
Shinya Kitaoka |
120a6e |
} // namespace QuickTime
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
// Toonz includes
|
|
Toshihiro Shimizu |
890ddd |
#include "tlevel_io.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tthreadmessage.h"
|
|
Toshihiro Shimizu |
890ddd |
#include "tcommon.h"
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
#undef DVAPI
|
|
Toshihiro Shimizu |
890ddd |
#undef DVVAR
|
|
Toshihiro Shimizu |
890ddd |
#ifdef IMAGE_EXPORTS
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_EXPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_EXPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#else
|
|
Toshihiro Shimizu |
890ddd |
#define DVAPI DV_IMPORT_API
|
|
Toshihiro Shimizu |
890ddd |
#define DVVAR DV_IMPORT_VAR
|
|
Toshihiro Shimizu |
890ddd |
#endif
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
using namespace QuickTime;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Forward declarations
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
class TImageWriterMov;
|
|
Toshihiro Shimizu |
890ddd |
class TImageReaderMov;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//-----------------------------------------------------------------------------
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Global functions
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
bool IsQuickTimeInstalled();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//***********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// Mov TLevelWriter class
|
|
Toshihiro Shimizu |
890ddd |
//***********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class TLevelWriterMov : public TLevelWriter {
|
|
Shinya Kitaoka |
120a6e |
std::vector<std::pair<int, timevalue="">> m_savedFrames;</std::pair<int,>
|
|
Shinya Kitaoka |
120a6e |
int m_IOError;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
Movie m_movie;
|
|
Shinya Kitaoka |
120a6e |
Track m_videoTrack;
|
|
Shinya Kitaoka |
120a6e |
Track m_soundTrack;
|
|
Shinya Kitaoka |
120a6e |
Media m_videoMedia;
|
|
Shinya Kitaoka |
120a6e |
Media m_soundMedia;
|
|
Shinya Kitaoka |
120a6e |
GWorldPtr m_gworld;
|
|
Shinya Kitaoka |
120a6e |
PixMapHandle m_pixmap;
|
|
Shinya Kitaoka |
120a6e |
short m_refNum;
|
|
Shinya Kitaoka |
120a6e |
PixelXRGB *m_buf;
|
|
Shinya Kitaoka |
120a6e |
int buf_lx;
|
|
Shinya Kitaoka |
120a6e |
int buf_ly;
|
|
Shinya Kitaoka |
120a6e |
int m_firstFrame;
|
|
Shinya Kitaoka |
120a6e |
TThread::Mutex m_mutex;
|
|
Shinya Kitaoka |
120a6e |
ComponentInstance m_ci;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
TLevelWriterMov(const TFilePath &path, TPropertyGroup *winfo);
|
|
Shinya Kitaoka |
120a6e |
~TLevelWriterMov();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TImageWriterP getFrameWriter(TFrameId fid);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void save(const TImageP &img, int frameIndex);
|
|
Shinya Kitaoka |
120a6e |
void saveSoundTrack(TSoundTrack *st);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
static TLevelWriter *create(const TFilePath &f, TPropertyGroup *winfo) {
|
|
Shinya Kitaoka |
120a6e |
return new TLevelWriterMov(f, winfo);
|
|
Shinya Kitaoka |
120a6e |
}
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//***********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
// Mov TLevelReader class
|
|
Toshihiro Shimizu |
890ddd |
//***********************************************************************************
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class DVAPI TLevelReaderMov : public TLevelReader {
|
|
Shinya Kitaoka |
120a6e |
bool m_readAsToonzOutput; // default: false
|
|
Shinya Kitaoka |
120a6e |
bool m_yMirror; // default: true
|
|
Shinya Kitaoka |
120a6e |
bool m_loadTimecode; // default: false
|
|
Shinya Kitaoka |
120a6e |
int m_IOError;
|
|
Shinya Kitaoka |
120a6e |
|
|
Shinya Kitaoka |
120a6e |
short m_refNum;
|
|
Shinya Kitaoka |
120a6e |
Movie m_movie;
|
|
Shinya Kitaoka |
120a6e |
Track m_track;
|
|
Shinya Kitaoka |
120a6e |
MediaHandler m_timecodeHandler;
|
|
Shinya Kitaoka |
120a6e |
long m_depth;
|
|
Shinya Kitaoka |
120a6e |
std::map<int, timevalue=""> currentTimes;</int,>
|
|
Shinya Kitaoka |
120a6e |
int m_lx, m_ly;
|
|
Shinya Kitaoka |
120a6e |
int m_hh, m_mm, m_ss, m_ff;
|
|
Shinya Kitaoka |
120a6e |
TThread::Mutex m_mutex;
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
TLevelReaderMov(const TFilePath &path);
|
|
Shinya Kitaoka |
120a6e |
~TLevelReaderMov();
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TImageReaderP getFrameReader(TFrameId fid);
|
|
Shinya Kitaoka |
120a6e |
TLevelP loadInfo();
|
|
Shinya Kitaoka |
120a6e |
void load(const TRasterP &rasP, int frameIndex, const TPoint &pos,
|
|
Shinya Kitaoka |
120a6e |
int shrinkX = 1, int shrinkY = 1);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void timecode(int frame, UCHAR &hh, UCHAR &mm, UCHAR &ss, UCHAR &ff);
|
|
Shinya Kitaoka |
120a6e |
void loadedTimecode(UCHAR &hh, UCHAR &mm, UCHAR &ss, UCHAR &ff);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
const TImageInfo *getImageInfo(TFrameId fid) { return m_info; }
|
|
Shinya Kitaoka |
120a6e |
const TImageInfo *getImageInfo() { return m_info; }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
void setYMirror(bool enabled);
|
|
Shinya Kitaoka |
120a6e |
void setLoadTimecode(bool enabled);
|
|
Shinya Kitaoka |
120a6e |
void enableRandomAccessRead(bool enable);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
TDimension getSize() const { return TDimension(m_lx, m_ly); }
|
|
Shinya Kitaoka |
120a6e |
TRect getBBox() const { return TRect(0, 0, m_lx - 1, m_ly - 1); }
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
static TLevelReader *create(const TFilePath &f);
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
private:
|
|
Shinya Kitaoka |
120a6e |
TLevelP loadToonzOutputFormatInfo();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===========================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
// Mov Properties
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
namespace Tiio {
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
class MovWriterProperties : public TPropertyGroup {
|
|
Toshihiro Shimizu |
890ddd |
public:
|
|
Shinya Kitaoka |
120a6e |
MovWriterProperties();
|
|
Toshihiro Shimizu |
890ddd |
};
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
} // namespace Tiio
|
|
Toshihiro Shimizu |
890ddd |
|
|
Toshihiro Shimizu |
890ddd |
//===========================================================================
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#endif //! x64
|
|
Toshihiro Shimizu |
890ddd |
|
|
Shinya Kitaoka |
120a6e |
#endif // TIIO_MOV_H
|