23# include <sys/times.h>
81# include <devices/IHandle.h>
82# include <file/File.h>
93} g_audaspace = {
nullptr};
97#define USE_FRAME_CACHE_LIMIT
98#ifdef USE_FRAME_CACHE_LIMIT
99# define PLAY_FRAME_CACHE_MAX 30
124 char **r_error_message)
128 if (file == -1) [[unlikely]] {
129 *r_error_message =
BLI_sprintfN(
"failure '%s' to open file", strerror(errno));
133 bool success =
false;
134 uchar *mem =
nullptr;
137 if (size ==
size_t(-1)) [[unlikely]] {
138 *r_error_message =
BLI_sprintfN(
"failure '%s' to access size", strerror(errno));
143 else if (r_mem &&
UNLIKELY((size_read =
BLI_read(file, mem, size)) != size)) {
145 "error '%s' reading file "
160 MEM_SAFE_DELETE(mem);
171#define WS_QUAL_SHIFT (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)
174#define WS_QUAL_ALT (WS_QUAL_LALT | WS_QUAL_RALT)
179#define WS_QUAL_CTRL (WS_QUAL_LCTRL | WS_QUAL_RCTRL | WS_QUAL_LCMD | WS_QUAL_RCMD)
217 float ui_window_csd_alpha;
318 const int2 window_size = {
319 int(
bounds.getWidth() * native_pixel_size),
320 int(
bounds.getHeight() * native_pixel_size),
327 const bool use_window_csd,
332 if (cx >= 0 && cx < window_size[0] && cy >= 0 && cy <= window_size[1]) {
334 if (use_window_csd) {
340 window_size, fractional_scale,
state, csd_layout, csd_elems);
341 for (
int i = 0; i < csd_elems_num; i += 1) {
344 if (!((cx >= elem.
bounds[0][0] && cx <= elem.
bounds[0][1]) &&
363static int32_t wm_window_csd_layout_callback(
const int32_t window_size[2],
364 const int32_t fractional_scale[2],
370 window_size, fractional_scale,
char(window_state), csd_layout, csd_elems);
373static void playanim_window_csd_params_update(
GhostData &ghost_data)
375 GHOST_CSD_Params csd_params = {
376 wm_window_csd_layout_callback,
385 ghost_data.system->setWindowCSD(csd_params);
444#ifdef USE_FRAME_CACHE_LIMIT
472#ifdef USE_FRAME_CACHE_LIMIT
475 ListBaseT<LinkData>
pics;
541 if (pic->
ibuf && pic->
ibuf != ibuf_keep) {
551 ImBuf *ibuf =
nullptr;
556 else if (pic->
anim) {
575 while (
step-- && playanim) {
576 playanim = playanim->
next;
580 while (
step++ && playanim) {
581 playanim = playanim->
prev;
589 static double time_last;
624 r_texture_format = gpu::TextureFormat::SFLOAT_16_16_16_16;
627 r_texture_format = gpu::TextureFormat::SFLOAT_16_16_16;
630 r_texture_format = gpu::TextureFormat::SFLOAT_16;
636 r_texture_format = gpu::TextureFormat::UNORM_8_8_8_8;
643 const bool draw_flip[2])
654 display_ctx, ibuf, texture_format, data_format);
655 if (texture_data ==
nullptr) {
675 std::swap(preview.
xmin, preview.
xmax);
678 std::swap(preview.
ymin, preview.
ymax);
716 const bool show_status,
718 const int frame_step,
719 const float draw_zoom,
720 const bool draw_flip[2],
721 const float frame_indicator_factor)
738 float span_x = (draw_zoom * ibuf->
x) /
float(display_ctx.
size[0]);
739 float span_y = (draw_zoom * ibuf->
y) /
float(display_ctx.
size[1]);
742 float offs_x = 0.5f * (1.0f - span_x);
743 float offs_y = 0.5f * (1.0f - span_y);
745 CLAMP(offs_x, 0.0f, 1.0f);
746 CLAMP(offs_y, 0.0f, 1.0f);
756 float4{0.15, 0.15, 0.15, 1.0},
757 float4{0.20, 0.20, 0.20, 1.0},
770 if (show_status && (font_id != -1) && (picture !=
nullptr)) {
771 const int font_margin = int(10 * display_ctx.
ui_scale);
772 float fsizex_inv, fsizey_inv;
785 fsizex_inv = 1.0f / window_size[0];
786 fsizey_inv = 1.0f / window_size[1];
795 BLF_aspect(font_id, fsizex_inv, fsizey_inv, 1.0f);
796 BLF_position(font_id, font_margin * fsizex_inv, font_margin * fsizey_inv, 0.0f);
797 BLF_draw(font_id, label,
sizeof(label));
803 BLF_draw(font_id, label,
sizeof(label));
808 if (frame_indicator_factor != -1.0f) {
809 float fac = frame_indicator_factor;
810 fac = 2.0f * fac - 1.0f;
835 if (display_ctx.use_window_csd && (display_ctx.ui_window_csd_alpha > 0.0f)) {
843 const bool is_active =
true;
844 const int font_size = 11;
846 const uchar text_color[3] = {255, 255, 255};
857 display_ctx.ui_window_csd_alpha);
882 const bool show_status =
false;
883 const int font_id = -1;
884 const int frame_step = -1;
885 const float zoom = 1.0f;
886 const float frame_indicator_factor = -1.0f;
887 const bool draw_flip[2] = {
false,
false};
898 frame_indicator_factor);
903 float frame_indicator_factor = -1.0f;
905 const int frame_range = ps.
picsbase.last()->frame - ps.
picsbase.first()->frame;
906 if (frame_range > 0) {
907 frame_indicator_factor =
float(
double(picture->
frame) /
double(frame_range));
914 bool show_status =
false;
932 frame_indicator_factor);
938 const char *filepath_first,
939 const int frame_offset)
943 if (anim ==
nullptr) {
944 CLOG_WARN(&
LOG,
"couldn't open anim '%s'", filepath_first);
956 picture->
anim = anim;
957 picture->
frame = pic + frame_offset;
963 if (!(picture && picture->
anim == anim)) {
965 CLOG_WARN(&
LOG,
"no frames added for: '%s'", filepath_first);
972 const char *filepath_first,
973 const int frame_offset,
975 const int frame_step,
976 const bool *loading_p)
981#ifdef USE_FRAME_CACHE_LIMIT
995 STRNCPY(filepath, filepath_first);
998 sizeof(fp_decoded.head),
1000 sizeof(fp_decoded.tail),
1001 &fp_decoded.digits);
1006 for (
int pic = 0; pic < totframes; pic++) {
1011 bool has_error =
false;
1012 char *error_message =
nullptr;
1013 void *mem =
nullptr;
1016 filepath,
g_playanim.from_disk ?
nullptr : &mem, &size, &error_message))
1023 picture->
size = size;
1024 picture->
mem =
static_cast<uchar *
>(mem);
1027 picture->
frame = pic + frame_offset;
1032 const bool display_imbuf =
g_playanim.total_time > 1.0;
1036 "Picture %s failed: %s",
1038 error_message ? error_message :
"<unknown error>");
1040 else if (display_imbuf || fill_cache) {
1045 if (display_imbuf) {
1048#ifdef USE_FRAME_CACHE_LIMIT
1050 picture->
ibuf = ibuf;
1061 if (display_imbuf) {
1068 fp_framenr += frame_step;
1078 if (*loading_p ==
false) {
1088 const char *filepath_first,
1089 const int totframes,
1090 const int frame_step,
1100 const int frame_offset = picture_last ? (picture_last->
frame + 1) : 0;
1102 bool do_image_load =
false;
1106 if (picsbase.last_ == picture_last) {
1109 do_image_load =
true;
1113 do_image_load =
true;
1116 if (do_image_load) {
1132#ifdef WITH_AUDASPACE
1133 if (g_audaspace.playback_handle) {
1137 g_audaspace.playback_handle->setPitch(speed);
1158 const int i_last = ps.
picsbase.last()->frame;
1160 const int correct_rounding = (window_size[0] / (i_last + 1)) / 2;
1162 (i_last * (ps.
frame_cursor_x + correct_rounding)) / window_size[0], 0, i_last);
1164#ifdef WITH_AUDASPACE
1165 if (g_audaspace.scrub_handle) {
1166 g_audaspace.scrub_handle->stop();
1167 g_audaspace.scrub_handle =
nullptr;
1170 if (g_audaspace.playback_handle) {
1171 aud::Status status = g_audaspace.playback_handle->getStatus();
1172 if (status != aud::STATUS_PLAYING) {
1173 g_audaspace.playback_handle->stop();
1174 g_audaspace.playback_handle = bke::sound_device_play(g_audaspace.audio_device,
1175 g_audaspace.source);
1176 if (g_audaspace.playback_handle) {
1177 g_audaspace.playback_handle->seek(i /
g_playanim.fps_movie);
1178 g_audaspace.scrub_handle = bke::sound_pause_after(g_audaspace.playback_handle,
1184 g_audaspace.playback_handle->seek(i /
g_playanim.fps_movie);
1185 g_audaspace.scrub_handle = bke::sound_pause_after(g_audaspace.playback_handle,
1189 else if (g_audaspace.source) {
1190 g_audaspace.playback_handle = bke::sound_device_play(g_audaspace.audio_device,
1191 g_audaspace.source);
1192 if (g_audaspace.playback_handle) {
1193 g_audaspace.playback_handle->seek(i /
g_playanim.fps_movie);
1194 g_audaspace.scrub_handle = bke::sound_pause_after(g_audaspace.playback_handle,
1213#ifdef WITH_AUDASPACE
1216 if (g_audaspace.playback_handle) {
1217 g_audaspace.playback_handle->stop();
1219 g_audaspace.playback_handle = bke::sound_device_play(g_audaspace.audio_device,
1220 g_audaspace.source);
1221 if (g_audaspace.playback_handle) {
1222 g_audaspace.playback_handle->seek(i /
g_playanim.fps_movie);
1232#ifdef WITH_AUDASPACE
1233 if (g_audaspace.playback_handle) {
1234 g_audaspace.playback_handle->stop();
1235 g_audaspace.playback_handle =
nullptr;
1260 switch (key_data->
key) {
1288 switch (key_data->
key) {
1444 printf(
" Name: %s | Speed: %.2f frames/s\n",
1545#ifdef WITH_GHOST_CSD
1546 const bool use_window_csd = ps.
display_ctx.use_window_csd;
1548 const bool use_window_csd =
false;
1555 ghost_window, use_window_csd, cx, cy);
1559 if (inside_window) {
1570 if (inside_window) {
1580 if (inside_window) {
1591#ifdef WITH_GHOST_CSD
1594 float &alpha = ps.
display_ctx.ui_window_csd_alpha;
1598 const int upper_y = window_size.y / 6;
1599 const int lower_y = window_size.y / 3;
1600 const int y = cd->
y;
1601 if ((
y > lower_y) ||
UNLIKELY(upper_y == lower_y)) {
1608 alpha = (lower_y -
y) /
float(lower_y - upper_y);
1627 if (cx != x_test || cy != y_test) {
1641#ifdef WITH_GHOST_CSD
1660 ps.
zoom = std::min(zoomx, zoomy);
1690 for (
int i = 0; i < stra->
count; i++) {
1707 GHOST_ISystem *ghost_system,
const char *title,
int posx,
int posy,
int sizex,
int sizey)
1719 bool screen_size_valid =
false;
1723 if (screen_size[0] > 0 && screen_size[1] > 0) {
1724 screen_size_valid =
true;
1729 screen_size[0] = 1024;
1730 screen_size[1] = 1024;
1733 if (screen_size_valid) {
1735 posy = (screen_size[1] - posy - sizey);
1751 while (sizex >=
int(screen_size[0]) || sizey >=
int(screen_size[1])) {
1769 if (ps.
zoom + zoom_offset > 0.0f) {
1770 ps.
zoom += zoom_offset;
1790 const float font_size_base = 11.0f;
1791 const int font_size = int((font_size_base *
scale) + 0.5f);
1792 bool changed =
false;
1810 ImBuf *ibuf =
nullptr;
1811 int2 window_pos = {0, 0};
1812 int frame_start = -1;
1842#ifdef WITH_GHOST_CSD
1853 while ((argc > 0) && (argv[0][0] ==
'-')) {
1854 switch (argv[0][1]) {
1861 window_pos[0] = atoi(argv[1]);
1862 window_pos[1] = atoi(argv[2]);
1867 printf(
"too few arguments for -p (need 2): skipping\n");
1873 double fps = atof(argv[1]);
1874 double fps_base = atof(argv[2]);
1877 printf(
"invalid fps, forcing 1\n");
1884 printf(
"too few arguments for -f (need 2): skipping\n");
1889 frame_start = atoi(argv[1]);
1896 frame_end = atoi(argv[1]);
1911#ifdef USE_FRAME_CACHE_LIMIT
1912 const int memory_in_mb =
max_ii(0, atoi(argv[1]));
1913 g_frame_cache.memory_limit = size_t(memory_in_mb) * (1024 * 1024);
1920 printf(
"unknown option '%c': skipping\n", argv[0][1]);
1928 const char *filepath =
nullptr;
1932 std::optional<int> exit_code = [&]() -> std::optional<int> {
1934 fprintf(stderr,
"%s: no filepath argument given\n",
message_prefix);
1935 return EXIT_FAILURE;
1954 fprintf(stderr,
"%s: '%s' not an image file\n",
message_prefix, filepath);
1955 return EXIT_FAILURE;
1958 if (ibuf ==
nullptr) {
1963 if (ibuf ==
nullptr) {
1964 fprintf(stderr,
"%s: '%s' couldn't open\n",
message_prefix, filepath);
1965 return EXIT_FAILURE;
1979 fprintf(stderr,
"%s: unable to initialize GHOST, exiting!\n",
message_prefix);
1980 return EXIT_FAILURE;
1983#ifdef WITH_GHOST_CSD
1987 playanim_window_csd_params_update(ps.
ghost_data);
2002 fprintf(stderr,
"%s: unable to create window, exiting!\n",
message_prefix);
2003 return EXIT_FAILURE;
2009 return std::nullopt;
2052 GPU_scissor(0, 0, window_size[0], window_size[1]);
2060 if (frame_start == -1 || frame_end == -1) {
2078 (frame_end - frame_start) + 1,
2082#ifdef WITH_AUDASPACE
2083 g_audaspace.source =
AUD_Sound(
new aud::File(filepath));
2094 for (
int i = 1; i < argc; i++) {
2100 (frame_end - frame_start) + 1,
2112#define USE_IMB_CACHE
2127 printf(
"couldn't find pictures\n");
2140#ifdef WITH_AUDASPACE
2141 if (g_audaspace.playback_handle) {
2142 g_audaspace.playback_handle->stop();
2144 g_audaspace.playback_handle = bke::sound_device_play(g_audaspace.audio_device,
2145 g_audaspace.source);
2151#ifndef USE_IMB_CACHE
2164#ifdef USE_FRAME_CACHE_LIMIT
2205 if (ps.
go ==
false) {
2248 if (ps.
go ==
false) {
2274#ifndef USE_IMB_CACHE
2280#ifdef USE_FRAME_CACHE_LIMIT
2286#ifdef WITH_AUDASPACE
2287 if (g_audaspace.playback_handle) {
2288 g_audaspace.playback_handle->stop();
2289 g_audaspace.playback_handle =
nullptr;
2291 if (g_audaspace.scrub_handle) {
2292 g_audaspace.scrub_handle->stop();
2293 g_audaspace.scrub_handle =
nullptr;
2295 g_audaspace.source.reset();
2315 delete ghost_event_consumer;
2325 return std::nullopt;
2328 return EXIT_SUCCESS;
2333#ifdef WITH_AUDASPACE
2335 aud::DeviceSpecs specs;
2337 specs.rate = aud::RATE_48000;
2338 specs.format = aud::FORMAT_FLOAT32;
2339 specs.channels = aud::CHANNELS_STEREO;
2341 bke::sound_system_initialize();
2343 if (!(g_audaspace.audio_device = bke::sound_device_init(
nullptr, specs, 1024,
"Blender"))) {
2344 g_audaspace.audio_device = bke::sound_device_init(
"None", specs, 0,
"Blender");
2349 std::optional<int> exit_code = std::nullopt;
2360 argc = args_next.
argc;
2361 argv =
const_cast<const char **
>(args_next.
argv);
2364 if (args_free.
argv) {
2365 for (
int i = 0; i < args_free.
argc; i++) {
2366 MEM_delete(args_free.
argv[i]);
2368 MEM_delete(args_free.
argv);
2370 }
while (argv !=
nullptr);
2374#ifdef WITH_AUDASPACE
2375 bke::sound_device_exit();
2376 g_audaspace.audio_device.reset();
2382 return exit_code.value();
std::shared_ptr< void > AUD_Sound
std::shared_ptr< void > AUD_Handle
std::shared_ptr< void > AUD_Device
File and directory operations.
#define SNPRINTF(dst, format,...)
#define STRNCPY_UTF8(dst, src)
Platform independent time functions.
#define CLOG_WARN(clg_ref,...)
void * GHOST_TUserDataPtr
const void * GHOST_TEventDataPtr
#define GHOST_CSD_DPI_FRACTIONAL_BASE
@ GHOST_kWindowStateMaximized
@ GHOST_kWindowStateNormal
@ GHOST_kEventWindowClose
@ GHOST_kEventDraggingDropDone
@ GHOST_kEventWindowActivate
@ GHOST_kEventWindowDeactivate
@ GHOST_kEventWindowDPIHintChanged
@ GHOST_kEventQuitRequest
@ GHOST_kCapabilityWindowDecorationServerSide
@ GHOST_kCapabilityWindowPosition
@ GHOST_kModifierKeyRightControl
@ GHOST_kModifierKeyLeftControl
@ GHOST_kModifierKeyRightAlt
@ GHOST_kModifierKeyRightShift
@ GHOST_kModifierKeyLeftAlt
@ GHOST_kModifierKeyLeftShift
@ GHOST_kModifierKeyLeftOS
@ GHOST_kModifierKeyRightOS
@ GHOST_gpuVSyncIsOverridden
@ GHOST_kDragnDropTypeFilenames
@ GHOST_kButtonMaskMiddle
#define GHOST_kCSDType_NUM
Read Blender memory allocation and freeing.
#define SET_FLAG_FROM_TEST(value, test, flag)
#define BLI_assert_msg(a, msg)
GHOST_CallbackEventConsumer(GHOST_EventCallbackProcPtr eventCallback, GHOST_TUserDataPtr user_data)
virtual GHOST_TEventType getType() const =0
virtual GHOST_TEventDataPtr getData() const =0
static GHOST_ISystem * getSystem()
static GHOST_TSuccess createSystem(bool verbose=true, bool background=false)
virtual GHOST_TSuccess getModifierKeyState(GHOST_TModifierKey mask, bool &is_down) const =0
static void setUseWindowFrame(bool use_window_frame)
static void setBacktraceFn(GHOST_TBacktraceFn backtrace_fn)
virtual void getMainDisplayDimensions(uint32_t &width, uint32_t &height) const =0
virtual GHOST_IWindow * createWindow(const char *title, int32_t left, int32_t top, uint32_t width, uint32_t height, GHOST_TWindowState state, GHOST_GPUSettings gpu_settings, const bool exclusive=false, const bool is_dialog=false, const GHOST_IWindow *parent_window=nullptr)=0
virtual GHOST_TSuccess addEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual bool useNativePixel()=0
static GHOST_TSuccess disposeSystem()
virtual void dispatchEvents()=0
virtual const GHOST_CSD_Layout & getWindowCSD_Layout() const =0
virtual GHOST_TCapabilityFlag getCapabilities() const =0
virtual GHOST_TSuccess getCursorPositionClientRelative(const GHOST_IWindow *window, int32_t &x, int32_t &y) const =0
virtual GHOST_TSuccess disposeWindow(GHOST_IWindow *window)=0
virtual GHOST_TSuccess removeEventConsumer(GHOST_IEventConsumer *consumer)=0
virtual bool processEvents(bool waitForEvent)=0
virtual void getClientBounds(GHOST_Rect &bounds) const =0
virtual GHOST_TSuccess activateDrawingContext()=0
virtual GHOST_TSuccess swapBufferRelease()=0
virtual GHOST_TSuccess setClientSize(uint32_t width, uint32_t height)=0
virtual float getNativePixelSize()=0
virtual GHOST_IContext * getDrawingContext()=0
virtual void screenToClient(int32_t inX, int32_t inY, int32_t &outX, int32_t &outY) const =0
virtual GHOST_TSuccess swapBufferAcquire()=0
virtual uint16_t getDPIHint()=0
virtual GHOST_TWindowState getState() const =0
VecBase< float, D > step(VecOp< float, D >, VecOp< float, D >) RET
TEX_TEMPLATE DataVec texture(T, FltCoord, float=0.0f) RET
float3x3 scale(float3x3 mat, float2 scale)
ENUM_OPERATORS(Layer::Flags)
void WM_window_csd_draw_titlebar_ex(const int win_size[2], const char win_state, const GHOST_CSD_Layout *csd_layout, const bool is_active, const uint16_t dpi, const char *title, const int font_id, const int font_size, const uchar border_color[3], const uchar text_color[3], const float alpha)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
unsigned __int64 uint64_t
static PlayAnimPict * playanim_step(PlayAnimPict *playanim, int step)
char * STRNCPY(char(&dst)[N], const char *src)
void GPU_texture_update(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
static const char * playanim_window_title
void BLF_aspect(int fontid, float x, float y, float z)
void BLF_position(int fontid, float x, float y, float z)
void * MEM_new_array_uninitialized(size_t len, size_t size, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1
void IMB_colormanagement_finish_glsl_draw()
void GPU_clear_color(float red, float green, float blue, float alpha)
void BLI_addhead(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int WM_window_csd_layout_callback(const int window_size[2], const int fractional_scale[2], const char window_state, const GHOST_CSD_Layout *csd_layout, GHOST_CSD_Elem *csd_elems)
GPUContext * GPU_context_create(GHOST_IWindow *ghost_window, GHOST_IContext *ghost_context)
static void draw_display_buffer(const PlayDisplayContext &display_ctx, const ImBuf *ibuf, const rctf *canvas, const bool draw_flip[2])
void BLI_time_sleep_ms(int ms)
static void update_sound_fps()
void GPU_matrix_identity_set()
void MOV_close(MovieReader *anim)
GPUVertFormat * immVertexFormat()
GPUBackendType GPU_backend_get_type()
void GPU_context_end_frame(GPUContext *ctx)
void GPU_render_step(bool force_resource_release=false)
int BLF_load_mono_default(bool unique)
void immBegin(GPUPrimType, uint vertex_len)
int64_t BLI_read(int fd, void *buf, size_t nbytes)
char * BLI_sprintfN(const char *__restrict format,...) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC ATTR_PRINTF_FORMAT(1
ImBuf * MOV_decode_frame(MovieReader *anim, int frame_index, IMB_Proxy_Size preview_size)
bool GPU_backend_type_selection_detect()
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, ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW, float opacity=1.0f)
static void build_pict_list_from_anim(ListBaseT< PlayAnimPict > &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int frame_offset)
static void playanim_toscreen(PlayState &ps, const PlayAnimPict *picture, const ImBuf *ibuf)
void imm_draw_box_checker_2d_ex(float x1, float y1, float x2, float y2, const float color_primary[4], const float color_secondary[4], int checker_size)
BLI_INLINE bool BLI_listbase_is_empty(const ListBase *lb)
void GPU_matrix_identity_projection_set()
MINLINE int max_ii(int a, int b)
@ COLOR_ROLE_DEFAULT_BYTE
int GPU_backend_vsync_get()
void GPU_context_active_set(GPUContext *)
int BLI_open(const char *filepath, int oflag, int pmode) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
void immAttr2f(uint attr_id, float x, float y)
void BLF_color4f(int fontid, float r, float g, float b, float a)
void GPU_context_begin_frame(GPUContext *ctx)
size_t IMB_get_size_in_memory(const ImBuf *ibuf)
void GPU_matrix_scale_2f(float x, float y)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
VecBase< float, 4 > float4
bool MOV_is_movie_file(const char *filepath)
static std::optional< int > wm_main_playanim_intern(int argc, const char **argv, PlayArgs *args_next)
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
static int2 playanim_window_size_get(GHOST_IWindow *ghost_window)
static void build_pict_list(ListBaseT< PlayAnimPict > &picsbase, GhostData &ghost_data, const PlayDisplayContext &display_ctx, const char *filepath_first, const int totframes, const int frame_step, bool *loading_p)
ImBuf * IMB_load_image_from_filepath(const char *filepath, ImBufFlags flags, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
static ImBuf * ibuf_from_picture(PlayAnimPict *pic)
void * BLI_findlink(const ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
int BLI_findindex(const ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void BLF_size(int fontid, float size)
MovieReader * MOV_open_file(const char *filepath, const ImBufFlags ib_flags, const int streamindex, const bool keep_original_colorspace, ColorManagedColorspaceSettings *colorspace_settings)
static void playanim_toscreen_ex(GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, const ImBuf *ibuf, const bool show_status, const int font_id, const int frame_step, const float draw_zoom, const bool draw_flip[2], const float frame_indicator_factor)
void IMB_freeImBuf(ImBuf *ibuf)
VecBase< int32_t, 2 > int2
void * MEM_new_zeroed(size_t len, const char *str) ATTR_WARN_UNUSED_RESULT ATTR_ALLOC_SIZE(1) ATTR_NONNULL(2)
void immVertex2f(uint attr_id, float x, float y)
@ GPU_TEXTURE_USAGE_SHADER_READ
GPUBackendType GPU_backend_type_selection_get()
void BLI_remlink(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
BMesh const char void * data
static void frame_cache_add(PlayAnimPict *pic)
static const char * message_prefix
@ GPU_SHADER_3D_UNIFORM_COLOR
void GPU_texture_filter_mode(gpu::Texture *texture, bool use_filter)
void BLI_freelinkN(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
LinkData * BLI_genericNodeN(void *data)
void immUniformColor3ub(unsigned char r, unsigned char g, unsigned char b)
void BKE_blender_atexit()
static const void * setup_draw_ocio_transform(const PlayDisplayContext &display_ctx, const ImBuf *ibuf, gpu::TextureFormat &r_texture_format, eGPUDataFormat &r_data_format)
void GPU_matrix_translate_2f(float x, float y)
void BLF_draw(int fontid, const char *str, size_t str_len, ResultBLF *r_info=nullptr) ATTR_NONNULL(2)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void IMB_colormanagement_init_untonemapped_view_settings(ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings)
bool WM_init_window_frame_get()
static void frame_cache_limit_apply(ImBuf *ibuf_keep)
static bool playanim_window_contains_point(GHOST_IWindow *ghost_window, const bool use_window_csd, const int32_t cx, const int32_t cy)
static bool ghost_event_proc(const GHOST_IEvent *ghost_event, GHOST_TUserDataPtr ps_void_ptr)
void GPU_scissor(int x, int y, int width, int height)
void BLI_system_backtrace(FILE *fp)
ImBuf * IMB_load_image_from_memory(const unsigned char *mem, size_t size, ImBufFlags flags, const char *descr, const char *filepath=nullptr, ColorManagedColorspaceSettings *colorspace_settings=nullptr)
static void playanim_gpu_matrix()
void BLI_addtail(ListBase *listbase, void *vlink) ATTR_NONNULL(1)
char * BLI_strdup(const char *str) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1) ATTR_MALLOC
void GPU_matrix_pop_projection()
static void playanim_audio_stop(PlayState &)
static void playanim_event_qual_update(GhostData &ghost_data)
GHOST_TDrawingContextType wm_ghost_drawing_context_type(const GPUBackendType gpu_backend)
void GPU_texture_bind(gpu::Texture *texture, int unit)
static struct blender::@313270353156307301103354366216022061050065355272 g_playanim
void GPU_texture_free(gpu::Texture *texture)
static void playanim_audio_resume(PlayState &ps)
void GPU_viewport(int x, int y, int width, int height)
float MOV_get_fps(const MovieReader *anim)
bool GPU_backend_vsync_is_overridden()
bool IMB_test_image(const char *filepath)
void GPU_matrix_ortho_set(float left, float right, float bottom, float top, float near, float far)
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)
static void build_pict_list_from_image_sequence(ListBaseT< PlayAnimPict > &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_window_zoom(PlayState &ps, const float zoom_offset)
void BLI_path_sequence_encode(char *path, size_t path_maxncpy, const char *head, const char *tail, unsigned short numlen, int pic)
size_t BLI_file_descriptor_size(int file) ATTR_WARN_UNUSED_RESULT
static void frame_cache_touch(PlayAnimPict *pic)
double BLI_time_now_seconds()
static void frame_cache_remove(PlayAnimPict *pic)
void GPU_backend_ghost_system_set(GHOST_ISystem *ghost_system_handle)
void GPU_texture_unbind(gpu::Texture *texture)
static bool playanim_window_font_scale_from_dpi(PlayState &ps)
static void playanim_change_frame_tag(PlayState &ps, int cx)
static bool buffer_from_filepath(const char *filepath, void **r_mem, size_t *r_size, char **r_error_message)
GHOST_GPUDevice GPU_backend_preferred_device_get()
void GPU_blend(GPUBlend blend)
static GHOST_IWindow * playanim_window_open(GHOST_ISystem *ghost_system, const char *title, int posx, int posy, int sizex, int sizey)
int MOV_get_duration_frames(const MovieReader *anim)
static int pupdate_time()
static bool frame_cache_limit_exceeded()
void GPU_matrix_push_projection()
MINLINE int clamp_i(int value, int min, int max)
static struct blender::@052266112127172122142261357116237105236273151356 g_frame_cache
static void playanim_toscreen_on_load(GhostData &ghost_data, const PlayDisplayContext &display_ctx, const PlayAnimPict *picture, const ImBuf *ibuf)
void BLF_enable(int fontid, FontFlags flag)
gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
GPUContext * GPU_context_active_get()
ocio::ColorSpace ColorSpace
void GPU_context_discard(GPUContext *)
void BLI_rctf_init(struct rctf *rect, float xmin, float xmax, float ymin, float ymax)
int WM_main_playanim(int argc, const char **argv)
static void playanim_change_frame(PlayState &ps)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
GHOST_TDrawingContextType context_type
GHOST_GPUDevice preferred_device
GHOST_TDragnDropTypes dataType
GHOST_TDragnDropDataPtr data
const ColorSpace * colorspace
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
const uint8_t * byte_data() const
const float * float_data() const
bool can_contain_alpha() const
LinkData * frame_cache_node
ColorManagedViewSettings view_settings
ColorManagedDisplaySettings display_settings
bool show_frame_indicator
ListBaseT< PlayAnimPict > picsbase
PlayDisplayContext display_ctx
size_t pics_size_in_memory
ListBaseT< LinkData > pics
#define PLAY_FRAME_CACHE_MAX
#define WM_WINDOW_CSD_RESIZE_MARGIN_SIZE