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
115 char **r_error_message)
120 *r_error_message =
BLI_sprintfN(
"failure '%s' to open file", strerror(errno));
124 bool success =
false;
125 uchar *mem =
nullptr;
129 *r_error_message =
BLI_sprintfN(
"failure '%s' to access size", strerror(errno));
136 "error '%s' reading file "
162#define WS_QUAL_SHIFT (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)
165#define WS_QUAL_ALT (WS_QUAL_LALT | WS_QUAL_RALT)
168#define WS_QUAL_CTRL (WS_QUAL_LCTRL | WS_QUAL_RCTRL)
354#ifdef USE_FRAME_CACHE_LIMIT
382#ifdef USE_FRAME_CACHE_LIMIT
451 if (pic->
ibuf && pic->
ibuf != ibuf_keep) {
461 ImBuf *ibuf =
nullptr;
466 else if (pic->
anim) {
485 while (
step-- && playanim) {
486 playanim = playanim->
next;
490 while (
step++ && playanim) {
491 playanim = playanim->
prev;
499 static double time_last;
513 void **r_buffer_cache_handle)
515 void *display_buffer;
516 bool force_fallback =
false;
517 *r_glsl_used =
false;
519 force_fallback |= (ibuf->
dither != 0.0f);
522 *r_format = blender::gpu::TextureFormat::UNORM_8_8_8_8;
526 if (force_fallback) {
527 *r_glsl_used =
false;
528 display_buffer =
nullptr;
535 *r_format = blender::gpu::TextureFormat::SFLOAT_16_16_16_16;
539 *r_format = blender::gpu::TextureFormat::SFLOAT_16_16_16;
565 display_buffer =
nullptr;
573 *r_format = blender::gpu::TextureFormat::UNORM_8_8_8_8;
577 return display_buffer;
583 const bool draw_flip[2])
589 bool glsl_used =
false;
593 imm_format,
"texCoord", blender::gpu::VertAttrType::SFLOAT_32_32);
595 void *buffer_cache_handle =
nullptr;
597 display_ctx, ibuf, &glsl_used, &
format, &
data, &buffer_cache_handle);
621 std::swap(preview.
xmin, preview.
xmax);
624 std::swap(preview.
ymin, preview.
ymax);
653 if (buffer_cache_handle) {
671 const int frame_step,
672 const float draw_zoom,
673 const bool draw_flip[2],
674 const float frame_indicator_factor)
691 float span_x = (draw_zoom * ibuf->
x) /
float(display_ctx.
size[0]);
692 float span_y = (draw_zoom * ibuf->
y) /
float(display_ctx.
size[1]);
695 float offs_x = 0.5f * (1.0f - span_x);
696 float offs_y = 0.5f * (1.0f - span_y);
698 CLAMP(offs_x, 0.0f, 1.0f);
699 CLAMP(offs_y, 0.0f, 1.0f);
714 BLI_rctf_init(&canvas, offs_x, offs_x + span_x, offs_y, offs_y + span_y);
723 if ((font_id != -1) && picture) {
724 const int font_margin = int(10 * display_ctx.
ui_scale);
725 float fsizex_inv, fsizey_inv;
738 fsizex_inv = 1.0f / window_size[0];
739 fsizey_inv = 1.0f / window_size[1];
748 BLF_aspect(font_id, fsizex_inv, fsizey_inv, 1.0f);
749 BLF_position(font_id, font_margin * fsizex_inv, font_margin * fsizey_inv, 0.0f);
750 BLF_draw(font_id, label,
sizeof(label));
756 BLF_draw(font_id, label,
sizeof(label));
761 if (frame_indicator_factor != -1.0f) {
762 float fac = frame_indicator_factor;
763 fac = 2.0f * fac - 1.0f;
802 const int font_id = -1;
803 const int frame_step = -1;
804 const float zoom = 1.0f;
805 const float frame_indicator_factor = -1.0f;
806 const bool draw_flip[2] = {
false,
false};
816 frame_indicator_factor);
821 float frame_indicator_factor = -1.0f;
825 if (frame_range > 0) {
826 frame_indicator_factor =
float(
double(picture->
frame) /
double(frame_range));
830 "Multiple frames without a valid range!");
851 frame_indicator_factor);
857 const char *filepath_first,
858 const int frame_offset)
862 if (anim ==
nullptr) {
863 CLOG_WARN(&
LOG,
"couldn't open anim '%s'", filepath_first);
875 picture->
anim = anim;
876 picture->
frame = pic + frame_offset;
883 if (!(picture && picture->
anim == anim)) {
885 CLOG_WARN(&
LOG,
"no frames added for: '%s'", filepath_first);
892 const char *filepath_first,
893 const int frame_offset,
895 const int frame_step,
896 const bool *loading_p)
901#ifdef USE_FRAME_CACHE_LIMIT
915 STRNCPY(filepath, filepath_first);
918 sizeof(fp_decoded.head),
920 sizeof(fp_decoded.tail),
926 for (
int pic = 0; pic < totframes; pic++) {
931 bool has_error =
false;
932 char *error_message =
nullptr;
936 filepath,
g_playanim.from_disk ?
nullptr : &mem, &
size, &error_message))
945 picture->
mem =
static_cast<uchar *
>(mem);
948 picture->
frame = pic + frame_offset;
953 const bool display_imbuf =
g_playanim.total_time > 1.0;
957 "Picture %s failed: %s",
959 error_message ? error_message :
"<unknown error>");
961 else if (display_imbuf || fill_cache) {
969#ifdef USE_FRAME_CACHE_LIMIT
971 picture->
ibuf = ibuf;
989 fp_framenr += frame_step;
999 if (*loading_p ==
false) {
1009 const char *filepath_first,
1010 const int totframes,
1011 const int frame_step,
1021 const int frame_offset = picture_last ? (picture_last->
frame + 1) : 0;
1023 bool do_image_load =
false;
1027 if (picsbase.
last == picture_last) {
1030 do_image_load =
true;
1034 do_image_load =
true;
1037 if (do_image_load) {
1053#ifdef WITH_AUDASPACE
1054 if (g_audaspace.playback_handle) {
1058 AUD_Handle_setPitch(g_audaspace.playback_handle, speed);
1081 const int correct_rounding = (window_size[0] / (i_last + 1)) / 2;
1083 (i_last * (ps.
frame_cursor_x + correct_rounding)) / window_size[0], 0, i_last);
1085#ifdef WITH_AUDASPACE
1086 if (g_audaspace.scrub_handle) {
1087 AUD_Handle_stop(g_audaspace.scrub_handle);
1088 g_audaspace.scrub_handle =
nullptr;
1091 if (g_audaspace.playback_handle) {
1092 AUD_Status
status = AUD_Handle_getStatus(g_audaspace.playback_handle);
1093 if (
status != AUD_STATUS_PLAYING) {
1094 AUD_Handle_stop(g_audaspace.playback_handle);
1095 g_audaspace.playback_handle = AUD_Device_play(
1096 g_audaspace.audio_device, g_audaspace.source, 1);
1097 if (g_audaspace.playback_handle) {
1098 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1099 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1105 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1106 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1110 else if (g_audaspace.source) {
1111 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1112 if (g_audaspace.playback_handle) {
1113 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1114 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1133#ifdef WITH_AUDASPACE
1136 if (g_audaspace.playback_handle) {
1137 AUD_Handle_stop(g_audaspace.playback_handle);
1139 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1140 if (g_audaspace.playback_handle) {
1141 AUD_Handle_setPosition(g_audaspace.playback_handle,
i /
g_playanim.fps_movie);
1151#ifdef WITH_AUDASPACE
1152 if (g_audaspace.playback_handle) {
1153 AUD_Handle_stop(g_audaspace.playback_handle);
1154 g_audaspace.playback_handle =
nullptr;
1179 switch (key_data->
key) {
1207 switch (key_data->
key) {
1363 printf(
" Name: %s | Speed: %.2f frames/s\n",
1470 (cx >= 0 && cx < window_size[0] && cy >= 0 &&
1471 cy <= window_size[1]);
1475 if (inside_window) {
1486 if (inside_window) {
1496 if (inside_window) {
1519 if (cx != x_test || cy != y_test) {
1546 ps.
zoom = std::min(zoomx, zoomy);
1576 for (
int i = 0;
i < stra->
count;
i++) {
1593 GHOST_SystemHandle
ghost_system,
const char *title,
int posx,
int posy,
int sizex,
int sizey)
1607 bool screen_size_valid =
false;
1608 uint32_t screen_size[2];
1611 (screen_size[0] > 0) && (screen_size[1] > 0))
1613 screen_size_valid =
true;
1618 screen_size[0] = 1024;
1619 screen_size[1] = 1024;
1622 if (screen_size_valid) {
1624 posy = (screen_size[1] - posy - sizey);
1640 while (sizex >=
int(screen_size[0]) || sizey >=
int(screen_size[1])) {
1667 if (ps.
zoom + zoom_offset > 0.0f) {
1668 ps.
zoom += zoom_offset;
1687 const float font_size_base = 11.0f;
1688 const int font_size = int((font_size_base * scale) + 0.5f);
1689 bool changed =
false;
1707 ImBuf *ibuf =
nullptr;
1709 int frame_start = -1;
1745 while ((argc > 0) && (argv[0][0] ==
'-')) {
1746 switch (argv[0][1]) {
1753 window_pos[0] = atoi(argv[1]);
1754 window_pos[1] = atoi(argv[2]);
1759 printf(
"too few arguments for -p (need 2): skipping\n");
1765 double fps = atof(argv[1]);
1766 double fps_base = atof(argv[2]);
1769 printf(
"invalid fps, forcing 1\n");
1776 printf(
"too few arguments for -f (need 2): skipping\n");
1781 frame_start = atoi(argv[1]);
1788 frame_end = atoi(argv[1]);
1803#ifdef USE_FRAME_CACHE_LIMIT
1804 const int memory_in_mb =
max_ii(0, atoi(argv[1]));
1805 g_frame_cache.memory_limit = size_t(memory_in_mb) * (1024 * 1024);
1812 printf(
"unknown option '%c': skipping\n", argv[0][1]);
1820 const char *filepath =
nullptr;
1821 GHOST_EventConsumerHandle ghost_event_consumer =
nullptr;
1824 std::optional<int> exit_code = [&]() -> std::optional<int> {
1826 fprintf(stderr,
"%s: no filepath argument given\n",
message_prefix);
1827 return EXIT_FAILURE;
1846 fprintf(stderr,
"%s: '%s' not an image file\n",
message_prefix, filepath);
1847 return EXIT_FAILURE;
1850 if (ibuf ==
nullptr) {
1855 if (ibuf ==
nullptr) {
1856 fprintf(stderr,
"%s: '%s' couldn't open\n",
message_prefix, filepath);
1857 return EXIT_FAILURE;
1870 fprintf(stderr,
"%s: unable to initialize GHOST, exiting!\n",
message_prefix);
1871 return EXIT_FAILURE;
1879 "Blender Animation Player",
1886 fprintf(stderr,
"%s: unable to create window, exiting!\n",
message_prefix);
1887 return EXIT_FAILURE;
1893 return std::nullopt;
1935 GPU_scissor(0, 0, window_size[0], window_size[1]);
1943 if (frame_start == -1 || frame_end == -1) {
1961 (frame_end - frame_start) + 1,
1965#ifdef WITH_AUDASPACE
1966 g_audaspace.source = AUD_Sound_file(filepath);
1977 for (
int i = 1;
i < argc;
i++) {
1983 (frame_end - frame_start) + 1,
1995#define USE_IMB_CACHE
2010 printf(
"couldn't find pictures\n");
2023#ifdef WITH_AUDASPACE
2024 if (g_audaspace.playback_handle) {
2025 AUD_Handle_stop(g_audaspace.playback_handle);
2027 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
2033#ifndef USE_IMB_CACHE
2046#ifdef USE_FRAME_CACHE_LIMIT
2087 if (ps.
go ==
false) {
2130 if (ps.
go ==
false) {
2156#ifndef USE_IMB_CACHE
2162#ifdef USE_FRAME_CACHE_LIMIT
2168#ifdef WITH_AUDASPACE
2169 if (g_audaspace.playback_handle) {
2170 AUD_Handle_stop(g_audaspace.playback_handle);
2171 g_audaspace.playback_handle =
nullptr;
2173 if (g_audaspace.scrub_handle) {
2174 AUD_Handle_stop(g_audaspace.scrub_handle);
2175 g_audaspace.scrub_handle =
nullptr;
2177 AUD_Sound_free(g_audaspace.source);
2178 g_audaspace.source =
nullptr;
2208 return std::nullopt;
2211 return EXIT_SUCCESS;
2216#ifdef WITH_AUDASPACE
2218 AUD_DeviceSpecs specs;
2220 specs.rate = AUD_RATE_48000;
2221 specs.format = AUD_FORMAT_FLOAT32;
2222 specs.channels = AUD_CHANNELS_STEREO;
2226 if (!(g_audaspace.audio_device = AUD_init(
nullptr, specs, 1024,
"Blender"))) {
2227 g_audaspace.audio_device = AUD_init(
"None", specs, 0,
"Blender");
2232 std::optional<int> exit_code = std::nullopt;
2243 argc = args_next.
argc;
2244 argv =
const_cast<const char **
>(args_next.
argv);
2247 if (args_free.
argv) {
2248 for (
int i = 0;
i < args_free.
argc;
i++) {
2253 }
while (argv !=
nullptr);
2257#ifdef WITH_AUDASPACE
2258 AUD_exit(g_audaspace.audio_device);
2265 return exit_code.value();
int ED_draw_imbuf_method(const ImBuf *ibuf)
void BKE_blender_atexit()
void BLF_size(int fontid, float size)
void BLF_enable(int fontid, FontFlags flag)
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_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)
#define STRNCPY_UTF8(dst, 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,...)
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_SwapWindowBufferRelease(GHOST_WindowHandle windowhandle)
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)
GHOST_TSuccess GHOST_SwapWindowBufferAcquire(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_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)
float GHOST_GetNativePixelSize(GHOST_WindowHandle windowhandle)
GHOST_TEventType GHOST_GetEventType(GHOST_EventHandle eventhandle)
bool GHOST_UseNativePixels(void)
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 gpu_settings)
void GHOST_DispatchEvents(GHOST_SystemHandle systemhandle)
void GHOST_UseWindowFrame(bool use_window_frame)
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
@ GHOST_gpuVSyncIsOverridden
void(* GHOST_TBacktraceFn)(void *file_handle)
@ GHOST_kDragnDropTypeFilenames
@ GHOST_kButtonMaskMiddle
bool GPU_backend_vsync_is_overridden()
int GPU_backend_vsync_get()
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()
void GPU_context_discard(GPUContext *)
bool GPU_backend_type_selection_detect()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_context_active_set(GPUContext *)
GPUBackendType GPU_backend_get_type()
void GPU_backend_ghost_system_set(void *ghost_system_handle)
GPUBackendType GPU_backend_type_selection_get()
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(GPUBlend 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_unbind(blender::gpu::Texture *texture)
@ GPU_TEXTURE_USAGE_SHADER_READ
blender::gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, blender::gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
void GPU_texture_filter_mode(blender::gpu::Texture *texture, bool use_filter)
void GPU_texture_bind(blender::gpu::Texture *texture, int unit)
void GPU_texture_free(blender::gpu::Texture *texture)
void GPU_texture_update(blender::gpu::Texture *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)
@ 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()
void IMB_colormanagement_init_untonemapped_view_settings(ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
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)
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) 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)
void MOV_close(MovieReader *anim)
int MOV_get_duration_frames(MovieReader *anim, IMB_Timecode_Type tc)
MovieReader * MOV_open_file(const char *filepath, const int ib_flags, const int streamindex, const bool keep_original_colorspace, char colorspace[IM_MAX_SPACE])
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 const char * message_prefix
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)
static void frame_cache_remove(PlayAnimPict *pic)
static struct @353253306317277323035105337375312051226160241145 g_frame_cache
static std::optional< int > wm_main_playanim_intern(int argc, const char **argv, PlayArgs *args_next)
static struct @110333101231117362165207356317070002324214002213 g_playanim
static void frame_cache_touch(PlayAnimPict *pic)
int WM_main_playanim(int argc, const char **argv)
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)
#define PLAY_FRAME_CACHE_MAX
static void * ocio_transform_ibuf(const PlayDisplayContext &display_ctx, ImBuf *ibuf, bool *r_glsl_used, blender::gpu::TextureFormat *r_format, eGPUDataFormat *r_data, void **r_buffer_cache_handle)
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 GPUBackendType gpu_backend)
bool WM_init_window_frame_get()