/* ************************************************************************** */ /* */ /* ::: :::::::: */ /* Renderer.hpp :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: tomoron +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2025/01/22 16:29:26 by tomoron #+# #+# */ /* Updated: 2025/01/30 22:15:55 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ #ifndef RENDERER_HPP # define RENDERER_HPP # include "RT.hpp" extern "C" { #include #include #include #include #include } class Scene; class Window; class Shader; typedef struct s_pathPoint { glm::vec3 pos; glm::vec2 dir; double time; } t_pathPoint; class Renderer { public: Renderer(Scene *scene, Window *win); void renderImgui(void); void update(Shader &shader); int rendering(void) const; private: void addPoint(float time); void makeMovement(float timeFromStart, float curSplitTimeReset); void initRender(); void addImageToRender(Shader &shader); void endRender(void); void imguiPathCreation(void); void imguiRenderInfo(void); std::string floatToTime(float timef); glm::vec2 bezierSphereInterpolate(glm::vec4 control, glm::vec2 from, glm::vec2 to, float time); void updateAvailableCodecs(void); void fillGoodCodecList(std::vector &lst); glm::vec3 hermiteInterpolate(glm::vec3 points[4], double alpha); int _min; int _sec; int _samples; int _testSamples; bool _autoTime; int _fps; char _filenameBuffer[512]; std::vector _path; std::string _outputFilename; Scene *_scene; Window *_win; std::vector _codecList; std::vector _codecListStr; int _codecIndex; int _curPathIndex; int _destPathIndex; double _curSplitStart; int _curSamples; int _testMode; long int _frameCount; float _renderStartTime; AVFormatContext *_format; AVCodecContext *_codec_context; AVFrame *_rgb_frame; AVFrame *_yuv_frame; SwsContext *_sws_context; AVStream *_stream; AVDictionary *_codecOptions; }; #endif