| #pragma once |
| |
| #ifndef IMAGEUTILS_H |
| #define IMAGEUTILS_H |
| |
| |
| #include "trasterfx.h" |
| |
| |
| #include "tregion.h" |
| #include "tvectorimage.h" |
| |
| |
| #include <QWidget> |
| #include <QKeyEvent> |
| |
| #undef DVAPI |
| #undef DVVAR |
| #ifdef TOONZQT_EXPORTS |
| #define DVAPI DV_EXPORT_API |
| #define DVVAR DV_EXPORT_VAR |
| #else |
| #define DVAPI DV_IMPORT_API |
| #define DVVAR DV_IMPORT_VAR |
| #endif |
| |
| |
| |
| |
| |
| class TFilePath; |
| class TPropertyGroup; |
| |
| |
| class QHBoxLayout; |
| |
| |
| |
| namespace ImageUtils { |
| |
| |
| |
| |
| class DVAPI FrameTaskNotifier final : public QObject { |
| Q_OBJECT |
| |
| int m_errorCount, m_warningCount; |
| bool m_abort; |
| |
| public: |
| FrameTaskNotifier() : m_errorCount(0), m_warningCount(0), m_abort(false) {} |
| ~FrameTaskNotifier() {} |
| |
| void notifyFrameCompleted(int frame) { emit frameCompleted(frame); } |
| void notifyError() { |
| m_errorCount++; |
| emit error(); |
| } |
| void notifyLevelCompleted(const TFilePath &fullPath) { |
| emit levelCompleted(fullPath); |
| } |
| |
| bool abortTask() { return m_abort; } |
| void reset() { m_abort = false; } |
| |
| int getErrorCount() const { return m_errorCount; } |
| |
| signals: |
| |
| void frameCompleted(int); |
| void levelCompleted(const TFilePath &fullPath); |
| void error(); |
| |
| protected slots: |
| |
| void onCancelTask() { m_abort = true; } |
| }; |
| |
| |
| |
| TFilePath DVAPI duplicate(const TFilePath &levelPath); |
| |
| void DVAPI premultiply(const TFilePath &levelPath); |
| |
| void DVAPI convert( |
| const TFilePath &source, //!< Level path to convert from. |
| const TFilePath &dest, //!< Level path to convert to. |
| const TFrameId &from, //!< First source frame to convert. Supports |
| //! TFrameId::EMPTY_FRAME |
| //! to specify conversion from the beginning of level. |
| const TFrameId |
| &to, //!< Last source frame to convert. Supports TFrameId::EMPTY_FRAME |
| //! to specify conversion to the end of level. |
| double framerate, //!< Frame rate for destination movie formats. |
| TPropertyGroup *prop, //!< Format properties for the destination level. |
| FrameTaskNotifier |
| *frameNotifier, //!< Observer class for frame success notifications. |
| const TPixel &bgColor = |
| TPixel::Transparent, //!< Destination Background color. |
| bool removeDotBeforeFrameNumber = |
| false |
| での指定に合わせて、[レベル名].[フレーム番号].[拡張子]のうち、 |
| [レベル名]と[フレーム番号]の間のドットを消す。 --*/ |
| ); |
| |
| void DVAPI convertNaa2Tlv( |
| const TFilePath &source, //!< Level path to convert from. |
| const TFilePath &dest, //!< Level path to convert to. |
| const TFrameId &from, //!< First source frame to convert. |
| const TFrameId &to, //!< Last source frame to convert. |
| FrameTaskNotifier |
| *frameNotifier, //!< Observer class for frame success notifications. |
| TPalette *palette = |
| 0, //!< Special conversion function from an antialiased level to tlv. |
| //! \sa Function ImageUtils::convert(). |
| bool removeUnusedStyles = false, |
| double dpi = 0.0); |
| |
| |
| void DVAPI convertOldLevel2Tlv( |
| const TFilePath &source, //!< Level path to convert from. |
| const TFilePath &dest, //!< Level path to convert to. |
| const TFrameId &from, //!< First source frame to convert. |
| const TFrameId &to, //!< Last source frame to convert. |
| FrameTaskNotifier |
| *frameNotifier //!< Observer class for frame success notifications. |
| ); |
| |
| double DVAPI getQuantizedZoomFactor(double zf, bool forward); |
| |
| void DVAPI getFillingInformationOverlappingArea( |
| const TVectorImageP &vi, std::vector<TFilledRegionInf> ®s, |
| const TRectD &area1, const TRectD &area2 = TRectD()); |
| |
| void DVAPI getFillingInformationInArea(const TVectorImageP &vi, |
| std::vector<TFilledRegionInf> ®s, |
| const TRectD &area); |
| |
| void DVAPI assignFillingInformation(TVectorImage &vi, |
| const std::vector<TFilledRegionInf> ®s); |
| |
| void DVAPI getStrokeStyleInformationInArea( |
| const TVectorImageP &vi, |
| std::vector<std::pair<int, int>> |
| &strokesInfo, // pair:strokeIndex, styleIndex |
| const TRectD &area); |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI FullScreenWidget final : public QWidget { |
| Q_OBJECT |
| |
| QWidget *m_widget; |
| |
| public: |
| FullScreenWidget(QWidget *parent = 0); |
| |
| void setWidget( |
| QWidget *widget); |
| QWidget *widget() const { return m_widget; } |
| |
| public slots: |
| |
| bool toggleFullScreen(bool quit = false); |
| }; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class DVAPI ShortcutZoomer { |
| QWidget *m_widget; |
| |
| public: |
| ShortcutZoomer( |
| QWidget *viewerWidget); |
| |
| QWidget *getWidget() { |
| return m_widget; |
| } |
| |
| bool exec( |
| QKeyEvent *event); |
| |
| |
| protected: |
| virtual bool zoom( |
| bool zoomin, |
| bool resetView) = 0; |
| virtual bool fit() { |
| return false; |
| } |
| virtual bool setActualPixelSize() { |
| return false; |
| } |
| virtual bool setFlipX() { |
| return false; |
| } |
| virtual bool setFlipY() { |
| return false; |
| } |
| virtual bool resetZoom() { |
| return false; |
| } |
| virtual bool resetRotation() { |
| return false; |
| } |
| virtual bool resetPosition() { |
| return false; |
| } |
| virtual bool toggleFullScreen( |
| bool quit = false) |
| { |
| return false; |
| } |
| }; |
| |
| } |
| |
| #endif |