26 #include "RNA_prototypes.h"
41 float matrix_space[4][4])
46 matrix_space[3][0] = (region->
winx / 2) + snode->
xof;
47 matrix_space[3][1] = (region->
winy / 2) + snode->
yof;
52 const float image_dims[2],
53 float matrix_space[4][4])
58 matrix_space[3][0] = ((region->
winx / 2) + snode->
xof) - ((image_dims[0] / 2.0f) * snode->
zoom);
59 matrix_space[3][1] = ((region->
winy / 2) + snode->
yof) - ((image_dims[1] / 2.0f) * snode->
zoom);
75 matrix[0][0] = snode->
zoom;
76 matrix[1][1] = snode->
zoom;
77 matrix[3][0] = snode->
xof;
78 matrix[3][1] = snode->
yof;
85 const float(*matrix)[4] = (
const float(*)[4])value_p;
88 snode->
zoom = matrix[0][0];
89 snode->
xof = matrix[3][0];
90 snode->
yof = matrix[3][1];
138 const float dims[2] = {
139 (ibuf->
x > 0) ? ibuf->
x : 64.0f,
140 (ibuf->
y > 0) ? ibuf->
y : 64.0f,
159 params.range_get_fn =
nullptr;
172 gzgt->
name =
"Backdrop Transform Widget";
173 gzgt->
idname =
"NODE_GGT_backdrop_transform";
221 rect->
xmin = nxy->
x1 / dims[0];
222 rect->
xmax = nxy->
x2 / dims[0];
223 rect->
ymin = nxy->
y1 / dims[1];
224 rect->
ymax = nxy->
y2 / dims[1];
240 nxy->
x1 = rect->
xmin * dims[0];
241 nxy->
x2 = rect->
xmax * dims[0];
242 nxy->
y1 = rect->
ymin * dims[1];
243 nxy->
y2 = rect->
ymax * dims[1];
255 const float *dims = crop_group->
state.
dims;
258 bool is_relative = (
bool)
node->custom2;
271 const float(*matrix)[4] = (
const float(*)[4])value_p;
274 const float *dims = crop_group->
state.
dims;
277 bool is_relative = (
bool)
node->custom2;
280 const bool nx = rct.
xmin > rct.
xmax;
283 BLI_rctf_recenter(&rct, (matrix[3][0] / dims[0]) + 0.5f, (matrix[3][1] / dims[1]) + 0.5f);
313 if ((
node->custom1 & (1 << 0)) == 0) {
357 crop_group->
state.
dims[0] = (ibuf->
x > 0) ? ibuf->
x : 64.0f;
358 crop_group->
state.
dims[1] = (ibuf->
y > 0) ? ibuf->
y : 64.0f;
375 params.range_get_fn =
nullptr;
388 gzgt->
name =
"Backdrop Crop Widget";
389 gzgt->
idname =
"NODE_GGT_backdrop_crop";
471 sbeam_group->
state.
dims[0] = (ibuf->
x > 0) ? ibuf->
x : 64.0f;
472 sbeam_group->
state.
dims[1] = (ibuf->
y > 0) ? ibuf->
y : 64.0f;
493 gzgt->
name =
"Sun Beams Widget";
494 gzgt->
idname =
"NODE_GGT_sbeam";
544 for (
int i = 0; i < 4; i++) {
563 float matrix_space[4][4];
565 snode, region, cpin_group->
state.
dims, matrix_space);
567 for (
int i = 0; i < 4; i++) {
583 cpin_group->
state.
dims[0] = (ibuf->
x > 0) ? ibuf->
x : 64.0f;
584 cpin_group->
state.
dims[1] = (ibuf->
y > 0) ? ibuf->
y : 64.0f;
604 for (
int i = 0; i < 4; i++) {
615 gzgt->
name =
"Corner Pin Widget";
616 gzgt->
idname =
"NODE_GGT_backdrop_corner_pin";
typedef float(TangentPoint)[2]
struct SpaceNode * CTX_wm_space_node(const bContext *C)
struct ARegion * CTX_wm_region(const bContext *C)
struct Main * CTX_data_main(const bContext *C)
void BKE_image_release_ibuf(struct Image *ima, struct ImBuf *ibuf, void *lock)
struct ImBuf * BKE_image_acquire_ibuf(struct Image *ima, struct ImageUser *iuser, void **r_lock)
struct Image * BKE_image_ensure_viewer(struct Main *bmain, int type, const char *name)
#define CMP_NODE_SPLITVIEWER
#define CMP_NODE_CORNERPIN
struct bNode * nodeGetActive(struct bNodeTree *ntree)
#define CMP_NODE_SUNBEAMS
void unit_m4(float m[4][4])
void copy_m4_m4(float m1[4][4], const float m2[4][4])
MINLINE void mul_v3_fl(float r[3], float f)
BLI_INLINE float BLI_rctf_cent_y(const struct rctf *rct)
bool BLI_rctf_isect(const struct rctf *src1, const struct rctf *src2, struct rctf *dest)
BLI_INLINE float BLI_rctf_cent_x(const struct rctf *rct)
void BLI_rctf_recenter(struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rctf_size_x(const struct rctf *rct)
void BLI_rctf_resize(struct rctf *rect, float x, float y)
BLI_INLINE float BLI_rctf_size_y(const struct rctf *rct)
@ ED_GIZMO_MOVE_STYLE_CROSS_2D
@ ED_GIZMO_CAGE2D_XFORM_FLAG_TRANSLATE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE
@ ED_GIZMO_CAGE2D_XFORM_FLAG_SCALE_UNIFORM
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble ny
Contains defines and structs used throughout the imbuf module.
Read Guarded memory(de)allocation.
@ WM_GIZMOGROUPTYPE_PERSISTENT
void *(* MEM_mallocN)(size_t len, const char *str)
static bool WIDGETGROUP_node_crop_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
static void WIDGETGROUP_node_corner_pin_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_corner_pin_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_node_crop_update(struct NodeCropWidgetGroup *crop_group)
static void WIDGETGROUP_node_crop_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
void NODE_GGT_backdrop_corner_pin(wmGizmoGroupType *gzgt)
static void WIDGETGROUP_node_transform_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static bool WIDGETGROUP_node_transform_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
static void WIDGETGROUP_node_sbeam_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_transform_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_corner_pin_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_sbeam_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void gizmo_node_crop_prop_matrix_get(const wmGizmo *gz, wmGizmoProperty *gz_prop, void *value_p)
void NODE_GGT_backdrop_crop(wmGizmoGroupType *gzgt)
static void gizmo_node_backdrop_prop_matrix_set(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, const void *value_p)
void NODE_GGT_backdrop_transform(wmGizmoGroupType *gzgt)
void NODE_GGT_backdrop_sun_beams(wmGizmoGroupType *gzgt)
static bool WIDGETGROUP_node_sbeam_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
static void node_gizmo_calc_matrix_space(const SpaceNode *snode, const ARegion *region, float matrix_space[4][4])
static void WIDGETGROUP_node_crop_refresh(const bContext *C, wmGizmoGroup *gzgroup)
static void WIDGETGROUP_node_sbeam_setup(const bContext *UNUSED(C), wmGizmoGroup *gzgroup)
static void gizmo_node_crop_prop_matrix_set(const wmGizmo *gz, wmGizmoProperty *gz_prop, const void *value_p)
static void WIDGETGROUP_node_crop_draw_prepare(const bContext *C, wmGizmoGroup *gzgroup)
static void node_gizmo_calc_matrix_space_with_image_dims(const SpaceNode *snode, const ARegion *region, const float image_dims[2], float matrix_space[4][4])
static void two_xy_from_rect(NodeTwoXYs *nxy, const rctf *rect, const float dims[2], bool is_relative)
static void gizmo_node_backdrop_prop_matrix_get(const wmGizmo *UNUSED(gz), wmGizmoProperty *gz_prop, void *value_p)
static bool WIDGETGROUP_node_corner_pin_poll(const bContext *C, wmGizmoGroupType *UNUSED(gzgt))
static void two_xy_to_rect(const NodeTwoXYs *nxy, rctf *rect, const float dims[2], bool is_relative)
void RNA_pointer_create(ID *id, StructRNA *type, void *data, PointerRNA *r_ptr)
PropertyRNA * RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
void RNA_property_update(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
void RNA_enum_set(PointerRNA *ptr, const char *name, int value)
void RNA_float_set_array(PointerRNA *ptr, const char *name, const float *values)
struct bNodeTree * edittree
wmGizmoGroupFnSetupKeymap setup_keymap
wmGizmoGroupFnRefresh refresh
eWM_GizmoFlagGroupTypeFlag flag
wmGizmoGroupFnDrawPrepare draw_prepare
const struct wmGizmoPropertyType * type
struct wmGizmoProperty::@1185 custom_func
struct wmGizmoGroup * parent_gzgroup
wmGizmo * WM_gizmo_new_ptr(const wmGizmoType *gzt, wmGizmoGroup *gzgroup, PointerRNA *properties)
void WM_gizmo_set_matrix_location(wmGizmo *gz, const float origin[3])
void WM_gizmo_set_flag(wmGizmo *gz, const int flag, const bool enable)
wmGizmo * WM_gizmo_new(const char *idname, wmGizmoGroup *gzgroup, PointerRNA *properties)
wmKeyMap * WM_gizmogroup_setup_keymap_generic_maybe_drag(const wmGizmoGroupType *UNUSED(gzgt), wmKeyConfig *kc)
void WM_gizmo_target_property_def_rna(wmGizmo *gz, const char *idname, PointerRNA *ptr, const char *propname, int index)
void WM_gizmo_target_property_def_func(wmGizmo *gz, const char *idname, const wmGizmoPropertyFnParams *params)
const wmGizmoType * WM_gizmotype_find(const char *idname, bool quiet)