mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
New function to get thumbnail of render view
This commit is contained in:
@@ -82,3 +82,25 @@ void RenderView::draw()
|
||||
frame_buffer_->end();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
FrameBufferImage *RenderView::thumbnail () const
|
||||
{
|
||||
FrameBufferImage *thumbnail = nullptr;
|
||||
|
||||
if (frame_buffer_) {
|
||||
FrameBufferSurface *thumb = new FrameBufferSurface(frame_buffer_);
|
||||
FrameBuffer *frame_thumbnail = new FrameBuffer( glm::vec3(SESSION_THUMBNAIL_HEIGHT * frame_buffer_->aspectRatio(), SESSION_THUMBNAIL_HEIGHT, 1.f) );
|
||||
|
||||
frame_thumbnail->begin();
|
||||
thumb->draw(glm::identity<glm::mat4>(), frame_thumbnail->projection());
|
||||
frame_thumbnail->end();
|
||||
|
||||
thumbnail = frame_thumbnail->image();
|
||||
|
||||
delete thumb;
|
||||
delete frame_thumbnail;
|
||||
}
|
||||
|
||||
return thumbnail;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ public:
|
||||
float fading() const;
|
||||
|
||||
inline FrameBuffer *frame () const { return frame_buffer_; }
|
||||
|
||||
FrameBufferImage *thumbnail () const;
|
||||
};
|
||||
|
||||
#endif // RENDERVIEW_H
|
||||
|
||||
@@ -59,6 +59,7 @@
|
||||
#define TRANSITION_MIN_DURATION 0.2f
|
||||
#define TRANSITION_MAX_DURATION 10.f
|
||||
#define ARROWS_MOVEMENT_FACTOR 4.f
|
||||
#define SESSION_THUMBNAIL_HEIGHT 120.f
|
||||
|
||||
#define IMGUI_TITLE_MAINWINDOW ICON_FA_CIRCLE_NOTCH " vimix"
|
||||
#define IMGUI_TITLE_MEDIAPLAYER ICON_FA_FILM " Player"
|
||||
|
||||
Reference in New Issue
Block a user