35 b.use_custom_socket_order();
36 b.allow_any_socket_order();
39 .default_value({0.8f, 0.8f, 0.8f, 1.0f})
42 .structure_type(StructureType::Dynamic);
43 b.add_output<
decl::Color>(
"Image").structure_type(StructureType::Dynamic).align_with_previous();
46 uiTemplateID(layout, context, node_pointer,
"clip",
nullptr,
"CLIP_OT_open",
nullptr);
50 "Invert stabilization to reintroduce motion to the image");
57 .description(
"Interpolation method");
62 .description(
"The extension mode applied to the X axis");
67 .description(
"The extension mode applied to the Y axis");
91 if (
input.is_single_value() || !movie_clip) {
96 const int width =
input.domain().size.x;
97 const int height =
input.domain().size.y;
102 float scale, rotation;
104 movie_clip, frame_number, width, height, translation, &scale, &rotation);
113 output.transform(transformation);
123 const MenuValue menu_value =
input.get_single_value_default(default_menu_value);
125 switch (interpolation) {
142 const MenuValue menu_value =
input.get_single_value_default(default_menu_value);
144 switch (extension_x) {
160 const MenuValue menu_value =
input.get_single_value_default(default_menu_value);
162 switch (extension_y) {
199 ntype.
ui_name =
"Stabilize 2D";
200 ntype.
ui_description =
"Stabilize footage using 2D stabilization motion tracking settings";
203 ntype.
declare = file_ns::cmp_node_stabilize2d_declare;
Scene * CTX_data_scene(const bContext *C)
float BKE_movieclip_remap_scene_to_clip_frame(const struct MovieClip *clip, float framenr)
#define NODE_CLASS_DISTORT
#define CMP_NODE_STABILIZE2D
void BKE_tracking_stabilization_data_get(struct MovieClip *clip, int framenr, int width, int height, float translation[2], float *scale, float *angle)
@ CMP_NODE_INTERPOLATION_NEAREST
@ CMP_NODE_INTERPOLATION_BILINEAR
@ CMP_NODE_INTERPOLATION_BICUBIC
@ CMP_NODE_INTERPOLATION_ANISOTROPIC
@ CMP_NODE_EXTENSION_MODE_EXTEND
@ CMP_NODE_EXTENSION_MODE_CLIP
@ CMP_NODE_EXTENSION_MODE_REPEAT
#define NOD_REGISTER_NODE(REGISTER_FUNC)
void uiTemplateID(uiLayout *layout, const bContext *C, PointerRNA *ptr, blender::StringRefNull propname, const char *newop, const char *openop, const char *unlinkop, int filter=UI_TEMPLATE_ID_FILTER_ALL, bool live_icon=false, std::optional< blender::StringRef > text=std::nullopt)
const bNode & bnode() const
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
RealizationOptions & get_realization_options()
T get_single_value_default(const T &default_value) const
DeclType::Builder & add_input(StringRef name, StringRef identifier="")
const CompositorInputRealizationMode & compositor_realization_mode() const
Interpolation get_interpolation()
ExtensionMode get_extension_mode_y()
ExtensionMode get_extension_mode_x()
bool do_inverse_stabilization()
MovieClip * get_movie_clip()
NodeOperation(Context &context, DNode node)
void node_register_type(bNodeType &ntype)
AngleRadianBase< float > AngleRadian
CartesianBasis invert(const CartesianBasis &basis)
MatT from_loc_rot_scale(const typename MatT::loc_type &location, const RotationT &rotation, const VecBase< typename MatT::base_type, ScaleDim > &scale)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void cmp_node_stabilize2d_declare(NodeDeclarationBuilder &b)
VecBase< float, 2 > float2
MatBase< float, 3, 3 > float3x3
static void register_node_type_cmp_stabilize2d()
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
const EnumPropertyItem rna_enum_node_compositor_extension_items[]
const EnumPropertyItem rna_enum_node_compositor_interpolation_items[]
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
const char * enum_name_legacy
NodeDeclareFunction declare
void(* initfunc_api)(const bContext *C, PointerRNA *ptr)
ExtensionMode extension_x
ExtensionMode extension_y