| #pragma once |
| |
| #ifndef IMAGE_BUILDERS_H |
| #define IMAGE_BUILDERS_H |
| |
| #include "tfilepath.h" |
| |
| #include "toonz/imagemanager.h" |
| |
| |
| |
| |
| |
| class TImageInfo; |
| class TXshSimpleLevel; |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| class ImageLoader final : public ImageBuilder { |
| public: |
| struct BuildExtData { |
| const TXshSimpleLevel *m_sl; |
| |
| TFrameId m_fid; |
| |
| int m_subs; |
| |
| |
| bool m_icon; |
| |
| public: |
| BuildExtData(const TXshSimpleLevel *sl, const TFrameId &fid, int subs = 0, |
| bool icon = false) |
| : m_sl(sl), m_fid(fid), m_subs(subs), m_icon(icon) {} |
| }; |
| |
| public: |
| ImageLoader(const TFilePath &path, const TFrameId &fid); |
| |
| bool isImageCompatible(int imFlags, void *extData) override; |
| |
| |
| |
| |
| void buildAllIconsAndPutInCache(TXshSimpleLevel *level, |
| std::vector<TFrameId> fids, |
| std::vector<std::string> iconIds, |
| bool cacheImagesAsWell) override; |
| |
| |
| |
| void setFid(const TFrameId &fid); |
| |
| protected: |
| bool getInfo(TImageInfo &info, int imFlags, void *extData) override; |
| TImageP build(int imFlags, void *extData) override; |
| |
| void invalidate() override; |
| |
| inline int buildSubsampling(int imFlags, BuildExtData *data); |
| |
| private: |
| TFilePath m_path; |
| TFrameId m_fid; |
| |
| bool m_64bitCompatible; |
| int m_subsampling; |
| |
| }; |
| |
| |
| |
| class ImageRasterizer final : public ImageBuilder { |
| public: |
| ImageRasterizer() {} |
| ~ImageRasterizer() {} |
| |
| bool isImageCompatible(int imFlags, void *extData) override { return true; } |
| |
| protected: |
| bool getInfo(TImageInfo &info, int imFlags, void *extData) override; |
| TImageP build(int imFlags, void *extData) override; |
| }; |
| |
| |
| |
| class ImageFiller final : public ImageBuilder { |
| public: |
| ImageFiller() {} |
| ~ImageFiller() {} |
| |
| bool isImageCompatible(int imFlags, void *extData) override { return true; } |
| |
| protected: |
| bool getInfo(TImageInfo &info, int imFlags, void *extData) override; |
| TImageP build(int imFlags, void *extData) override; |
| }; |
| |
| #endif |