93 const float *corner_point,
94 const float *arrow_coords,
95 const int arrow_style)
99 switch (arrow_style) {
143 if ((points ==
NULL) || (totpoints <= 0)) {
162 if (totpoints == 1) {
171 float oldpressure = points[0].
pressure;
186 for (
int i = 0; i < totpoints; i++, pt++) {
249 const float pt[3],
short sflag,
int offsx,
int offsy,
int winx,
int winy,
float r_co[2])
256 const float x = (
float)((pt[0] * winx) + offsx);
257 const float y = (
float)((pt[1] * winy) + offsy);
263 const float x = (
float)(pt[0] / 100 * winx) + offsx;
264 const float y = (
float)(pt[1] / 100 * winy) + offsy;
299 float co[3] = {0.0f};
319 const bGPDspoint *points,
int totpoints,
short thickness,
const float ink[4],
bool cyclic)
321 float curpressure = points[0].
pressure;
347 for (
int i = 0; i < totpoints; i++, pt++) {
353 if (
fabsf(pt->
pressure - curpressure) > 0.2f / (
float)thickness) {
379 if (cyclic && i == 0) {
412 if (totpoints == 0) {
415 float thickness = (
float)thickness_s;
424 float oldpressure = points[0].
pressure;
425 if (totpoints == 1) {
448 for (
int i = 0; i < totpoints; i++) {
457 pt_prev = &points[i - 1];
471 pt_prev = &points[i - 1];
487 pt_prev = &points[0];
544 const float color[4])
567 if (gps->totpoints == 1) {
569 gps->points, lthick, gps->flag, offsx, offsy, winx, winy, color);
584 if (gps->totpoints == 1) {
586 gps->points, lthick, gps->flag, offsx, offsy, winx, winy, color);
590 gps->points, gps->totpoints, lthick, gps->flag, offsx, offsy, winx, winy, color);
603 const float alpha = 1.0f;
609 if (gpl->
gstep > 0) {
614 for (gf = gpf->
prev; gf; gf = gf->
prev) {
619 color[3] =
alpha * fac * 0.66f;
627 else if (gpl->
gstep == 0) {
630 color[3] = (
alpha / 7);
646 for (gf = gpf->
next; gf; gf = gf->
next) {
651 color[3] =
alpha * fac * 0.66f;
662 color[3] = (
alpha / 4);
673 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
680 short lthick = gpl->thickness;
684 ink[3] = gpl->opacity;
731 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
763 const char spacetype)
784 if (gpd_source ==
NULL || (gpd_source && gpd_source != gpd)) {
799 int offsx, offsy, sizex, sizey;
808 switch (
area->spacetype) {
817 sizex = region->
winx;
818 sizey = region->
winy;
831 sizex = region->
winx;
832 sizey = region->
winy;
843 sizex = region->
winx;
844 sizey = region->
winy;
911 int offsx, offsy, winx, winy;
958 Scene *
scene,
bGPdata *gpd,
int winx,
int winy,
const int cfra,
const char spacetype)
typedef float(TangentPoint)[2]
struct ScrArea * CTX_wm_area(const bContext *C)
struct Scene * CTX_data_scene(const bContext *C)
struct wmWindowManager * CTX_wm_manager(const bContext *C)
struct ARegion * CTX_wm_region(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_fl2(float v[2], float x, float y)
MINLINE void copy_v3_v3(float r[3], const float a[3])
#define SET_FLAG_FROM_TEST(value, test, flag)
struct Depsgraph Depsgraph
@ 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
Object is a sort of wrapper for general info.
#define V3D_HIDE_OVERLAYS
bScreen * ED_screen_animation_playing(const struct wmWindowManager *wm)
void ED_view3d_calc_camera_border(const struct Scene *scene, struct Depsgraph *depsgraph, const struct ARegion *region, const struct View3D *v3d, const struct RegionView3D *rv3d, struct rctf *r_viewborder, const bool no_shift)
_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 y
void GPU_polygon_offset(float viewdist, float dist)
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_2D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
void GPU_program_point_size(bool enable)
void GPU_blend(eGPUBlend blend)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
void GPU_point_size(float size)
bool GPU_depth_mask_get(void)
void GPU_depth_test(eGPUDepthTest test)
void GPU_viewport_size_get_f(float coords[4])
Read Guarded memory(de)allocation.
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_data_all(Scene *scene, bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag, const char spacetype)
static void annotation_draw_stroke_buffer(bGPdata *gps, short thickness, short dflag, const float ink[4])
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_stroke_point(const bGPDspoint *points, short thickness, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
void ED_annotation_draw_view3d(Scene *scene, struct Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
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)
const Depsgraph * depsgraph
static CCL_NAMESPACE_BEGIN const double alpha
int ED_gpencil_session_active(void)
bGPdata * ED_annotation_data_get_active(const bContext *C)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static void draw_points(ArmatureDrawContext *ctx, const EditBone *eBone, const bPoseChannel *pchan, const bArmature *arm, const int boneflag, const short constflag, const int select_id)
void wmOrtho2(float x1, float x2, float y1, float y2)