Changeset View
Changeset View
Standalone View
Standalone View
source/blender/sequencer/intern/render.c
| Show First 20 Lines • Show All 2,082 Lines • ▼ Show 20 Lines | void SEQ_render_thumbnails(const SeqRenderData *context, | ||||
| rctf *view_area, | rctf *view_area, | ||||
| const short *stop) | const short *stop) | ||||
| { | { | ||||
| SeqRenderState state; | SeqRenderState state; | ||||
| seq_render_state_init(&state); | seq_render_state_init(&state); | ||||
| /* Adding the hold offset value (seq->anim_startofs) to the start frame. Position of image not | /* Adding the hold offset value (seq->anim_startofs) to the start frame. Position of image not | ||||
| * affected, but frame loaded affected. */ | * affected, but frame loaded affected. */ | ||||
| float upper_thumb_bound = (seq->endstill) ? (seq->start + seq->len) : seq->enddisp; | float upper_thumb_bound = SEQ_time_has_right_still_frames(seq) ? (seq->start + seq->len) : | ||||
| seq->enddisp; | |||||
| upper_thumb_bound = (upper_thumb_bound > view_area->xmax) ? view_area->xmax + frame_step : | upper_thumb_bound = (upper_thumb_bound > view_area->xmax) ? view_area->xmax + frame_step : | ||||
| upper_thumb_bound; | upper_thumb_bound; | ||||
| float timeline_frame = SEQ_render_thumbnail_first_frame_get(seq, frame_step, view_area); | float timeline_frame = SEQ_render_thumbnail_first_frame_get(seq, frame_step, view_area); | ||||
| while ((timeline_frame < upper_thumb_bound) & !*stop) { | while ((timeline_frame < upper_thumb_bound) & !*stop) { | ||||
| ImBuf *ibuf = seq_cache_get( | ImBuf *ibuf = seq_cache_get( | ||||
| context, seq_orig, round_fl_to_int(timeline_frame), SEQ_CACHE_STORE_THUMBNAIL); | context, seq_orig, round_fl_to_int(timeline_frame), SEQ_CACHE_STORE_THUMBNAIL); | ||||
| if (ibuf) { | if (ibuf) { | ||||
| Show All 16 Lines | while ((timeline_frame < upper_thumb_bound) & !*stop) { | ||||
| } | } | ||||
| timeline_frame = SEQ_render_thumbnail_next_frame_get(seq, timeline_frame, frame_step); | timeline_frame = SEQ_render_thumbnail_next_frame_get(seq, timeline_frame, frame_step); | ||||
| } | } | ||||
| } | } | ||||
| int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Sequence *seq) | int SEQ_render_thumbnails_guaranteed_set_frame_step_get(const Sequence *seq) | ||||
| { | { | ||||
| const int content_len = (seq->enddisp - seq->startdisp - seq->startstill - seq->endstill); | const int content_start = max_ii(seq->startdisp, seq->start); | ||||
| const int content_end = min_ii(seq->enddisp, seq->start + seq->len); | |||||
| const int content_len = content_end - content_start; | |||||
| /* Arbitrary, but due to performance reasons should be as low as possible. */ | /* Arbitrary, but due to performance reasons should be as low as possible. */ | ||||
| const int thumbnails_base_set_count = min_ii(content_len / 100, 30); | const int thumbnails_base_set_count = min_ii(content_len / 100, 30); | ||||
| if (thumbnails_base_set_count <= 0) { | if (thumbnails_base_set_count <= 0) { | ||||
| return content_len; | return content_len; | ||||
| } | } | ||||
| return content_len / thumbnails_base_set_count; | return content_len / thumbnails_base_set_count; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines | |||||