23# include <sys/times.h>
75# include <AUD_Device.h>
76# include <AUD_Handle.h>
77# include <AUD_Sound.h>
78# include <AUD_Special.h>
82 AUD_Handle *playback_handle;
83 AUD_Handle *scrub_handle;
84 AUD_Device *audio_device;
85} g_audaspace = {
nullptr};
89#define USE_FRAME_CACHE_LIMIT
90#ifdef USE_FRAME_CACHE_LIMIT
91# define PLAY_FRAME_CACHE_MAX 30
112 char **r_error_message)
117 *r_error_message =
BLI_sprintfN(
"failure '%s' to open file", strerror(errno));
121 bool success =
false;
122 uchar *mem =
nullptr;
126 *r_error_message =
BLI_sprintfN(
"failure '%s' to access size", strerror(errno));
133 "error '%s' reading file "
159#define WS_QUAL_SHIFT (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)
162#define WS_QUAL_ALT (WS_QUAL_LALT | WS_QUAL_RALT)
165#define WS_QUAL_CTRL (WS_QUAL_LCTRL | WS_QUAL_RCTRL)
351#ifdef USE_FRAME_CACHE_LIMIT
379#ifdef USE_FRAME_CACHE_LIMIT
448 if (pic->
ibuf && pic->
ibuf != ibuf_keep) {
458 ImBuf *ibuf =
nullptr;
463 else if (pic->
anim) {
482 while (
step-- && playanim) {
483 playanim = playanim->
next;
487 while (
step++ && playanim) {
488 playanim = playanim->
prev;
496 static double time_last;
510 void **r_buffer_cache_handle)
512 void *display_buffer;
513 bool force_fallback =
false;
514 *r_glsl_used =
false;
516 force_fallback |= (ibuf->
dither != 0.0f);
523 if (force_fallback) {
524 *r_glsl_used =
false;
525 display_buffer =
nullptr;
562 display_buffer =
nullptr;
574 return display_buffer;
580 const bool draw_flip[2])
586 bool glsl_used =
false;
592 void *buffer_cache_handle =
nullptr;
594 display_ctx, ibuf, &glsl_used, &
format, &
data, &buffer_cache_handle);
618 std::swap(preview.
xmin, preview.
xmax);
621 std::swap(preview.
ymin, preview.
ymax);
650 if (buffer_cache_handle) {
668 const int frame_step,
669 const float draw_zoom,
670 const bool draw_flip[2],
671 const float frame_indicator_factor)
686 float span_x = (draw_zoom * ibuf->
x) /
float(display_ctx.
size[0]);
687 float span_y = (draw_zoom * ibuf->
y) /
float(display_ctx.
size[1]);
690 float offs_x = 0.5f * (1.0f - span_x);
691 float offs_y = 0.5f * (1.0f - span_y);
693 CLAMP(offs_x, 0.0f, 1.0f);
694 CLAMP(offs_y, 0.0f, 1.0f);
709 BLI_rctf_init(&canvas, offs_x, offs_x + span_x, offs_y, offs_y + span_y);
718 if ((font_id != -1) && picture) {
719 const int font_margin = int(10 * display_ctx.
ui_scale);
720 float fsizex_inv, fsizey_inv;
733 fsizex_inv = 1.0f / window_size[0];
734 fsizey_inv = 1.0f / window_size[1];
743 BLF_aspect(font_id, fsizex_inv, fsizey_inv, 1.0f);
744 BLF_position(font_id, font_margin * fsizex_inv, font_margin * fsizey_inv, 0.0f);
745 BLF_draw(font_id, label,
sizeof(label));
751 BLF_draw(font_id, label,
sizeof(label));
756 if (frame_indicator_factor != -1.0f) {
757 float fac = frame_indicator_factor;
758 fac = 2.0f * fac - 1.0f;
796 const int font_id = -1;
797 const int frame_step = -1;
798 const float zoom = 1.0f;
799 const float frame_indicator_factor = -1.0f;
800 const bool draw_flip[2] = {
false,
false};
810 frame_indicator_factor);
815 float frame_indicator_factor = -1.0f;
819 if (frame_range > 0) {
820 frame_indicator_factor = float(
double(picture->
frame) /
double(frame_range));
824 "Multiple frames without a valid range!");
845 frame_indicator_factor);
851 const char *filepath_first,
852 const int frame_offset)
856 if (anim ==
nullptr) {
857 CLOG_WARN(&
LOG,
"couldn't open anim '%s'", filepath_first);
869 picture->
anim = anim;
870 picture->
frame = pic + frame_offset;
877 if (!(picture && picture->
anim == anim)) {
879 CLOG_WARN(&
LOG,
"no frames added for: '%s'", filepath_first);
886 const char *filepath_first,
887 const int frame_offset,
889 const int frame_step,
890 const bool *loading_p)
895#ifdef USE_FRAME_CACHE_LIMIT
909 STRNCPY(filepath, filepath_first);
912 sizeof(fp_decoded.head),
914 sizeof(fp_decoded.tail),
920 for (
int pic = 0; pic < totframes; pic++) {
925 bool has_error =
false;
926 char *error_message =
nullptr;
930 filepath,
g_playanim.from_disk ?
nullptr : &mem, &
size, &error_message))
939 picture->
mem =
static_cast<uchar *
>(mem);
942 picture->
frame = pic + frame_offset;
947 const bool display_imbuf =
g_playanim.total_time > 1.0;
951 "Picture %s failed: %s",
953 error_message ? error_message :
"<unknown error>");
955 else if (display_imbuf || fill_cache) {
963#ifdef USE_FRAME_CACHE_LIMIT
965 picture->
ibuf = ibuf;
983 fp_framenr += frame_step;
993 if (*loading_p ==
false) {
1003 const char *filepath_first,
1004 const int totframes,
1005 const int frame_step,
1015 const int frame_offset = picture_last ? (picture_last->
frame + 1) : 0;
1017 bool do_image_load =
false;
1021 if (picsbase.
last == picture_last) {
1024 do_image_load =
true;
1028 do_image_load =
true;
1031 if (do_image_load) {
1047#ifdef WITH_AUDASPACE
1048 if (g_audaspace.playback_handle) {
1052 AUD_Handle_setPitch(g_audaspace.playback_handle, speed);
1075 const int correct_rounding = (window_size[0] / (i_last + 1)) / 2;
1077 (i_last * (ps.
frame_cursor_x + correct_rounding)) / window_size[0], 0, i_last);
1079#ifdef WITH_AUDASPACE
1080 if (g_audaspace.scrub_handle) {
1081 AUD_Handle_stop(g_audaspace.scrub_handle);
1082 g_audaspace.scrub_handle =
nullptr;
1085 if (g_audaspace.playback_handle) {
1086 AUD_Status status = AUD_Handle_getStatus(g_audaspace.playback_handle);
1087 if (status != AUD_STATUS_PLAYING) {
1088 AUD_Handle_stop(g_audaspace.playback_handle);
1089 g_audaspace.playback_handle = AUD_Device_play(
1090 g_audaspace.audio_device, g_audaspace.source, 1);
1091 if (g_audaspace.playback_handle) {
1092 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1093 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1099 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1100 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1104 else if (g_audaspace.source) {
1105 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1106 if (g_audaspace.playback_handle) {
1107 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1108 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1127#ifdef WITH_AUDASPACE
1130 if (g_audaspace.playback_handle) {
1131 AUD_Handle_stop(g_audaspace.playback_handle);
1133 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1134 if (g_audaspace.playback_handle) {
1135 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1145#ifdef WITH_AUDASPACE
1146 if (g_audaspace.playback_handle) {
1147 AUD_Handle_stop(g_audaspace.playback_handle);
1148 g_audaspace.playback_handle =
nullptr;
1173 switch (key_data->
key) {
1201 switch (key_data->
key) {
1357 printf(
" Name: %s | Speed: %.2f frames/s\n",
1464 (cx >= 0 && cx < window_size[0] && cy >= 0 &&
1465 cy <= window_size[1]);
1469 if (inside_window) {
1480 if (inside_window) {
1490 if (inside_window) {
1513 if (cx != x_test || cy != y_test) {
1540 ps.
zoom = std::min(zoomx, zoomy);
1570 for (
int i = 0;
i < stra->
count;
i++) {
1587 GHOST_SystemHandle
ghost_system,
const char *title,
int posx,
int posy,
int sizex,
int sizey)
1597 bool screen_size_valid =
false;
1598 uint32_t screen_size[2];
1601 (screen_size[0] > 0) && (screen_size[1] > 0))
1603 screen_size_valid =
true;
1608 screen_size[0] = 1024;
1609 screen_size[1] = 1024;
1612 if (screen_size_valid) {
1614 posy = (screen_size[1] - posy - sizey);
1630 while (sizex >=
int(screen_size[0]) || sizey >=
int(screen_size[1])) {
1657 if (ps.
zoom + zoom_offset > 0.0f) {
1658 ps.
zoom += zoom_offset;
1677 const float font_size_base = 11.0f;
1678 const int font_size = int((font_size_base * scale) + 0.5f);
1679 bool changed =
false;
1697 ImBuf *ibuf =
nullptr;
1699 int frame_start = -1;
1735 while ((argc > 0) && (argv[0][0] ==
'-')) {
1736 switch (argv[0][1]) {
1743 window_pos[0] = atoi(argv[1]);
1744 window_pos[1] = atoi(argv[2]);
1749 printf(
"too few arguments for -p (need 2): skipping\n");
1755 double fps = atof(argv[1]);
1756 double fps_base = atof(argv[2]);
1759 printf(
"invalid fps, forcing 1\n");
1766 printf(
"too few arguments for -f (need 2): skipping\n");
1771 frame_start = atoi(argv[1]);
1778 frame_end = atoi(argv[1]);
1793#ifdef USE_FRAME_CACHE_LIMIT
1794 const int memory_in_mb =
max_ii(0, atoi(argv[1]));
1795 g_frame_cache.memory_limit = size_t(memory_in_mb) * (1024 * 1024);
1802 printf(
"unknown option '%c': skipping\n", argv[0][1]);
1811 printf(
"%s: no filepath argument given\n", __func__);
1815 const char *filepath = argv[0];
1827 printf(
"%s: '%s' not an image file\n", __func__, filepath);
1831 if (ibuf ==
nullptr) {
1836 if (ibuf ==
nullptr) {
1837 printf(
"%s: '%s' couldn't open\n", __func__, filepath);
1845 GHOST_EventConsumerHandle ghost_event_consumer =
nullptr;
1856 CLOG_WARN(&
LOG,
"GHOST: unable to initialize, exiting!");
1866 "Blender Animation Player",
1898 GPU_scissor(0, 0, window_size[0], window_size[1]);
1906 if (frame_start == -1 || frame_end == -1) {
1924 (frame_end - frame_start) + 1,
1928#ifdef WITH_AUDASPACE
1929 g_audaspace.source = AUD_Sound_file(filepath);
1940 for (
int i = 1;
i < argc;
i++) {
1946 (frame_end - frame_start) + 1,
1958#define USE_IMB_CACHE
1973 printf(
"couldn't find pictures\n");
1986#ifdef WITH_AUDASPACE
1987 if (g_audaspace.playback_handle) {
1988 AUD_Handle_stop(g_audaspace.playback_handle);
1990 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1996#ifndef USE_IMB_CACHE
2009#ifdef USE_FRAME_CACHE_LIMIT
2050 if (ps.
go ==
false) {
2093 if (ps.
go ==
false) {
2119#ifndef USE_IMB_CACHE
2125#ifdef USE_FRAME_CACHE_LIMIT
2131#ifdef WITH_AUDASPACE
2132 if (g_audaspace.playback_handle) {
2133 AUD_Handle_stop(g_audaspace.playback_handle);
2134 g_audaspace.playback_handle =
nullptr;
2136 if (g_audaspace.scrub_handle) {
2137 AUD_Handle_stop(g_audaspace.scrub_handle);
2138 g_audaspace.scrub_handle =
nullptr;
2140 AUD_Sound_free(g_audaspace.source);
2141 g_audaspace.source =
nullptr;
2190#ifdef WITH_AUDASPACE
2192 AUD_DeviceSpecs specs;
2194 specs.rate = AUD_RATE_48000;
2195 specs.format = AUD_FORMAT_FLOAT32;
2196 specs.channels = AUD_CHANNELS_STEREO;
2200 if (!(g_audaspace.audio_device = AUD_init(
nullptr, specs, 1024,
"Blender"))) {
2201 g_audaspace.audio_device = AUD_init(
"None", specs, 0,
"Blender");
2212 argc = args_next.
argc;
2213 argv =
const_cast<const char **
>(args_next.
argv);
2220 if (args_free.
argv) {
2221 for (
int i = 0;
i < args_free.
argc;
i++) {
2226 }
while (argv !=
nullptr);
2228#ifdef WITH_AUDASPACE
2229 AUD_exit(g_audaspace.audio_device);
int ED_draw_imbuf_method(const ImBuf *ibuf)
void BLF_size(int fontid, float size)
void BLF_aspect(int fontid, float x, float y, float z)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
int BLF_load_mono_default(bool unique)
void BLF_enable(int fontid, int option)
void BLF_color4f(int fontid, float r, float g, float b, float a)
void BLF_position(int fontid, float x, float y, float z)
#define BLI_assert_msg(a, msg)
File and directory operations.
size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
int64_t BLI_read(int fd, void *buf, size_t nbytes)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
LinkData * BLI_genericNodeN(void *data)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void void BLI_freelistN(ListBase *listbase) ATTR_NONNULL(1)
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const ListBase *lb)
MINLINE int max_ii(int a, int b)
MINLINE int clamp_i(int value, int min, int max)
int BLI_path_sequence_decode(const char *path, char *head, size_t head_maxncpy, char *tail, size_t tail_maxncpy, unsigned short *r_digits_len)
void BLI_path_sequence_encode(char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
#define SNPRINTF(dst, format,...)
char * STRNCPY(char(&dst)[N], const char *src)
void BLI_system_backtrace(FILE *fp)
Platform independent time functions.
void BLI_time_sleep_ms(int ms)
double BLI_time_now_seconds(void)
#define ENUM_OPERATORS(_type, _max)
#define SET_FLAG_FROM_TEST(value, test, flag)
#define CLOG_WARN(clg_ref,...)
void DEG_free_node_types()
GHOST C-API function and type declarations.
int32_t GHOST_GetWidthRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_GetCursorPosition(const GHOST_SystemHandle systemhandle, const GHOST_WindowHandle windowhandle, int32_t *x, int32_t *y)
GHOST_TSuccess GHOST_SetClientSize(GHOST_WindowHandle windowhandle, uint32_t width, uint32_t height)
GHOST_TCapabilityFlag GHOST_GetCapabilities(void)
GHOST_EventConsumerHandle GHOST_CreateEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr user_data)
GHOST_SystemHandle GHOST_CreateSystem(void)
GHOST_TSuccess GHOST_AddEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
GHOST_TSuccess GHOST_RemoveEventConsumer(GHOST_SystemHandle systemhandle, GHOST_EventConsumerHandle consumerhandle)
uint16_t GHOST_GetDPIHint(GHOST_WindowHandle windowhandle)
void GHOST_DisposeRectangle(GHOST_RectangleHandle rectanglehandle)
bool GHOST_ProcessEvents(GHOST_SystemHandle systemhandle, bool waitForEvent)
void GHOST_ScreenToClient(GHOST_WindowHandle windowhandle, int32_t inX, int32_t inY, int32_t *outX, int32_t *outY)
GHOST_TSuccess GHOST_DisposeEventConsumer(GHOST_EventConsumerHandle consumerhandle)
GHOST_TSuccess GHOST_DisposeWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle windowhandle)
void GHOST_SetBacktraceHandler(GHOST_TBacktraceFn backtrace_fn)
int32_t GHOST_GetHeightRectangle(GHOST_RectangleHandle rectanglehandle)
GHOST_TSuccess GHOST_SwapWindowBuffers(GHOST_WindowHandle windowhandle)
GHOST_TEventDataPtr GHOST_GetEventData(GHOST_EventHandle eventhandle)
GHOST_TSuccess GHOST_ActivateWindowDrawingContext(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_GetModifierKeyState(GHOST_SystemHandle systemhandle, GHOST_TModifierKey mask, bool *r_is_down)
GHOST_WindowHandle GHOST_CreateWindow(GHOST_SystemHandle systemhandle, GHOST_WindowHandle parent_windowhandle, const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, bool is_dialog, GHOST_GPUSettings gpuSettings)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
bool GHOST_UseNativePixels(void)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
GHOST_RectangleHandle GHOST_GetClientBounds(GHOST_WindowHandle windowhandle)
GHOST_TSuccess GHOST_DisposeSystem(GHOST_SystemHandle systemhandle)
GHOST_TSuccess GHOST_GetMainDisplayDimensions(GHOST_SystemHandle systemhandle, uint32_t *r_width, uint32_t *r_height)
static GHOST_SystemCocoa * ghost_system
@ GHOST_kWindowStateNormal
void * GHOST_TUserDataPtr
@ GHOST_kEventWindowClose
@ GHOST_kEventDraggingDropDone
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowDeactivate
@ GHOST_kEventWindowDPIHintChanged
@ GHOST_kEventQuitRequest
@ GHOST_kCapabilityWindowPosition
const void * GHOST_TEventDataPtr
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
void(* GHOST_TBacktraceFn)(void *file_handle)
@ GHOST_kDragnDropTypeFilenames
@ GHOST_kButtonMaskMiddle
void GPU_render_step(bool force_resource_release=false)
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
void GPU_context_begin_frame(GPUContext *ctx)
GPUContext * GPU_context_active_get()
eGPUBackendType GPU_backend_type_selection_get()
void GPU_context_discard(GPUContext *)
bool GPU_backend_type_selection_detect()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_context_active_set(GPUContext *)
eGPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
void GPU_clear_color(float red, float green, float blue, float alpha)
void GPU_matrix_identity_projection_set()
void GPU_matrix_ortho_set(float left, float right, float bottom, float top, float near, float far)
void GPU_matrix_identity_set()
void GPU_matrix_scale_2f(float x, float y)
void GPU_matrix_push_projection()
void GPU_matrix_pop_projection()
void GPU_matrix_translate_2f(float x, float y)
@ GPU_SHADER_3D_UNIFORM_COLOR
@ GPU_SHADER_3D_IMAGE_COLOR
void GPU_blend(eGPUBlend blend)
void GPU_scissor(int x, int y, int width, int height)
void GPU_viewport(int x, int y, int width, int height)
void GPU_texture_bind(GPUTexture *texture, int unit)
GPUTexture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, eGPUTextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_free(GPUTexture *texture)
void GPU_texture_unbind(GPUTexture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
void GPU_texture_filter_mode(GPUTexture *texture, bool use_filter)
void GPU_texture_update(GPUTexture *texture, eGPUDataFormat data_format, const void *data)
unsigned char * IMB_display_buffer_acquire(ImBuf *ibuf, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, void **cache_handle)
bool IMB_colormanagement_setup_glsl_draw(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float dither, bool predivide)
void IMB_colormanagement_init_default_view_settings(ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
@ COLOR_ROLE_DEFAULT_BYTE
void IMB_display_buffer_release(void *cache_handle)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
void IMB_colormanagement_finish_glsl_draw()
bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, const ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge)
ImBuf * IMB_load_image_from_filepath(const char *filepath, const int flags, char r_colorspace[IM_MAX_SPACE]=nullptr)
ImBuf * IMB_load_image_from_memory(const unsigned char *mem, const size_t size, const int flags, const char *descr, const char *filepath=nullptr, char r_colorspace[IM_MAX_SPACE]=nullptr)
void IMB_freeImBuf(ImBuf *ibuf)
bool IMB_test_image(const char *filepath)
size_t IMB_get_size_in_memory(const ImBuf *ibuf)
Read Guarded memory(de)allocation.
BMesh const char void * data
unsigned long long int uint64_t
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
void * MEM_callocN(size_t len, const char *str)
void * MEM_malloc_arrayN(size_t len, size_t size, const char *str)
void MEM_freeN(void *vmemh)
uint(* MEM_get_memory_blocks_in_use)(void)
void(* MEM_printmemlist)(void)
void MOV_close(MovieReader *anim)
MovieReader * MOV_open_file(const char *filepath, int ib_flags, int streamindex, char colorspace[IM_MAX_SPACE])
int MOV_get_duration_frames(MovieReader *anim, IMB_Timecode_Type tc)
float MOV_get_fps(const MovieReader *anim)
ImBuf * MOV_decode_frame(MovieReader *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
bool MOV_is_movie_file(const char *filepath)
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
GHOST_TDrawingContextType context_type
GHOST_GPUDevice preferred_device
GHOST_TDragnDropTypes dataType
GHOST_TDragnDropDataPtr data
GHOST_SystemHandle system
GHOST_WindowHandle window
const ColorSpace * colorspace
const ColorSpace * colorspace
char filepath[IMB_FILEPATH_SIZE]
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
LinkData * frame_cache_node
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
bool show_frame_indicator
PlayDisplayContext display_ctx
struct PlayAnimPict * picture
static blender::int2 playanim_window_size_get(GHOST_WindowHandle ghost_window)
static void playanim_audio_stop(PlayState &)
static void build_pict_list_from_image_sequence(ListBase &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int frame_offset, const int totframes, const int frame_step, const bool *loading_p)
static void playanim_audio_resume(PlayState &ps)
static PlayAnimPict * playanim_step(PlayAnimPict *playanim, int step)
static bool playanim_window_font_scale_from_dpi(PlayState &ps)
void WM_main_playanim(int argc, const char **argv)
static void frame_cache_remove(PlayAnimPict *pic)
static bool wm_main_playanim_intern(int argc, const char **argv, PlayArgs *args_next)
static void * ocio_transform_ibuf(const PlayDisplayContext &display_ctx, ImBuf *ibuf, bool *r_glsl_used, eGPUTextureFormat *r_format, eGPUDataFormat *r_data, void **r_buffer_cache_handle)
static void frame_cache_touch(PlayAnimPict *pic)
static void frame_cache_add(PlayAnimPict *pic)
static void playanim_toscreen_ex(GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, ImBuf *ibuf, const int font_id, const int frame_step, const float draw_zoom, const bool draw_flip[2], const float frame_indicator_factor)
static bool buffer_from_filepath(const char *filepath, void **r_mem, size_t *r_size, char **r_error_message)
static void playanim_event_qual_update(GhostData &ghost_data)
static void playanim_window_zoom(PlayState &ps, const float zoom_offset)
static int pupdate_time()
static void frame_cache_limit_apply(ImBuf *ibuf_keep)
size_t pics_size_in_memory
static void playanim_change_frame(PlayState &ps)
static void update_sound_fps()
static void playanim_gpu_matrix()
static void playanim_toscreen_on_load(GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, ImBuf *ibuf)
static void playanim_toscreen(PlayState &ps, const PlayAnimPict *picture, ImBuf *ibuf)
static void playanim_change_frame_tag(PlayState &ps, int cx)
static struct @161370212342345035160371143212324344103121037127 g_frame_cache
static struct @276346005071157122322051032253302206113261206111 g_playanim
#define PLAY_FRAME_CACHE_MAX
static GHOST_WindowHandle playanim_window_open(GHOST_SystemHandle ghost_system, const char *title, int posx, int posy, int sizex, int sizey)
static void draw_display_buffer(const PlayDisplayContext &display_ctx, ImBuf *ibuf, const rctf *canvas, const bool draw_flip[2])
static bool frame_cache_limit_exceeded()
static ImBuf * ibuf_from_picture(PlayAnimPict *pic)
static bool ghost_event_proc(GHOST_EventHandle ghost_event, GHOST_TUserDataPtr ps_void_ptr)
static void build_pict_list_from_anim(ListBase &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int frame_offset)
static void build_pict_list(ListBase &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int totframes, const int frame_step, bool *loading_p)
GHOST_TDrawingContextType wm_ghost_drawing_context_type(const eGPUBackendType gpu_backend)