36 {0,
nullptr, 0,
nullptr,
nullptr},
42 .default_value({0.8f, 0.8f, 0.8f, 1.0f})
43 .structure_type(StructureType::Dynamic);
49 b.add_output<
decl::Color>(
"Image").structure_type(StructureType::Dynamic);
105 if (this->
context().use_gpu()) {
145 output.store_pixel(texel,
146 input.sample_bilinear_zero(distortion_grid.load_pixel<float2>(texel)));
154 const MenuValue menu_value =
input.get_single_value_default(default_menu_value);
178 ntype.
ui_name =
"Movie Distortion";
180 "Remove lens distortion from footage, using motion tracking camera lens settings";
183 ntype.
declare = file_ns::cmp_node_moviedistortion_declare;
184 ntype.
draw_buttons = file_ns::node_composit_buts_moviedistortion;
187 ntype, std::nullopt, file_ns::storage_free, file_ns::storage_copy);
Scene * CTX_data_scene(const bContext *C)
#define NODE_CLASS_DISTORT
#define CMP_NODE_MOVIEDISTORTION
struct MovieDistortion * BKE_tracking_distortion_copy(struct MovieDistortion *distortion)
void BKE_tracking_distortion_free(struct MovieDistortion *distortion)
void GPU_shader_bind(blender::gpu::Shader *shader, const blender::gpu::shader::SpecializationConstants *constants_state=nullptr)
void GPU_texture_extend_mode(blender::gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
@ GPU_SAMPLER_EXTEND_MODE_CLAMP_TO_BORDER
void GPU_texture_filter_mode(blender::gpu::Texture *texture, bool use_filter)
#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)
StaticCacheManager & cache_manager()
gpu::Shader * get_shader(const char *info_name, ResultPrecision precision)
Result & get(Context &context, MovieClip *movie_clip, int2 size, DistortionType type, int frame_number)
const bNode & bnode() const
NodeOperation(Context &context, DNode node)
Result & get_result(StringRef identifier)
Context & context() const
Result & get_input(StringRef identifier) const
virtual Domain compute_domain()
void share_data(const Result &source)
void allocate_texture(const Domain domain, const bool from_pool=true, const std::optional< ResultStorageType > storage_type=std::nullopt)
void unbind_as_texture() const
void bind_as_texture(gpu::Shader *shader, const char *texture_name) const
const Domain & domain() const
void unbind_as_image() const
void bind_as_image(gpu::Shader *shader, const char *image_name, bool read=false) const
bool is_single_value() const
DistortionGridContainer distortion_grids
void execute_cpu(const Result &distortion_grid)
MovieClip * get_movie_clip()
void execute_gpu(const Result &distortion_grid)
DistortionType get_distortion_type()
NodeOperation(Context &context, DNode node)
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))
void compute_dispatch_threads_at_least(gpu::Shader *shader, int2 threads_range, int2 local_size=int2(16))
void parallel_for(const int2 range, const Function &function)
static NodeOperation * get_compositor_operation(Context &context, DNode node)
static void node_composit_buts_moviedistortion(uiLayout *layout, bContext *C, PointerRNA *ptr)
static void storage_copy(bNodeTree *, bNode *dest_node, const bNode *src_node)
static void storage_free(bNode *node)
static const EnumPropertyItem type_items[]
static void cmp_node_moviedistortion_declare(NodeDeclarationBuilder &b)
VecBase< int32_t, 2 > int2
static void register_node_type_cmp_moviedistortion()
void cmp_node_type_base(blender::bke::bNodeType *ntype, std::string idname, const std::optional< int16_t > legacy_type)
std::string ui_description
NodeGetCompositorOperationFunction get_compositor_operation
const char * enum_name_legacy
void(* draw_buttons)(uiLayout *, bContext *C, PointerRNA *ptr)
NodeDeclareFunction declare
void(* initfunc_api)(const bContext *C, PointerRNA *ptr)