Blender V4.3
clip_buttons.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#include <cstdio>
10#include <cstring>
11
12#include "MEM_guardedalloc.h"
13
14#include "DNA_scene_types.h"
15#include "DNA_screen_types.h"
16#include "DNA_space_types.h"
17
18#include "BLI_listbase.h"
19#include "BLI_math_vector.h"
20#include "BLI_path_utils.hh"
21#include "BLI_string.h"
22#include "BLI_utildefines.h"
23
24#include "BLT_translation.hh"
25
26#include "BKE_context.hh"
27#include "BKE_movieclip.h"
28#include "BKE_screen.hh"
29#include "BKE_tracking.h"
30
31#include "DEG_depsgraph.hh"
32
33#include "ED_clip.hh"
34#include "ED_screen.hh"
35
36#include "UI_interface.hh"
37#include "UI_resources.hh"
38
39#include "RNA_access.hh"
40
41#include "WM_api.hh"
42#include "WM_types.hh"
43
44#include "IMB_imbuf.hh"
45#include "IMB_imbuf_types.hh"
46
47#include "clip_intern.hh" /* own include */
48
49/* Panels */
50
51static bool metadata_panel_context_poll(const bContext *C, PanelType * /*pt*/)
52{
53 return ED_space_clip_poll((bContext *)C);
54}
55
56static void metadata_panel_context_draw(const bContext *C, Panel *panel)
57{
58 SpaceClip *space_clip = CTX_wm_space_clip(C);
59 /* NOTE: This might not be exactly the same image buffer as shown in the
60 * clip editor itself, since that might be coming from proxy, or being
61 * postprocessed (stabilized or undistorted).
62 * Ideally we need to query metadata from an original image or movie without
63 * reading actual pixels to speed up the process. */
64 ImBuf *ibuf = ED_space_clip_get_buffer(space_clip);
65 if (ibuf != nullptr) {
67 IMB_freeImBuf(ibuf);
68 }
69}
70
72{
73 PanelType *pt;
74
75 pt = MEM_cnew<PanelType>("spacetype clip panel metadata");
76 STRNCPY(pt->idname, "CLIP_PT_metadata");
77 STRNCPY(pt->label, N_("Metadata"));
78 STRNCPY(pt->category, "Footage");
83 BLI_addtail(&art->paneltypes, pt);
84}
85
86/********************* MovieClip Template ************************/
87
89 uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, bool compact)
90{
91 if (!ptr->data) {
92 return;
93 }
94
95 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
96 if (!prop) {
97 printf(
98 "%s: property not found: %s.%s\n", __func__, RNA_struct_identifier(ptr->type), propname);
99 return;
100 }
101
102 if (RNA_property_type(prop) != PROP_POINTER) {
103 printf("%s: expected pointer property for %s.%s\n",
104 __func__,
106 propname);
107 return;
108 }
109
110 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
111 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
112
113 uiLayoutSetContextPointer(layout, "edit_movieclip", &clipptr);
114
115 if (!compact) {
116 uiTemplateID(layout, C, ptr, propname, nullptr, "CLIP_OT_open", nullptr);
117 }
118
119 if (clip) {
120 uiLayout *row = uiLayoutRow(layout, false);
121 uiBlock *block = uiLayoutGetBlock(row);
122 uiDefBut(block, UI_BTYPE_LABEL, 0, IFACE_("File Path:"), 0, 19, 145, 19, nullptr, 0, 0, "");
123
124 row = uiLayoutRow(layout, false);
125 uiLayout *split = uiLayoutSplit(row, 0.0f, false);
126 row = uiLayoutRow(split, true);
127
128 uiItemR(row, &clipptr, "filepath", UI_ITEM_NONE, "", ICON_NONE);
129 uiItemO(row, "", ICON_FILE_REFRESH, "clip.reload");
130
131 uiLayout *col = uiLayoutColumn(layout, false);
132 uiTemplateColorspaceSettings(col, &clipptr, "colorspace_settings");
133 }
134}
135
136/********************* Track Template ************************/
137
138void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
139{
140 if (!ptr->data) {
141 return;
142 }
143
144 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
145 if (!prop) {
146 printf(
147 "%s: property not found: %s.%s\n", __func__, RNA_struct_identifier(ptr->type), propname);
148 return;
149 }
150
151 if (RNA_property_type(prop) != PROP_POINTER) {
152 printf("%s: expected pointer property for %s.%s\n",
153 __func__,
155 propname);
156 return;
157 }
158
159 PointerRNA scopesptr = RNA_property_pointer_get(ptr, prop);
160 MovieClipScopes *scopes = (MovieClipScopes *)scopesptr.data;
161
162 if (scopes->track_preview_height < UI_UNIT_Y) {
164 }
165 else if (scopes->track_preview_height > UI_UNIT_Y * 20) {
166 scopes->track_preview_height = UI_UNIT_Y * 20;
167 }
168
169 uiLayout *col = uiLayoutColumn(layout, true);
170 uiBlock *block = uiLayoutGetBlock(col);
171
172 uiDefBut(block,
174 0,
175 "",
176 0,
177 0,
178 UI_UNIT_X * 10,
179 scopes->track_preview_height,
180 scopes,
181 0,
182 0,
183 "");
184
185 /* Resize grip. */
186 uiDefIconButI(block,
188 0,
189 ICON_GRIP,
190 0,
191 0,
192 UI_UNIT_X * 10,
193 short(UI_UNIT_Y * 0.8f),
194 &scopes->track_preview_height,
195 UI_UNIT_Y,
196 UI_UNIT_Y * 20.0f,
197 "");
198}
199
200/********************* Marker Template ************************/
201
202#define B_MARKER_POS 3
203#define B_MARKER_OFFSET 4
204#define B_MARKER_PAT_DIM 5
205#define B_MARKER_SEARCH_POS 6
206#define B_MARKER_SEARCH_DIM 7
207#define B_MARKER_FLAG 8
208
232
233static void to_pixel_space(float r[2], const float a[2], int width, int height)
234{
235 copy_v2_v2(r, a);
236 r[0] *= width;
237 r[1] *= height;
238}
239
240static void marker_update_cb(bContext *C, void *arg_cb, void * /*arg*/)
241{
242 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
243
244 if (!cb->compact) {
245 return;
246 }
247
248 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
249 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
250 marker->flag = cb->marker_flag;
251
253}
254
255static void marker_block_handler(bContext *C, void *arg_cb, int event)
256{
257 MarkerUpdateCb *cb = (MarkerUpdateCb *)arg_cb;
258 int width, height;
259 bool ok = false;
260
261 BKE_movieclip_get_size(cb->clip, cb->user, &width, &height);
262
263 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(cb->clip, cb->framenr);
264 MovieTrackingMarker *marker = BKE_tracking_marker_ensure(cb->track, clip_framenr);
265
266 if (event == B_MARKER_POS) {
267 marker->pos[0] = cb->marker_pos[0] / width;
268 marker->pos[1] = cb->marker_pos[1] / height;
269
270 /* to update position of "parented" objects */
271 DEG_id_tag_update(&cb->clip->id, 0);
273
274 ok = true;
275 }
276 else if (event == B_MARKER_PAT_DIM) {
277 float dim[2], pat_dim[2], pat_min[2], pat_max[2];
278
279 BKE_tracking_marker_pattern_minmax(cb->marker, pat_min, pat_max);
280
281 sub_v2_v2v2(pat_dim, pat_max, pat_min);
282
283 dim[0] = cb->marker_pat[0] / width;
284 dim[1] = cb->marker_pat[1] / height;
285
286 float scale_x = dim[0] / pat_dim[0];
287 float scale_y = dim[1] / pat_dim[1];
288
289 for (int a = 0; a < 4; a++) {
290 cb->marker->pattern_corners[a][0] *= scale_x;
291 cb->marker->pattern_corners[a][1] *= scale_y;
292 }
293
295
296 ok = true;
297 }
298 else if (event == B_MARKER_SEARCH_POS) {
299 float delta[2], side[2];
300
302 mul_v2_fl(side, 0.5f);
303
304 delta[0] = cb->marker_search_pos[0] / width;
305 delta[1] = cb->marker_search_pos[1] / height;
306
307 sub_v2_v2v2(cb->marker->search_min, delta, side);
308 add_v2_v2v2(cb->marker->search_max, delta, side);
309
311
312 ok = true;
313 }
314 else if (event == B_MARKER_SEARCH_DIM) {
315 float dim[2], search_dim[2];
316
317 sub_v2_v2v2(search_dim, cb->marker->search_max, cb->marker->search_min);
318
319 dim[0] = cb->marker_search[0] / width;
320 dim[1] = cb->marker_search[1] / height;
321
322 sub_v2_v2(dim, search_dim);
323 mul_v2_fl(dim, 0.5f);
324
325 cb->marker->search_min[0] -= dim[0];
326 cb->marker->search_min[1] -= dim[1];
327
328 cb->marker->search_max[0] += dim[0];
329 cb->marker->search_max[1] += dim[1];
330
332
333 ok = true;
334 }
335 else if (event == B_MARKER_FLAG) {
336 marker->flag = cb->marker_flag;
337
338 ok = true;
339 }
340 else if (event == B_MARKER_OFFSET) {
341 float offset[2], delta[2];
342
343 offset[0] = cb->track_offset[0] / width;
344 offset[1] = cb->track_offset[1] / height;
345
346 sub_v2_v2v2(delta, offset, cb->track->offset);
347 copy_v2_v2(cb->track->offset, offset);
348
349 for (int i = 0; i < cb->track->markersnr; i++) {
350 sub_v2_v2(cb->track->markers[i].pos, delta);
351 }
352
353 /* to update position of "parented" objects */
354 DEG_id_tag_update(&cb->clip->id, 0);
356
357 ok = true;
358 }
359
360 if (ok) {
362 }
363}
364
367 const char *propname,
368 PointerRNA *userptr,
369 PointerRNA *trackptr,
370 bool compact)
371{
372 if (!ptr->data) {
373 return;
374 }
375
376 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
377 if (!prop) {
378 printf(
379 "%s: property not found: %s.%s\n", __func__, RNA_struct_identifier(ptr->type), propname);
380 return;
381 }
382
383 if (RNA_property_type(prop) != PROP_POINTER) {
384 printf("%s: expected pointer property for %s.%s\n",
385 __func__,
387 propname);
388 return;
389 }
390
391 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
392 MovieClip *clip = (MovieClip *)clipptr.data;
393 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
394 MovieTrackingTrack *track = static_cast<MovieTrackingTrack *>(trackptr->data);
395
396 int clip_framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
397 MovieTrackingMarker *marker = BKE_tracking_marker_get(track, clip_framenr);
398
399 MarkerUpdateCb *cb = MEM_cnew<MarkerUpdateCb>("uiTemplateMarker update_cb");
400 cb->compact = compact;
401 cb->clip = clip;
402 cb->user = user;
403 cb->track = track;
404 cb->marker = marker;
405 cb->marker_flag = marker->flag;
406 cb->framenr = user->framenr;
407
408 if (compact) {
409 const char *tip;
410 uiBlock *block = uiLayoutGetBlock(layout);
411
412 if (cb->marker_flag & MARKER_DISABLED) {
413 tip = TIP_("Marker is disabled at current frame");
414 }
415 else {
416 tip = TIP_("Marker is enabled at current frame");
417 }
418
419 uiBut *bt = uiDefIconButBitI(block,
422 0,
423 ICON_HIDE_OFF,
424 0,
425 0,
426 UI_UNIT_X,
427 UI_UNIT_Y,
428 &cb->marker_flag,
429 0,
430 0,
431 tip);
432 UI_but_funcN_set(bt, marker_update_cb, cb, nullptr);
434 }
435 else {
436 int width, height;
437
438 BKE_movieclip_get_size(clip, user, &width, &height);
439
440 if (track->flag & TRACK_LOCKED) {
441 uiLayoutSetActive(layout, false);
442 uiBlock *block = uiLayoutAbsoluteBlock(layout);
443 uiDefBut(block,
445 0,
446 IFACE_("Track is locked"),
447 0,
448 0,
449 UI_UNIT_X * 15.0f,
450 UI_UNIT_Y,
451 nullptr,
452 0,
453 0,
454 "");
455 MEM_freeN(cb);
456 return;
457 }
458
459 float pat_min[2], pat_max[2];
460 float pat_dim[2], search_dim[2], search_pos[2];
461
462 BKE_tracking_marker_pattern_minmax(marker, pat_min, pat_max);
463
464 sub_v2_v2v2(pat_dim, pat_max, pat_min);
465 sub_v2_v2v2(search_dim, marker->search_max, marker->search_min);
466
467 add_v2_v2v2(search_pos, marker->search_max, marker->search_min);
468 mul_v2_fl(search_pos, 0.5);
469
470 to_pixel_space(cb->marker_pos, marker->pos, width, height);
471 to_pixel_space(cb->marker_pat, pat_dim, width, height);
472 to_pixel_space(cb->marker_search, search_dim, width, height);
473 to_pixel_space(cb->marker_search_pos, search_pos, width, height);
474 to_pixel_space(cb->track_offset, track->offset, width, height);
475
476 cb->marker_flag = marker->flag;
477
478 uiBlock *block = uiLayoutAbsoluteBlock(layout);
480 UI_block_funcN_set(block, marker_update_cb, cb, nullptr);
481
482 const char *tip;
483 int step = 100;
484 int digits = 2;
485
486 if (cb->marker_flag & MARKER_DISABLED) {
487 tip = TIP_("Marker is disabled at current frame");
488 }
489 else {
490 tip = TIP_("Marker is enabled at current frame");
491 }
492
493 uiDefButBitI(block,
497 IFACE_("Enabled"),
498 0.5 * UI_UNIT_X,
499 9.5 * UI_UNIT_Y,
500 7.25 * UI_UNIT_X,
501 UI_UNIT_Y,
502 &cb->marker_flag,
503 0,
504 0,
505 tip);
506
507 uiLayout *col = uiLayoutColumn(layout, true);
509
510 block = uiLayoutAbsoluteBlock(col);
512
513 uiDefBut(block,
515 0,
516 IFACE_("Position:"),
517 0,
518 10 * UI_UNIT_Y,
519 15 * UI_UNIT_X,
520 UI_UNIT_Y,
521 nullptr,
522 0,
523 0,
524 "");
525 uiBut *bt = uiDefButF(block,
528 IFACE_("X:"),
529 0.5 * UI_UNIT_X,
530 9 * UI_UNIT_Y,
531 7.25 * UI_UNIT_X,
532 UI_UNIT_Y,
533 &cb->marker_pos[0],
534 -10 * width,
535 10.0 * width,
536 TIP_("X-position of marker at frame in screen coordinates"));
538 UI_but_number_precision_set(bt, digits);
539 bt = uiDefButF(block,
542 IFACE_("Y:"),
543 8.25 * UI_UNIT_X,
544 9 * UI_UNIT_Y,
545 7.25 * UI_UNIT_X,
546 UI_UNIT_Y,
547 &cb->marker_pos[1],
548 -10 * height,
549 10.0 * height,
550 TIP_("Y-position of marker at frame in screen coordinates"));
552 UI_but_number_precision_set(bt, digits);
553
554 uiDefBut(block,
556 0,
557 IFACE_("Offset:"),
558 0,
559 8 * UI_UNIT_Y,
560 15 * UI_UNIT_X,
561 UI_UNIT_Y,
562 nullptr,
563 0,
564 0,
565 "");
566 bt = uiDefButF(block,
569 IFACE_("X:"),
570 0.5 * UI_UNIT_X,
571 7 * UI_UNIT_Y,
572 7.25 * UI_UNIT_X,
573 UI_UNIT_Y,
574 &cb->track_offset[0],
575 -10 * width,
576 10.0 * width,
577 TIP_("X-offset to parenting point"));
579 UI_but_number_precision_set(bt, digits);
580 bt = uiDefButF(block,
583 IFACE_("Y:"),
584 8.25 * UI_UNIT_X,
585 7 * UI_UNIT_Y,
586 7.25 * UI_UNIT_X,
587 UI_UNIT_Y,
588 &cb->track_offset[1],
589 -10 * height,
590 10.0 * height,
591 TIP_("Y-offset to parenting point"));
593 UI_but_number_precision_set(bt, digits);
594
595 uiDefBut(block,
597 0,
598 IFACE_("Pattern Area:"),
599 0,
600 6 * UI_UNIT_Y,
601 15 * UI_UNIT_X,
602 UI_UNIT_Y,
603 nullptr,
604 0,
605 0,
606 "");
607 bt = uiDefButF(block,
610 IFACE_("Width:"),
611 0.5 * UI_UNIT_X,
612 5 * UI_UNIT_Y,
613 15 * UI_UNIT_X,
614 UI_UNIT_Y,
615 &cb->marker_pat[0],
616 3.0f,
617 10.0 * width,
618 TIP_("Width of marker's pattern in screen coordinates"));
620 UI_but_number_precision_set(bt, digits);
621 bt = uiDefButF(block,
624 IFACE_("Height:"),
625 0.5 * UI_UNIT_X,
626 4 * UI_UNIT_Y,
627 15 * UI_UNIT_X,
628 UI_UNIT_Y,
629 &cb->marker_pat[1],
630 3.0f,
631 10.0 * height,
632 TIP_("Height of marker's pattern in screen coordinates"));
634 UI_but_number_precision_set(bt, digits);
635
636 uiDefBut(block,
638 0,
639 IFACE_("Search Area:"),
640 0,
641 3 * UI_UNIT_Y,
642 15 * UI_UNIT_X,
643 UI_UNIT_Y,
644 nullptr,
645 0,
646 0,
647 "");
648 bt = uiDefButF(block,
651 IFACE_("X:"),
652 0.5 * UI_UNIT_X,
653 2 * UI_UNIT_Y,
654 7.25 * UI_UNIT_X,
655 UI_UNIT_Y,
656 &cb->marker_search_pos[0],
657 -width,
658 width,
659 TIP_("X-position of search at frame relative to marker's position"));
661 UI_but_number_precision_set(bt, digits);
662 bt = uiDefButF(block,
665 IFACE_("Y:"),
666 8.25 * UI_UNIT_X,
667 2 * UI_UNIT_Y,
668 7.25 * UI_UNIT_X,
669 UI_UNIT_Y,
670 &cb->marker_search_pos[1],
671 -height,
672 height,
673 TIP_("Y-position of search at frame relative to marker's position"));
675 UI_but_number_precision_set(bt, digits);
676 bt = uiDefButF(block,
679 IFACE_("Width:"),
680 0.5 * UI_UNIT_X,
681 1 * UI_UNIT_Y,
682 15 * UI_UNIT_X,
683 UI_UNIT_Y,
684 &cb->marker_search[0],
685 3.0f,
686 10.0 * width,
687 TIP_("Width of marker's search in screen coordinates"));
689 UI_but_number_precision_set(bt, digits);
690 bt = uiDefButF(block,
693 IFACE_("Height:"),
694 0.5 * UI_UNIT_X,
695 0 * UI_UNIT_Y,
696 15 * UI_UNIT_X,
697 UI_UNIT_Y,
698 &cb->marker_search[1],
699 3.0f,
700 10.0 * height,
701 TIP_("Height of marker's search in screen coordinates"));
703 UI_but_number_precision_set(bt, digits);
704
705 UI_block_align_end(block);
706 }
707}
708
709/********************* Footage Information Template ************************/
710
713 const char *propname,
714 PointerRNA *userptr)
715{
716 if (!ptr->data) {
717 return;
718 }
719
720 PropertyRNA *prop = RNA_struct_find_property(ptr, propname);
721 if (!prop) {
722 printf(
723 "%s: property not found: %s.%s\n", __func__, RNA_struct_identifier(ptr->type), propname);
724 return;
725 }
726
727 if (RNA_property_type(prop) != PROP_POINTER) {
728 printf("%s: expected pointer property for %s.%s\n",
729 __func__,
731 propname);
732 return;
733 }
734
735 PointerRNA clipptr = RNA_property_pointer_get(ptr, prop);
736 MovieClip *clip = static_cast<MovieClip *>(clipptr.data);
737 MovieClipUser *user = static_cast<MovieClipUser *>(userptr->data);
738
739 uiLayout *col = uiLayoutColumn(layout, false);
741
742 /* NOTE: Put the frame to cache. If the panel is drawn, the display will also be shown, as well
743 * as metadata panel. So if the cache is skipped here it is not really a memory saver, but
744 * skipping the cache could lead to a performance impact depending on the order in which panels
745 * and the main area is drawn. Basically, if it is this template drawn first and then the main
746 * area it will lead to frame read and processing happening twice. */
747 ImBuf *ibuf = BKE_movieclip_get_ibuf_flag(clip, user, clip->flag, 0);
748
749 int width, height;
750 /* Display frame dimensions, channels number and buffer type. */
751 BKE_movieclip_get_size(clip, user, &width, &height);
752
753 char str[1024];
754 size_t ofs = 0;
755 ofs += BLI_snprintf_rlen(str + ofs, sizeof(str) - ofs, RPT_("%d x %d"), width, height);
756
757 if (ibuf) {
758 if (ibuf->float_buffer.data) {
759 if (ibuf->channels != 4) {
760 ofs += BLI_snprintf_rlen(
761 str + ofs, sizeof(str) - ofs, RPT_(", %d float channel(s)"), ibuf->channels);
762 }
763 else if (ibuf->planes == R_IMF_PLANES_RGBA) {
764 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGBA float"), sizeof(str) - ofs);
765 }
766 else {
767 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGB float"), sizeof(str) - ofs);
768 }
769 }
770 else {
771 if (ibuf->planes == R_IMF_PLANES_RGBA) {
772 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGBA byte"), sizeof(str) - ofs);
773 }
774 else {
775 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", RGB byte"), sizeof(str) - ofs);
776 }
777 }
778
779 if (clip->anim != nullptr) {
780 short frs_sec;
781 float frs_sec_base;
782 if (IMB_anim_get_fps(clip->anim, true, &frs_sec, &frs_sec_base)) {
783 ofs += BLI_snprintf_rlen(
784 str + ofs, sizeof(str) - ofs, RPT_(", %.2f fps"), float(frs_sec) / frs_sec_base);
785 }
786 }
787 }
788 else {
789 ofs += BLI_strncpy_rlen(str + ofs, RPT_(", failed to load"), sizeof(str) - ofs);
790 }
791 UNUSED_VARS(ofs);
792
793 uiItemL(col, str, ICON_NONE);
794
795 /* Display current frame number. */
796 int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, user->framenr);
797 if (framenr <= clip->len) {
798 SNPRINTF(str, RPT_("Frame: %d / %d"), framenr, clip->len);
799 }
800 else {
801 SNPRINTF(str, RPT_("Frame: - / %d"), clip->len);
802 }
803 uiItemL(col, str, ICON_NONE);
804
805 /* Display current file name if it's a sequence clip. */
806 if (clip->source == MCLIP_SRC_SEQUENCE) {
807 char filepath[FILE_MAX];
808 const char *file;
809
810 if (framenr <= clip->len) {
811 BKE_movieclip_filepath_for_frame(clip, user, filepath);
812 file = BLI_path_basename(filepath);
813 }
814 else {
815 file = "-";
816 }
817
818 SNPRINTF(str, RPT_("File: %s"), file);
819
820 uiItemL(col, str, ICON_NONE);
821 }
822
823 IMB_freeImBuf(ibuf);
824}
SpaceClip * CTX_wm_space_clip(const bContext *C)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
void BKE_movieclip_get_size(struct MovieClip *clip, const struct MovieClipUser *user, int *r_width, int *r_height)
void BKE_movieclip_filepath_for_frame(struct MovieClip *clip, const struct MovieClipUser *user, char *filepath)
struct ImBuf * BKE_movieclip_get_ibuf_flag(struct MovieClip *clip, const struct MovieClipUser *user, int flag, int cache_flag)
@ PANEL_TYPE_DEFAULT_CLOSED
struct MovieTrackingMarker * BKE_tracking_marker_ensure(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1402
struct MovieTrackingMarker * BKE_tracking_marker_get(struct MovieTrackingTrack *track, int framenr)
Definition tracking.cc:1358
void BKE_tracking_marker_clamp_search_position(struct MovieTrackingMarker *marker)
Definition tracking.cc:1338
void BKE_tracking_marker_clamp_search_size(struct MovieTrackingMarker *marker)
Definition tracking.cc:1327
void BKE_tracking_marker_pattern_minmax(const struct MovieTrackingMarker *marker, float min[2], float max[2])
void BLI_addtail(struct ListBase *listbase, void *vlink) ATTR_NONNULL(1)
Definition listbase.cc:110
MINLINE void sub_v2_v2(float r[2], const float a[2])
MINLINE void mul_v2_fl(float r[2], float f)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void add_v2_v2v2(float r[2], const float a[2], const float b[2])
MINLINE void sub_v2_v2v2(float r[2], const float a[2], const float b[2])
void void void const char * BLI_path_basename(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
#define FILE_MAX
#define STRNCPY(dst, src)
Definition BLI_string.h:593
#define SNPRINTF(dst, format,...)
Definition BLI_string.h:597
size_t BLI_snprintf_rlen(char *__restrict dst, size_t dst_maxncpy, const char *__restrict format,...) ATTR_NONNULL(1
char char size_t BLI_strncpy_rlen(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1
#define UNUSED_VARS(...)
#define RPT_(msgid)
#define TIP_(msgid)
#define IFACE_(msgid)
#define BLT_I18NCONTEXT_DEFAULT_BPYRNA
void DEG_id_tag_update(ID *id, unsigned int flags)
@ MCLIP_SRC_SEQUENCE
@ R_IMF_PLANES_RGBA
@ TRACK_LOCKED
@ MARKER_DISABLED
bool ED_space_clip_poll(bContext *C)
ImBuf * ED_space_clip_get_buffer(const SpaceClip *sc)
void ED_region_image_metadata_panel_draw(ImBuf *ibuf, uiLayout *layout)
Definition area.cc:3859
bool IMB_anim_get_fps(const ImBufAnim *anim, bool no_av_base, short *r_frs_sec, float *r_frs_sec_base)
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
@ PROP_POINTER
Definition RNA_types.hh:70
#define UI_UNIT_Y
void uiLayoutSetActive(uiLayout *layout, bool active)
void uiTemplateColorspaceSettings(uiLayout *layout, PointerRNA *ptr, const char *propname)
@ UI_LAYOUT_ALIGN_RIGHT
uiBut * uiDefBut(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, void *poin, float min, float max, const char *tip)
void uiItemL(uiLayout *layout, const char *name, int icon)
uiBlock * uiLayoutGetBlock(uiLayout *layout)
uiLayout * uiLayoutRow(uiLayout *layout, bool align)
void UI_but_drawflag_enable(uiBut *but, int flag)
void uiLayoutSetAlignment(uiLayout *layout, char alignment)
void UI_but_number_step_size_set(uiBut *but, float step_size)
void UI_block_func_handle_set(uiBlock *block, uiBlockHandleFunc func, void *arg)
uiBut * uiDefButBitI(uiBlock *block, int type, int bit, int retval, blender::StringRef str, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
#define UI_ITEM_NONE
uiBut * uiDefButF(uiBlock *block, int type, int retval, blender::StringRef str, int x, int y, short width, short height, float *poin, float min, float max, const char *tip)
void UI_block_align_begin(uiBlock *block)
void uiItemO(uiLayout *layout, const char *name, int icon, const char *opname)
uiBut * uiDefIconButI(uiBlock *block, int type, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
void UI_block_funcN_set(uiBlock *block, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void UI_but_number_precision_set(uiBut *but, float precision)
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, const char *propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, const char *text=nullptr)
uiLayout * uiLayoutColumn(uiLayout *layout, bool align)
uiLayout * uiLayoutSplit(uiLayout *layout, float percentage, bool align)
uiBlock * uiLayoutAbsoluteBlock(uiLayout *layout)
uiBut * uiDefIconButBitI(uiBlock *block, int type, int bit, int retval, int icon, int x, int y, short width, short height, int *poin, float min, float max, const char *tip)
#define UI_UNIT_X
@ UI_BTYPE_TOGGLE_N
@ UI_BTYPE_LABEL
@ UI_BTYPE_CHECKBOX_N
@ UI_BTYPE_NUM
@ UI_BTYPE_TRACK_PREVIEW
@ UI_BTYPE_GRIP
void UI_but_funcN_set(uiBut *but, uiButHandleNFunc funcN, void *argN, void *arg2, uiButArgNFree func_argN_free_fn=MEM_freeN, uiButArgNCopy func_argN_copy_fn=MEM_dupallocN)
void uiItemR(uiLayout *layout, PointerRNA *ptr, const char *propname, eUI_Item_Flag flag, const char *name, int icon)
@ UI_BUT_ICON_REVERSE
void uiLayoutSetContextPointer(uiLayout *layout, const char *name, PointerRNA *ptr)
void UI_block_align_end(uiBlock *block)
#define NC_MOVIECLIP
Definition WM_types.hh:364
#define NA_EDITED
Definition WM_types.hh:550
#define ND_SPACE_VIEW3D
Definition WM_types.hh:494
#define NC_SPACE
Definition WM_types.hh:359
#define B_MARKER_POS
#define B_MARKER_SEARCH_DIM
static void marker_block_handler(bContext *C, void *arg_cb, int event)
void ED_clip_buttons_register(ARegionType *art)
void uiTemplateTrack(uiLayout *layout, PointerRNA *ptr, const char *propname)
#define B_MARKER_SEARCH_POS
void uiTemplateMovieclipInformation(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr)
void uiTemplateMarker(uiLayout *layout, PointerRNA *ptr, const char *propname, PointerRNA *userptr, PointerRNA *trackptr, bool compact)
#define B_MARKER_OFFSET
#define B_MARKER_PAT_DIM
#define B_MARKER_FLAG
static void marker_update_cb(bContext *C, void *arg_cb, void *)
static void to_pixel_space(float r[2], const float a[2], int width, int height)
static bool metadata_panel_context_poll(const bContext *C, PanelType *)
void uiTemplateMovieClip(uiLayout *layout, bContext *C, PointerRNA *ptr, const char *propname, bool compact)
static void metadata_panel_context_draw(const bContext *C, Panel *panel)
#define printf
FILE * file
int len
#define str(s)
uint col
void IMB_freeImBuf(ImBuf *)
void MEM_freeN(void *vmemh)
Definition mallocn.cc:105
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
PropertyType RNA_property_type(PropertyRNA *prop)
PointerRNA RNA_property_pointer_get(PointerRNA *ptr, PropertyRNA *prop)
const char * RNA_struct_identifier(const StructRNA *type)
ListBase paneltypes
ImBufFloatBuffer float_buffer
unsigned char planes
MovieTrackingMarker * marker
MovieTrackingTrack * track
float track_offset[2]
float marker_search_pos[2]
MovieClip * clip
float marker_search[2]
float marker_pat[2]
float marker_pos[2]
MovieClipUser * user
MovieTrackingMarker * markers
void(* draw)(const bContext *C, Panel *panel)
char idname[BKE_ST_MAXNAME]
bool(* poll)(const bContext *C, PanelType *pt)
char translation_context[BKE_ST_MAXNAME]
char category[BKE_ST_MAXNAME]
char label[BKE_ST_MAXNAME]
struct uiLayout * layout
StructRNA * type
Definition RNA_types.hh:41
void * data
Definition RNA_types.hh:42
#define N_(msgid)
void WM_event_add_notifier(const bContext *C, uint type, void *reference)
PointerRNA * ptr
Definition wm_files.cc:4126