Blender  V3.3
mask_query.c File Reference
#include "MEM_guardedalloc.h"
#include "BLI_math.h"
#include "BKE_context.h"
#include "BKE_mask.h"
#include "DEG_depsgraph.h"
#include "DEG_depsgraph_query.h"
#include "DNA_mask_types.h"
#include "DNA_scene_types.h"
#include "DNA_screen_types.h"
#include "ED_clip.h"
#include "ED_image.h"
#include "ED_mask.h"
#include "UI_view2d.h"
#include "mask_intern.h"

Go to the source code of this file.

Functions

Spatial Queries
bool ED_mask_find_nearest_diff_point (const bContext *C, struct Mask *mask_orig, const float normal_co[2], int threshold, bool feather, float tangent[2], const bool use_deform, const bool use_project, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, float *r_u, float *r_score)
 
static void mask_point_scaled_handle (const MaskSplinePoint *point, const eMaskWhichHandle which_handle, const float scalex, const float scaley, float handle[2])
 
MaskSplinePointED_mask_point_find_nearest (const bContext *C, Mask *mask_orig, const float normal_co[2], const float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, eMaskWhichHandle *r_which_handle, float *r_score)
 
bool ED_mask_feather_find_nearest (const bContext *C, Mask *mask_orig, const float normal_co[2], const float threshold, MaskLayer **r_mask_layer, MaskSpline **r_spline, MaskSplinePoint **r_point, MaskSplinePointUW **r_uw, float *r_score)
 
void ED_mask_mouse_pos (ScrArea *area, ARegion *region, const int mval[2], float co[2])
 
void ED_mask_point_pos (ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr)
 
void ED_mask_point_pos__reverse (ScrArea *area, ARegion *region, float x, float y, float *xr, float *yr)
 
static void handle_position_for_minmax (const MaskSplinePoint *point, eMaskWhichHandle which_handle, bool handles_as_control_point, float r_handle[2])
 
bool ED_mask_selected_minmax (const bContext *C, float min[2], float max[2], bool handles_as_control_point)
 
Generic 2D View Queries
void ED_mask_get_size (ScrArea *area, int *width, int *height)
 
void ED_mask_zoom (ScrArea *area, ARegion *region, float *zoomx, float *zoomy)
 
void ED_mask_get_aspect (ScrArea *area, ARegion *UNUSED(region), float *aspx, float *aspy)
 
void ED_mask_pixelspace_factor (ScrArea *area, ARegion *region, float *scalex, float *scaley)
 
void ED_mask_cursor_location_get (ScrArea *area, float cursor[2])
 

Function Documentation

◆ ED_mask_cursor_location_get()

void ED_mask_cursor_location_get ( ScrArea area,
float  cursor[2] 
)

◆ ED_mask_feather_find_nearest()

bool ED_mask_feather_find_nearest ( const bContext C,
Mask mask_orig,
const float  normal_co[2],
const float  threshold,
MaskLayer **  r_mask_layer,
MaskSpline **  r_spline,
MaskSplinePoint **  r_point,
MaskSplinePointUW **  r_uw,
float r_score 
)

◆ ED_mask_find_nearest_diff_point()

bool ED_mask_find_nearest_diff_point ( const bContext C,
struct Mask mask_orig,
const float  normal_co[2],
int  threshold,
bool  feather,
float  tangent[2],
const bool  use_deform,
const bool  use_project,
MaskLayer **  r_mask_layer,
MaskSpline **  r_spline,
MaskSplinePoint **  r_point,
float r_u,
float r_score 
)

◆ ED_mask_get_aspect()

void ED_mask_get_aspect ( ScrArea area,
ARegion UNUSEDregion,
float aspx,
float aspy 
)

◆ ED_mask_get_size()

void ED_mask_get_size ( ScrArea area,
int *  width,
int *  height 
)

◆ ED_mask_mouse_pos()

void ED_mask_mouse_pos ( struct ScrArea area,
struct ARegion region,
const int  mval[2],
float  co[2] 
)

◆ ED_mask_pixelspace_factor()

void ED_mask_pixelspace_factor ( ScrArea area,
ARegion region,
float scalex,
float scaley 
)

◆ ED_mask_point_find_nearest()

MaskSplinePoint* ED_mask_point_find_nearest ( const bContext C,
Mask mask_orig,
const float  normal_co[2],
const float  threshold,
MaskLayer **  r_mask_layer,
MaskSpline **  r_spline,
eMaskWhichHandle r_which_handle,
float r_score 
)

◆ ED_mask_point_pos()

void ED_mask_point_pos ( struct ScrArea area,
struct ARegion region,
float  x,
float  y,
float xr,
float yr 
)

◆ ED_mask_point_pos__reverse()

void ED_mask_point_pos__reverse ( ScrArea area,
ARegion region,
float  x,
float  y,
float xr,
float yr 
)

◆ ED_mask_selected_minmax()

bool ED_mask_selected_minmax ( const bContext C,
float  min[2],
float  max[2],
bool  handles_as_control_point 
)

◆ ED_mask_zoom()

void ED_mask_zoom ( ScrArea area,
ARegion region,
float zoomx,
float zoomy 
)

◆ handle_position_for_minmax()

static void handle_position_for_minmax ( const MaskSplinePoint point,
eMaskWhichHandle  which_handle,
bool  handles_as_control_point,
float  r_handle[2] 
)
static

Definition at line 590 of file mask_query.c.

References BKE_mask_point_handle(), copy_v2_v2(), and point.

Referenced by ED_mask_selected_minmax().

◆ mask_point_scaled_handle()

static void mask_point_scaled_handle ( const MaskSplinePoint point,
const eMaskWhichHandle  which_handle,
const float  scalex,
const float  scaley,
float  handle[2] 
)
static

Definition at line 188 of file mask_query.c.

References BKE_mask_point_handle(), and point.

Referenced by ED_mask_point_find_nearest().