#ifndef DUST3D_APPLICATION_UV_MAP_GENERATOR_H_ #define DUST3D_APPLICATION_UV_MAP_GENERATOR_H_ #include "model_mesh.h" #include #include #include #include #include #include class UvMapGenerator : public QObject { Q_OBJECT public: UvMapGenerator(std::unique_ptr object, std::unique_ptr snapshot); void generate(); std::unique_ptr takeResultTextureColorImage(); std::unique_ptr takeResultTextureNormalImage(); std::unique_ptr takeResultTextureRoughnessImage(); std::unique_ptr takeResultTextureMetalnessImage(); std::unique_ptr takeResultTextureAmbientOcclusionImage(); std::unique_ptr takeResultMesh(); std::unique_ptr takeObject(); bool hasTransparencySettings() const; static QImage* combineMetalnessRoughnessAmbientOcclusionImages(QImage* metalnessImage, QImage* roughnessImage, QImage* ambientOcclusionImage); signals: void finished(); public slots: void process(); private: std::unique_ptr m_object; std::unique_ptr m_snapshot; std::unique_ptr m_mapPacker; std::unique_ptr m_textureColorImage; std::unique_ptr m_textureNormalImage; std::unique_ptr m_textureRoughnessImage; std::unique_ptr m_textureMetalnessImage; std::unique_ptr m_textureAmbientOcclusionImage; std::unique_ptr m_mesh; bool m_hasTransparencySettings = false; static size_t m_textureSize; void packUvs(); void generateTextureColorImage(); void generateUvCoords(); }; #endif