Blender
V3.3
|
#include "MEM_guardedalloc.h"
#include "BLI_listbase.h"
#include "BLI_math.h"
#include "BLI_rect.h"
#include "BLI_utildefines.h"
#include "BKE_context.h"
#include "BKE_mask.h"
#include "DNA_mask_types.h"
#include "DNA_object_types.h"
#include "DNA_screen_types.h"
#include "DNA_space_types.h"
#include "ED_clip.h"
#include "ED_mask.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "BIF_glutil.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
#include "GPU_shader.h"
#include "GPU_state.h"
#include "UI_interface.h"
#include "UI_resources.h"
#include "UI_view2d.h"
#include "DEG_depsgraph_query.h"
Go to the source code of this file.
Functions | |
static void | mask_spline_color_get (MaskLayer *mask_layer, MaskSpline *spline, const bool is_sel, uchar r_rgb[4]) |
static void | mask_spline_feather_color_get (MaskLayer *UNUSED(mask_layer), MaskSpline *UNUSED(spline), const bool is_sel, uchar r_rgb[4]) |
static void | mask_point_undistort_pos (SpaceClip *sc, float r_co[2], const float co[2]) |
static void | draw_single_handle (const MaskLayer *mask_layer, const MaskSplinePoint *point, const eMaskWhichHandle which_handle, const int draw_type, const float handle_size, const float point_pos[2], const float handle_pos[2]) |
static void | draw_spline_points (const bContext *C, MaskLayer *mask_layer, MaskSpline *spline, const char draw_type) |
static void | mask_color_active_tint (uchar r_rgb[4], const uchar rgb[4], const bool is_active) |
static void | mask_draw_array (uint pos, GPUPrimType prim_type, const float(*points)[2], uint vertex_len) |
static void | mask_draw_curve_type (const bContext *C, MaskSpline *spline, float(*orig_points)[2], int tot_point, const bool is_feather, const bool is_active, const uchar rgb_spline[4], const char draw_type) |
static void | draw_spline_curve (const bContext *C, MaskLayer *mask_layer, MaskSpline *spline, const char draw_type, const bool is_active, const int width, const int height) |
static void | draw_layer_splines (const bContext *C, MaskLayer *layer, const char draw_type, const int width, const int height, const bool is_active) |
static void | draw_mask_layers (const bContext *C, Mask *mask, const char draw_type, const int width, const int height) |
static float * | mask_rasterize (Mask *mask, const int width, const int height) |
void | ED_mask_draw_region (Depsgraph *depsgraph, Mask *mask_, ARegion *region, const char draw_flag, const char draw_type, const eMaskOverlayMode overlay_mode, const float blend_factor, const int width_i, const int height_i, const float aspx, const float aspy, const bool do_scale_applied, const bool do_draw_cb, float stabmat[4][4], const bContext *C) |
void | ED_mask_draw_frames (Mask *mask, ARegion *region, const int cfra, const int sfra, const int efra) |
|
static |
Definition at line 563 of file mask_draw.c.
References C, draw_spline_curve(), draw_spline_points(), height, LISTBASE_FOREACH, MASK_HIDE_SELECT, NULL, MaskSpline::points_deform, MaskLayer::splines, MaskLayer::visibility_flag, and width.
Referenced by draw_mask_layers().
|
static |
Definition at line 591 of file mask_draw.c.
References blender::compositor::active, C, draw_layer_splines(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_program_point_size(), height, mask(), MASK_HIDE_VIEW, MaskLayer::next, NULL, MaskLayer::visibility_flag, and width.
Referenced by ED_mask_draw_region().
|
static |
Definition at line 87 of file mask_draw.c.
References MaskLayer::act_point, ELEM, GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINES, GPU_PRIM_POINTS, GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), BezTriple::h1, BezTriple::h2, HD_ALIGN, HD_ALIGN_DOUBLESIDE, HD_AUTO, HD_FREE, HD_VECT, immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform4fv(), immUniformColor3fvAlpha(), immUniformColor3ubv(), immUniformThemeColor(), immVertex2fv(), immVertexFormat(), MASK_DT_OUTLINE, MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_STICK, MASKPOINT_ISSEL_HANDLE, point, pos, TH_HANDLE_ALIGN, TH_HANDLE_AUTO, TH_HANDLE_FREE, TH_HANDLE_VERTEX, TH_HANDLE_VERTEX_SELECT, and UI_GetThemeColor3fv().
Referenced by draw_spline_points().
|
static |
Definition at line 496 of file mask_draw.c.
References add_v2_v2v2(), BKE_mask_spline_differentiate_with_resolution(), BKE_mask_spline_feather_differentiated_points_with_resolution(), BKE_mask_spline_feather_resolution(), BKE_mask_spline_resolution(), BLI_assert, C, MaskSpline::flag, float(), GPU_line_smooth(), height, mask_draw_curve_type(), MASK_HIDE_SELECT, mask_spline_color_get(), mask_spline_feather_color_get(), MASK_SPLINE_NOFILL, max_ii(), MEM_freeN, SELECT, sub_v2_v2v2(), MaskLayer::visibility_flag, and width.
Referenced by draw_layer_splines().
|
static |
Definition at line 171 of file mask_draw.c.
References MaskLayer::act_point, MaskLayer::act_spline, MaskSplinePoint::bezt, BKE_mask_point_handle(), BKE_mask_point_handles_mode_get(), BKE_mask_spline_feather_points(), BKE_mask_spline_point_array(), C, SpaceClip::clip, copy_v2_v2(), CTX_wm_space_clip(), draw_single_handle(), MaskSpline::flag, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_smooth(), GPU_PRIM_POINTS, GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA, GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_OUTLINE_AA, GPU_vertformat_attr_add(), immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniform1f(), immUniform4f(), immUniformColor3f(), immUniformThemeColorShadeAlpha(), immVertex2f(), immVertex2fv(), immVertexFormat(), INIT_MINMAX2, MASK_HANDLE_MODE_STICK, MASK_HIDE_SELECT, mask_point_undistort_pos(), mask_spline_color_get(), MASK_WHICH_HANDLE_LEFT, MASK_WHICH_HANDLE_RIGHT, MASK_WHICH_HANDLE_STICK, MASKPOINT_ISSEL_ANY, MASKPOINT_ISSEL_KNOT, max, MCLIP_PROXY_RENDER_UNDISTORT, MEM_freeN, min, minmax_v2v2_v2(), point, MaskSpline::points, pos, MovieClipUser::render_flag, SELECT, TH_HANDLE_VERTEX, TH_HANDLE_VERTEX_SELECT, TH_HANDLE_VERTEX_SIZE, MaskSpline::tot_point, UI_GetThemeValuef(), SpaceClip::user, BezTriple::vec, MaskLayer::visibility_flag, x, and y.
Referenced by draw_layer_splines().
void ED_mask_draw_frames | ( | Mask * | mask, |
ARegion * | region, | ||
const int | cfra, | ||
const int | sfra, | ||
const int | efra | ||
) |
Definition at line 773 of file mask_draw.c.
References BKE_mask_layer_active(), BLI_listbase_count(), ED_region_visible_rect(), ListBase::first, float(), GPU_COMP_I32, GPU_FETCH_INT_TO_FLOAT, GPU_PRIM_LINES, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), height, immBegin(), immBindBuiltinProgram(), immEnd(), immUnbindProgram(), immUniformColor4ub(), immVertex2i(), immVertexFormat(), mask(), NULL, pos, MaskLayer::splines_shapes, UI_DPI_FAC, ARegion::winx, x, and rcti::ymin.
Referenced by draw_image_cache(), and draw_movieclip_cache().
void ED_mask_draw_region | ( | Depsgraph * | depsgraph, |
Mask * | mask_, | ||
ARegion * | region, | ||
const char | draw_flag, | ||
const char | draw_type, | ||
const eMaskOverlayMode | overlay_mode, | ||
const float | blend_factor, | ||
const int | width_i, | ||
const int | height_i, | ||
const float | aspx, | ||
const float | aspy, | ||
const bool | do_scale_applied, | ||
const bool | do_draw_cb, | ||
float | stabmat[4][4], | ||
const bContext * | C | ||
) |
Definition at line 642 of file mask_draw.c.
References BLI_rctf_size_x(), BLI_rctf_size_y(), BLI_rcti_size_x(), BLI_rcti_size_y(), buffer, C, View2D::cur, DEG_get_evaluated_id(), depsgraph, draw_mask_layers(), ED_region_draw_cb_draw(), float(), GPU_blend(), GPU_BLEND_ALPHA, GPU_BLEND_NONE, GPU_matrix_mul, GPU_matrix_pop(), GPU_matrix_push(), GPU_matrix_scale_2f(), GPU_matrix_translate_2f(), GPU_R16F, GPU_SHADER_2D_IMAGE_SHUFFLE_COLOR, GPU_shader_get_uniform(), GPU_shader_uniform_vector(), height, Mask::id, immDrawPixelsTexSetup(), immDrawPixelsTexTiled(), MASK_DRAWFLAG_OVERLAY, MASK_DRAWFLAG_SPLINE, MASK_OVERLAY_ALPHACHANNEL, MASK_OVERLAY_COMBINED, mask_rasterize(), max_ff(), MEM_freeN, NULL, REGION_DRAW_POST_VIEW, REGION_DRAW_PRE_VIEW, state, View2D::tot, UI_view2d_view_to_region(), ARegion::v2d, width, ARegion::winrct, x, rctf::xmin, y, and rctf::ymin.
|
static |
Definition at line 349 of file mask_draw.c.
References usdtokens::rgb().
Referenced by mask_draw_curve_type().
|
static |
Definition at line 362 of file mask_draw.c.
References immBegin(), immEnd(), immVertex2fv(), and pos.
Referenced by mask_draw_curve_type().
|
static |
Definition at line 374 of file mask_draw.c.
References BLI_assert, C, SpaceClip::clip, CTX_wm_space_clip(), MaskSpline::flag, float(), GPU_COMP_F32, GPU_FETCH_FLOAT, GPU_line_width(), GPU_PRIM_LINE_LOOP, GPU_PRIM_LINE_STRIP, GPU_SHADER_2D_LINE_DASHED_UNIFORM_COLOR, GPU_SHADER_2D_UNIFORM_COLOR, GPU_vertformat_attr_add(), GPU_viewport_size_get_f(), immBindBuiltinProgram(), immUnbindProgram(), immUniform1f(), immUniform1i(), immUniform2f(), immUniform4fv(), immUniformColor4ubv(), immVertexFormat(), mask_color_active_tint(), mask_draw_array(), MASK_DT_BLACK, MASK_DT_DASH, MASK_DT_OUTLINE, MASK_DT_WHITE, mask_point_undistort_pos(), MASK_SPLINE_CYCLIC, MCLIP_PROXY_RENDER_UNDISTORT, MEM_callocN, MEM_freeN, pos, MovieClipUser::render_flag, rgba_uchar_to_float(), UI_DPI_FAC, and SpaceClip::user.
Referenced by draw_spline_curve().
Definition at line 80 of file mask_draw.c.
References BKE_mask_coord_from_movieclip(), BKE_mask_coord_to_movieclip(), SpaceClip::clip, ED_clip_point_undistorted_pos(), and SpaceClip::user.
Referenced by draw_spline_points(), and mask_draw_curve_type().
Definition at line 625 of file mask_draw.c.
References BKE_maskrasterize_buffer(), BKE_maskrasterize_handle_free(), BKE_maskrasterize_handle_init(), BKE_maskrasterize_handle_new(), buffer, height, mask(), MEM_mallocN, and width.
Referenced by ED_mask_draw_region().
|
static |
Definition at line 41 of file mask_draw.c.
References MaskLayer::act_spline.
Referenced by draw_spline_curve(), and draw_spline_points().
|
static |
Definition at line 63 of file mask_draw.c.
Referenced by draw_spline_curve().