23# include <sys/times.h>
70# include <AUD_Device.h>
71# include <AUD_Handle.h>
72# include <AUD_Sound.h>
73# include <AUD_Special.h>
77 AUD_Handle *playback_handle;
78 AUD_Handle *scrub_handle;
79 AUD_Device *audio_device;
80} g_audaspace = {
nullptr};
84#define USE_FRAME_CACHE_LIMIT
85#ifdef USE_FRAME_CACHE_LIMIT
86# define PLAY_FRAME_CACHE_MAX 30
107 char **r_error_message)
112 *r_error_message =
BLI_sprintfN(
"failure '%s' to open file", strerror(errno));
116 bool success =
false;
117 uchar *mem =
nullptr;
121 *r_error_message =
BLI_sprintfN(
"failure '%s' to access size", strerror(errno));
126 else if (r_mem &&
UNLIKELY((size_read =
BLI_read(file, mem, size)) != size)) {
128 "error '%s' reading file "
155#define WS_QUAL_SHIFT (WS_QUAL_LSHIFT | WS_QUAL_RSHIFT)
158#define WS_QUAL_ALT (WS_QUAL_LALT | WS_QUAL_RALT)
161#define WS_QUAL_CTRL (WS_QUAL_LCTRL | WS_QUAL_RCTRL)
347#ifdef USE_FRAME_CACHE_LIMIT
375#ifdef USE_FRAME_CACHE_LIMIT
444 if (pic->
ibuf && pic->
ibuf != ibuf_keep) {
454 ImBuf *ibuf =
nullptr;
459 else if (pic->
anim) {
477 while (step-- && playanim) {
478 playanim = playanim->
next;
482 while (step++ && playanim) {
483 playanim = playanim->
prev;
491 static double time_last;
505 void **r_buffer_cache_handle)
507 void *display_buffer;
508 bool force_fallback =
false;
509 *r_glsl_used =
false;
511 force_fallback |= (ibuf->
dither != 0.0f);
518 if (force_fallback) {
519 *r_glsl_used =
false;
520 display_buffer =
nullptr;
557 display_buffer =
nullptr;
569 return display_buffer;
575 const bool draw_flip[2])
581 bool glsl_used =
false;
587 void *buffer_cache_handle =
nullptr;
589 display_ctx, ibuf, &glsl_used, &
format, &data, &buffer_cache_handle);
613 std::swap(preview.
xmin, preview.
xmax);
616 std::swap(preview.
ymin, preview.
ymax);
645 if (buffer_cache_handle) {
663 const int frame_step,
664 const float draw_zoom,
665 const bool draw_flip[2],
666 const float frame_indicator_factor)
680 float span_x = (draw_zoom * ibuf->
x) /
float(display_ctx.
size[0]);
681 float span_y = (draw_zoom * ibuf->
y) /
float(display_ctx.
size[1]);
684 float offs_x = 0.5f * (1.0f - span_x);
685 float offs_y = 0.5f * (1.0f - span_y);
687 CLAMP(offs_x, 0.0f, 1.0f);
688 CLAMP(offs_y, 0.0f, 1.0f);
703 BLI_rctf_init(&canvas, offs_x, offs_x + span_x, offs_y, offs_y + span_y);
712 if ((font_id != -1) && picture) {
713 const int font_margin =
int(10 * display_ctx.
ui_scale);
714 float fsizex_inv, fsizey_inv;
727 fsizex_inv = 1.0f / window_size[0];
728 fsizey_inv = 1.0f / window_size[1];
737 BLF_aspect(font_id, fsizex_inv, fsizey_inv, 1.0f);
738 BLF_position(font_id, font_margin * fsizex_inv, font_margin * fsizey_inv, 0.0f);
750 if (frame_indicator_factor != -1.0f) {
751 float fac = frame_indicator_factor;
752 fac = 2.0f * fac - 1.0f;
789 const int font_id = -1;
790 const int frame_step = -1;
791 const float zoom = 1.0f;
792 const float frame_indicator_factor = -1.0f;
793 const bool draw_flip[2] = {
false,
false};
803 frame_indicator_factor);
808 float frame_indicator_factor = -1.0f;
812 if (frame_range > 0) {
813 frame_indicator_factor =
float(
double(picture->
frame) /
double(frame_range));
817 "Multiple frames without a valid range!");
838 frame_indicator_factor);
844 const char *filepath_first,
845 const int frame_offset)
849 if (anim ==
nullptr) {
850 CLOG_WARN(&
LOG,
"couldn't open anim '%s'", filepath_first);
862 picture->
anim = anim;
863 picture->
frame = pic + frame_offset;
870 if (!(picture && picture->
anim == anim)) {
872 CLOG_WARN(&
LOG,
"no frames added for: '%s'", filepath_first);
879 const char *filepath_first,
880 const int frame_offset,
882 const int frame_step,
883 const bool *loading_p)
888#ifdef USE_FRAME_CACHE_LIMIT
902 STRNCPY(filepath, filepath_first);
905 sizeof(fp_decoded.head),
907 sizeof(fp_decoded.tail),
913 for (
int pic = 0; pic < totframes; pic++) {
918 bool has_error =
false;
919 char *error_message =
nullptr;
923 filepath,
g_playanim.from_disk ?
nullptr : &mem, &
size, &error_message))
933 picture->
mem =
static_cast<uchar *
>(mem);
936 picture->
frame = pic + frame_offset;
941 const bool display_imbuf =
g_playanim.total_time > 1.0;
945 "Picture %s failed: %s",
947 error_message ? error_message :
"<unknown error>");
949 else if (display_imbuf || fill_cache) {
957#ifdef USE_FRAME_CACHE_LIMIT
959 picture->
ibuf = ibuf;
977 fp_framenr += frame_step;
987 if (*loading_p ==
false) {
997 const char *filepath_first,
999 const int frame_step,
1009 const int frame_offset = picture_last ? (picture_last->
frame + 1) : 0;
1011 bool do_image_load =
false;
1015 if (picsbase.
last == picture_last) {
1018 do_image_load =
true;
1022 do_image_load =
true;
1025 if (do_image_load) {
1041#ifdef WITH_AUDASPACE
1042 if (g_audaspace.playback_handle) {
1046 AUD_Handle_setPitch(g_audaspace.playback_handle, speed);
1069 const int correct_rounding = (window_size[0] / (i_last + 1)) / 2;
1071 (i_last * (ps.
frame_cursor_x + correct_rounding)) / window_size[0], 0, i_last);
1073#ifdef WITH_AUDASPACE
1074 if (g_audaspace.scrub_handle) {
1075 AUD_Handle_stop(g_audaspace.scrub_handle);
1076 g_audaspace.scrub_handle =
nullptr;
1079 if (g_audaspace.playback_handle) {
1080 AUD_Status status = AUD_Handle_getStatus(g_audaspace.playback_handle);
1081 if (status != AUD_STATUS_PLAYING) {
1082 AUD_Handle_stop(g_audaspace.playback_handle);
1083 g_audaspace.playback_handle = AUD_Device_play(
1084 g_audaspace.audio_device, g_audaspace.source, 1);
1085 if (g_audaspace.playback_handle) {
1086 AUD_Handle_setPosition(g_audaspace.playback_handle, i /
g_playanim.fps_movie);
1087 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1093 AUD_Handle_setPosition(g_audaspace.playback_handle, i /
g_playanim.fps_movie);
1094 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1098 else if (g_audaspace.source) {
1099 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1100 if (g_audaspace.playback_handle) {
1101 AUD_Handle_setPosition(g_audaspace.playback_handle, i /
g_playanim.fps_movie);
1102 g_audaspace.scrub_handle = AUD_pauseAfter(g_audaspace.playback_handle,
1121#ifdef WITH_AUDASPACE
1124 if (g_audaspace.playback_handle) {
1125 AUD_Handle_stop(g_audaspace.playback_handle);
1127 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1128 if (g_audaspace.playback_handle) {
1129 AUD_Handle_setPosition(g_audaspace.playback_handle, i /
g_playanim.fps_movie);
1139#ifdef WITH_AUDASPACE
1140 if (g_audaspace.playback_handle) {
1141 AUD_Handle_stop(g_audaspace.playback_handle);
1142 g_audaspace.playback_handle =
nullptr;
1167 switch (key_data->
key) {
1195 switch (key_data->
key) {
1351 printf(
" Name: %s | Speed: %.2f frames/s\n",
1458 (cx >= 0 && cx < window_size[0] && cy >= 0 &&
1459 cy <= window_size[1]);
1463 if (inside_window) {
1474 if (inside_window) {
1484 if (inside_window) {
1507 if (cx != x_test || cy != y_test) {
1534 ps.
zoom = std::min(zoomx, zoomy);
1564 for (
int i = 0; i < stra->
count; i++) {
1581 GHOST_SystemHandle
ghost_system,
const char *title,
int posx,
int posy,
int sizex,
int sizey)
1591 bool screen_size_valid =
false;
1595 (screen_size[0] > 0) && (screen_size[1] > 0))
1597 screen_size_valid =
true;
1602 screen_size[0] = 1024;
1603 screen_size[1] = 1024;
1606 if (screen_size_valid) {
1608 posy = (screen_size[1] - posy - sizey);
1624 while (sizex >=
int(screen_size[0]) || sizey >=
int(screen_size[1])) {
1651 if (ps.
zoom + zoom_offset > 0.0f) {
1652 ps.
zoom += zoom_offset;
1670 const float font_size_base = 11.0f;
1671 const int font_size =
int((font_size_base * scale) + 0.5f);
1672 bool changed =
false;
1690 ImBuf *ibuf =
nullptr;
1692 int frame_start = -1;
1698 ps.direction =
true;
1701 ps.pingpong =
false;
1702 ps.no_frame_skip =
false;
1703 ps.single_step =
false;
1707 ps.picture =
nullptr;
1708 ps.show_frame_indicator =
false;
1710 ps.argv_next =
nullptr;
1712 ps.draw_flip[0] =
false;
1713 ps.draw_flip[1] =
false;
1724 STRNCPY(ps.display_ctx.display_settings.display_device,
1727 &ps.display_ctx.display_settings);
1728 ps.display_ctx.ui_scale = 1.0f;
1730 while ((argc > 0) && (argv[0][0] ==
'-')) {
1731 switch (argv[0][1]) {
1738 window_pos[0] = atoi(argv[1]);
1739 window_pos[1] = atoi(argv[2]);
1744 printf(
"too few arguments for -p (need 2): skipping\n");
1750 double fps = atof(argv[1]);
1751 double fps_base = atof(argv[2]);
1754 printf(
"invalid fps, forcing 1\n");
1761 printf(
"too few arguments for -f (need 2): skipping\n");
1766 frame_start = atoi(argv[1]);
1773 frame_end = atoi(argv[1]);
1780 ps.frame_step = atoi(argv[1]);
1788#ifdef USE_FRAME_CACHE_LIMIT
1789 const int memory_in_mb =
max_ii(0, atoi(argv[1]));
1790 g_frame_cache.memory_limit = size_t(memory_in_mb) * (1024 * 1024);
1797 printf(
"unknown option '%c': skipping\n", argv[0][1]);
1806 printf(
"%s: no filepath argument given\n", __func__);
1810 const char *filepath = argv[0];
1822 printf(
"%s: '%s' not an image file\n", __func__, filepath);
1826 if (ibuf ==
nullptr) {
1831 if (ibuf ==
nullptr) {
1832 printf(
"%s: '%s' couldn't open\n", __func__, filepath);
1840 GHOST_EventConsumerHandle ghost_event_consumer =
nullptr;
1849 if (
UNLIKELY(ps.ghost_data.system ==
nullptr)) {
1851 CLOG_WARN(&
LOG,
"GHOST: unable to initialize, exiting!");
1861 "Blender Animation Player",
1881 ps.ibuf_size[0] = ibuf->
x;
1882 ps.ibuf_size[1] = ibuf->
y;
1884 ps.display_ctx.size = ps.ibuf_size;
1893 GPU_scissor(0, 0, window_size[0], window_size[1]);
1901 if (frame_start == -1 || frame_end == -1) {
1919 (frame_end - frame_start) + 1,
1923#ifdef WITH_AUDASPACE
1924 g_audaspace.source = AUD_Sound_file(filepath);
1929 float frs_sec_base = 1.0;
1940 for (
int i = 1; i < argc; i++) {
1946 (frame_end - frame_start) + 1,
1958#define USE_IMB_CACHE
1962 ps.direction = -ps.direction;
1965 if (ps.direction == 1) {
1966 ps.picture =
static_cast<PlayAnimPict *
>(ps.picsbase.first);
1969 ps.picture =
static_cast<PlayAnimPict *
>(ps.picsbase.last);
1972 if (ps.picture ==
nullptr) {
1973 printf(
"couldn't find pictures\n");
1977 if (ps.direction == 1) {
1978 ps.picture = ps.picture->next;
1981 ps.picture = ps.picture->prev;
1988#ifdef WITH_AUDASPACE
1989 if (g_audaspace.playback_handle) {
1990 AUD_Handle_stop(g_audaspace.playback_handle);
1992 g_audaspace.playback_handle = AUD_Device_play(g_audaspace.audio_device, g_audaspace.source, 1);
1996 while (ps.picture) {
1998#ifndef USE_IMB_CACHE
2008 ps.picture->ibuf = ibuf;
2011#ifdef USE_FRAME_CACHE_LIMIT
2012 if (ps.picture->frame_cache_node ==
nullptr) {
2032 if (ps.picture->next ==
nullptr) {
2035 else if (ps.picture->prev ==
nullptr) {
2040 ps.next_frame = ps.direction;
2051 if (ps.go ==
false) {
2062 ps.wait = ps.single_step;
2064 if (ps.wait ==
false && ps.stopped) {
2070 if (ps.picture && ps.next_frame) {
2073 while (ps.picture) {
2076 if (ps.once && ps.picture !=
nullptr) {
2077 if (ps.picture->next ==
nullptr) {
2080 else if (ps.picture->prev ==
nullptr) {
2090 if (ps.picture ==
nullptr && ps.single_step) {
2094 if (ps.go ==
false) {
2100 if (ps.picture->anim) {
2101 if ((ps.picture->next ==
nullptr) || (ps.picture->next->anim != ps.picture->anim)) {
2106 if (ps.picture->ibuf) {
2109 if (ps.picture->mem) {
2112 if (ps.picture->error_message) {
2113 MEM_freeN(
static_cast<void *
>(ps.picture->error_message));
2115 MEM_freeN(
const_cast<char *
>(ps.picture->filepath));
2120#ifndef USE_IMB_CACHE
2126#ifdef USE_FRAME_CACHE_LIMIT
2132#ifdef WITH_AUDASPACE
2133 if (g_audaspace.playback_handle) {
2134 AUD_Handle_stop(g_audaspace.playback_handle);
2135 g_audaspace.playback_handle =
nullptr;
2137 if (g_audaspace.scrub_handle) {
2138 AUD_Handle_stop(g_audaspace.scrub_handle);
2139 g_audaspace.scrub_handle =
nullptr;
2141 AUD_Sound_free(g_audaspace.source);
2142 g_audaspace.source =
nullptr;
2157 if (ps.ghost_data.gpu_context) {
2161 ps.ghost_data.gpu_context =
nullptr;
2170 args_next->
argc = ps.argc_next;
2171 args_next->
argv = ps.argv_next;
2191#ifdef WITH_AUDASPACE
2193 AUD_DeviceSpecs specs;
2195 specs.rate = AUD_RATE_48000;
2196 specs.format = AUD_FORMAT_FLOAT32;
2197 specs.channels = AUD_CHANNELS_STEREO;
2201 if (!(g_audaspace.audio_device = AUD_init(
nullptr, specs, 1024,
"Blender"))) {
2202 g_audaspace.audio_device = AUD_init(
"None", specs, 0,
"Blender");
2213 argc = args_next.
argc;
2214 argv =
const_cast<const char **
>(args_next.
argv);
2221 if (args_free.
argv) {
2222 for (
int i = 0; i < args_free.
argc; i++) {
2227 }
while (argv !=
nullptr);
2229#ifdef WITH_AUDASPACE
2230 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)
BLI_INLINE bool BLI_listbase_is_empty(const struct ListBase *lb)
void BLI_addhead(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_freelinkN(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void * BLI_findlink(const struct ListBase *listbase, int number) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
void void BLI_freelistN(struct ListBase *listbase) ATTR_NONNULL(1)
void void BLI_INLINE bool BLI_listbase_is_single(const struct ListBase *lb)
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
void BLI_remlink(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
int BLI_findindex(const struct ListBase *listbase, const void *vlink) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
struct LinkData * BLI_genericNodeN(void *data)
void * BLI_pophead(ListBase *listbase) ATTR_NONNULL(1)
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 STRNCPY(dst, src)
#define SNPRINTF(dst, format,...)
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)
typedef double(DMatrix)[4][4]
#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
GPUContext * GPU_context_create(void *ghost_window, void *ghost_context)
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_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)
void IMB_display_buffer_release(void *cache_handle)
const char * IMB_colormanagement_role_colorspace_name_get(int role)
void IMB_colormanagement_finish_glsl_draw()
@ COLOR_ROLE_DEFAULT_BYTE
bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge)
ImBuf * IMB_anim_absolute(ImBufAnim *anim, int position, IMB_Timecode_Type tc, IMB_Proxy_Size preview_size)
bool IMB_anim_get_fps(const ImBufAnim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
ImBuf * IMB_loadiffname(const char *filepath, int flags, char colorspace[IM_MAX_SPACE])
bool IMB_isanim(const char *filepath)
ImBufAnim * IMB_open_anim(const char *filepath, int ib_flags, int streamindex, char colorspace[IM_MAX_SPACE])
void IMB_close_anim(ImBufAnim *anim)
bool IMB_ispic(const char *filepath)
size_t IMB_get_size_in_memory(ImBuf *ibuf)
int IMB_anim_get_duration(ImBufAnim *anim, IMB_Timecode_Type tc)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
struct GPUContext GPUContext
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
static btDbvtVolume bounds(btDbvtNode **leaves, int count)
output_img define("CONVERT_EXPRESSION(value)", "value") .do_static_compilation(true)
draw_view in_light_buf[] float
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int
RAYTRACE_GROUP_SIZE additional_info("eevee_shared", "eevee_gbuffer_data", "eevee_global_ubo", "eevee_sampling_data", "eevee_utility_texture", "eevee_hiz_data", "draw_view") .specialization_constant(Type RAYTRACE_GROUP_SIZE in_sh_0_tx in_sh_2_tx screen_normal_tx GPU_RGBA8
struct ImBuf * IMB_ibImageFromMemory(const unsigned char *, size_t, int, char[IM_MAX_SPACE], const char *)
void IMB_freeImBuf(ImBuf *)
void *(* MEM_mallocN)(size_t len, const char *str)
void MEM_freeN(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
uint(* MEM_get_memory_blocks_in_use)(void)
void(* MEM_printmemlist)(void)
unsigned __int64 uint64_t
GHOST_TDrawingContextType context_type
GHOST_GPUDevice preferred_device
GHOST_TDragnDropTypes dataType
GHOST_TDragnDropDataPtr data
GHOST_SystemHandle system
GHOST_WindowHandle window
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 struct @1386 g_playanim
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 struct @1387 g_frame_cache
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 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)