31 b.add_output<
decl::Color>(
"Image"_ustr).structure_type(StructureType::Dynamic);
32 b.add_output<
decl::Float>(
"Alpha"_ustr).structure_type(StructureType::Dynamic);
52 node->id = id_cast<ID *>(scene->clip);
58 template_id(&layout,
C, ptr,
"clip",
nullptr,
"CLIP_OT_open",
nullptr);
88 if (!
result.should_compute()) {
92 if (!movie_clip_buffer) {
97 const int2 size =
int2(movie_clip_buffer->
x, movie_clip_buffer->
y);
104 const float *src = movie_clip_buffer->
float_data();
107 result.store_pixel(texel,
Color(src + pixel_index));
115 if (!
result.should_compute()) {
119 if (!movie_clip_buffer) {
120 result.allocate_single_value();
121 result.set_single_value(1.0f);
125 const int2 size =
int2(movie_clip_buffer->
x, movie_clip_buffer->
y);
130 const float *src = movie_clip_buffer->
float_data();
133 int64_t input_pixel_index = pixel_index * 4;
134 alpha_values[pixel_index] = src[input_pixel_index + 3];
139 const float *src = movie_clip_buffer->
float_data();
142 result.store_pixel(texel, src[pixel_index + 3]);
150 if (!movie_clip_buffer) {
177 const int width = movie_clip_buffer->
x;
178 const int height = movie_clip_buffer->
y;
185 movie_clip, frame_number, width, height, offset, &
scale, &
angle);
222 if (!movie_clip_buffer) {
227 return movie_clip_buffer;
236 return movie_clip_buffer;
262 "Input image or movie from a movie clip data-block, typically used for motion tracking";
#define CMP_NODE_MOVIECLIP
#define NOD_REGISTER_NODE(REGISTER_FUNC)
SIMD_FORCE_INLINE btScalar angle(const btVector3 &v) const
Return the angle between this and another vector.
NodeOperation(Context &context, const bNode &node)
const bNode & node() const
Result & get_result(StringRef identifier)
Context & context() const
bool should_compute() const
void set_single_value(const T &value)
void allocate_single_value()
NodeOperation(Context &context, const bNode &node)
MovieClip * get_movie_clip()
MovieClipUser * get_movie_clip_user()
void compute_image(ImBuf *movie_clip_buffer)
void compute_alpha(ImBuf *movie_clip_buffer)
ImBuf * get_movie_clip_buffer()
void compute_stabilization_data(ImBuf *movie_clip_buffer)
float3x3 scale(float3x3 mat, float2 scale)
void node_register_type(bNodeType &ntype)
void node_type_storage(bNodeType &ntype, std::optional< StringRefNull > storagename, void(*freefunc)(bNode *node), void(*copyfunc)(bNodeTree *dest_ntree, bNode *dest_node, const bNode *src_node))
ColorSceneLinear4f< eAlpha::Premultiplied > Color
void parallel_for(const int2 range, const Function &function)
static void node_init(bNodeTree *, bNode *node)
static NodeOperation * get_compositor_operation(Context &context, const bNode &node)
static void node_draw_buttons(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static void node_init_api(const bContext *C, PointerRNA *node_ptr)
static void node_draw_buttons_extended(ui::Layout &layout, bContext *C, PointerRNA *ptr)
static void node_declare(NodeDeclarationBuilder &b)
static void node_register()
void GPU_texture_update(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
void BKE_tracking_stabilization_data_get(MovieClip *clip, int framenr, int width, int height, float translation[2], float *scale, float *angle)
void IMB_float_from_byte(ImBuf *ibuf)
void IMB_freeImBuf(ImBuf *ibuf)
ImBuf * BKE_movieclip_get_ibuf(MovieClip *clip, const MovieClipUser *user)
void BKE_movieclip_user_set_frame(MovieClipUser *user, int framenr)
float BKE_movieclip_remap_scene_to_clip_frame(const MovieClip *clip, float framenr)
void uiTemplateMovieClip(ui::Layout *layout, bContext *C, PointerRNA *ptr, StringRefNull propname, bool compact)
void node_copy_standard_storage(bNodeTree *, bNode *dest_node, const bNode *src_node)
Scene * CTX_data_scene(const bContext *C)
void node_free_standard_storage(bNode *node)
void cmp_node_type_base(bke::bNodeType *ntype, UString idname, const std::optional< int16_t > legacy_type)
const float * float_data() const
void(*) draw_buttons(ui::Layout &, bContext *C, PointerRNA *ptr)
std::string ui_description
void(*) initfunc_api(const bContext *C, PointerRNA *ptr)
NodeGetCompositorOperationFunction get_compositor_operation
void(*) draw_buttons_ex(ui::Layout &, bContext *C, PointerRNA *ptr)
void(*) initfunc(bNodeTree *ntree, bNode *node)
const char * enum_name_legacy
NodeDeclareFunction declare
void use_property_decorate_set(bool is_decorate)
void use_property_split_set(bool is_sep)