68 const float *corner_point,
69 const float *arrow_coords,
70 const int arrow_style)
74 switch (arrow_style) {
120 if ((points ==
nullptr) || (totpoints <= 0)) {
139 if (totpoints == 1) {
148 float oldpressure = points[0].
pressure;
163 for (
int i = 0;
i < totpoints;
i++, pt++) {
228 const float pt[3],
short sflag,
int offsx,
int offsy,
int winx,
int winy,
float r_co[2])
235 const float x =
float((pt[0] * winx) + offsx);
236 const float y =
float((pt[1] * winy) + offsy);
242 const float x =
float(pt[0] / 100 * winx) + offsx;
243 const float y =
float(pt[1] / 100 * winy) + offsy;
278 float co[3] = {0.0f};
300 const bGPDspoint *points,
int totpoints,
short thickness,
const float ink[4],
bool cyclic)
302 float curpressure = points[0].
pressure;
328 for (
int i = 0;
i < totpoints;
i++, pt++) {
334 if (
fabsf(pt->
pressure - curpressure) > 0.2f /
float(thickness)) {
360 if (cyclic &&
i == 0) {
393 if (totpoints == 0) {
396 float thickness =
float(thickness_s);
405 float oldpressure = points[0].
pressure;
406 if (totpoints == 1) {
429 for (
int i = 0;
i < totpoints;
i++) {
438 pt_prev = &points[
i - 1];
452 pt_prev = &points[
i - 1];
468 pt_prev = &points[0];
525 const float color[4])
548 if (gps->totpoints == 1) {
550 gps->points, lthick, gps->flag, offsx, offsy, winx, winy, color);
565 if (gps->totpoints == 1) {
567 gps->points, lthick, gps->flag, offsx, offsy, winx, winy, color);
571 gps->points, gps->totpoints, lthick, gps->flag, offsx, offsy, winx, winy, color);
584 const float alpha = 1.0f;
595 if (gpl->
gstep > 0) {
600 for (gf = gpf->
prev; gf; gf = gf->
prev) {
605 color[3] = alpha * fac * 0.66f;
613 else if (gpl->
gstep == 0) {
616 color[3] = (alpha / 7);
637 for (gf = gpf->
next; gf; gf = gf->
next) {
642 color[3] = alpha * fac * 0.66f;
653 color[3] = (alpha / 4);
664 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
671 short lthick = gpl->thickness;
675 ink[3] = gpl->opacity;
684 if (gpf ==
nullptr) {
720 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
758 gpd_source = (scene->
gpd ? scene->
gpd :
nullptr);
773 if (gpd_source ==
nullptr || (gpd_source && gpd_source != gpd)) {
787 int offsx, offsy, sizex, sizey;
791 if (gpd ==
nullptr) {
805 sizex = region->
winx;
806 sizey = region->
winy;
819 sizex = region->
winx;
820 sizey = region->
winy;
831 sizex = region->
winx;
832 sizey = region->
winy;
858 if (area ==
nullptr) {
862 if (gpd ==
nullptr) {
897 int offsx, offsy, winx, winy;
903 if (gpd ==
nullptr) {
945 Scene *scene,
bGPdata *gpd,
int winx,
int winy,
const int cfra,
const char spacetype)
ScrArea * CTX_wm_area(const bContext *C)
Scene * CTX_data_scene(const bContext *C)
ARegion * CTX_wm_region(const bContext *C)
wmWindowManager * CTX_wm_manager(const bContext *C)
struct bGPDframe * BKE_gpencil_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
#define LISTBASE_FOREACH(type, var, list)
MINLINE int round_fl_to_int(float a)
MINLINE float max_ff(float a, float b)
MINLINE void copy_v2_v2(float r[2], const float a[2])
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define SET_FLAG_FROM_TEST(value, test, flag)
@ GP_STROKE_ARROWSTYLE_NONE
@ GP_STROKE_ARROWSTYLE_SEGMENT
@ GP_STROKE_ARROWSTYLE_CLOSED
@ GP_STROKE_ARROWSTYLE_OPEN
@ GP_STROKE_ARROWSTYLE_SQUARE
@ GP_STROKE_USE_ARROW_END
@ GP_STROKE_USE_ARROW_START
@ GP_LAYER_ONIONSKIN_CUSTOM_COLOR
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
void ED_view3d_calc_camera_border(const Scene *scene, const Depsgraph *depsgraph, const ARegion *region, const View3D *v3d, const RegionView3D *rv3d, bool no_shift, rctf *r_viewborder)
void GPU_polygon_offset(float viewdist, float dist)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
void GPU_program_point_size(bool enable)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
void GPU_blend(GPUBlend blend)
void GPU_depth_test(GPUDepthTest test)
void GPU_point_size(float size)
void GPU_viewport_size_get_f(float coords[4])
bool GPU_depth_mask_get()
void UI_GetThemeColor3fv(int colorid, float col[3])
static void annotation_draw_strokes(const bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag, short lthick, const float color[4])
void ED_annotation_draw_ex(Scene *scene, bGPdata *gpd, int winx, int winy, const int cfra, const char spacetype)
static void annotation_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thickness, const float ink[4], bool cyclic)
static void annotation_draw_data_layers(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
static void annotation_draw_stroke_2d(const bGPDspoint *points, int totpoints, short thickness_s, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
void ED_annotation_draw_2dimage(const bContext *C)
static void annotation_draw_stroke_buffer(bGPdata *gps, short thickness, short dflag, const float ink[4])
void ED_annotation_draw_view3d(Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
static void annotation_draw_stroke_arrow_buffer(uint pos, const float *corner_point, const float *arrow_coords, const int arrow_style)
static void annotation_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag)
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
static void annotation_calc_2d_stroke_fxy(const float pt[3], short sflag, int offsx, int offsy, int winx, int winy, float r_co[2])
static void annotation_draw_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag, const eSpace_Type space_type)
static void annotation_draw_stroke_point(const bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
static void annotation_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
static bool annotation_can_draw_stroke(const bGPDstroke *gps, const int dflag)
BPy_StructRNA * depsgraph
bGPdata * ED_annotation_data_get_active(const bContext *C)
static void draw_points(const Armatures::DrawContext *ctx, const UnifiedBonePtr bone, const eBone_Flag boneflag, const float col_solid[4], const int select_id)
void wmOrtho2(float x1, float x2, float y1, float y2)