71 const float *corner_point,
72 const float *arrow_coords,
73 const int arrow_style)
77 switch (arrow_style) {
123 if ((points ==
nullptr) || (totpoints <= 0)) {
142 if (totpoints == 1) {
151 float oldpressure = points[0].
pressure;
166 for (
int i = 0; i < totpoints; i++, pt++) {
173 if (draw_points < 2) {
197 if (draw_points < 2) {
231 const float pt[3],
short sflag,
int offsx,
int offsy,
int winx,
int winy,
float r_co[2])
238 const float x =
float((pt[0] * winx) + offsx);
239 const float y =
float((pt[1] * winy) + offsy);
245 const float x =
float(pt[0] / 100 * winx) + offsx;
246 const float y =
float(pt[1] / 100 * winy) + offsy;
281 float co[3] = {0.0f};
303 const bGPDspoint *points,
int totpoints,
short thickness,
const float ink[4],
bool cyclic)
305 float curpressure = points[0].
pressure;
331 for (
int i = 0; i < totpoints; i++, pt++) {
337 if (
fabsf(pt->
pressure - curpressure) > 0.2f /
float(thickness)) {
340 if (draw_points < 2) {
363 if (cyclic && i == 0) {
376 if (draw_points < 2) {
396 if (totpoints == 0) {
399 float thickness =
float(thickness_s);
408 float oldpressure = points[0].
pressure;
409 if (totpoints == 1) {
432 for (
int i = 0; i < totpoints; i++) {
440 if (draw_points < 2) {
441 pt_prev = &points[i - 1];
455 pt_prev = &points[i - 1];
470 if (draw_points < 2) {
471 pt_prev = &points[0];
528 const float color[4])
587 const float alpha = 1.0f;
598 if (gpl->
gstep > 0) {
603 for (gf = gpf->
prev; gf; gf = gf->
prev) {
608 color[3] = alpha * fac * 0.66f;
616 else if (gpl->
gstep == 0) {
619 color[3] = (alpha / 7);
640 for (gf = gpf->
next; gf; gf = gf->
next) {
645 color[3] = alpha * fac * 0.66f;
656 color[3] = (alpha / 4);
667 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
687 if (gpf ==
nullptr) {
723 bGPdata *gpd,
int offsx,
int offsy,
int winx,
int winy,
int cfra,
int dflag)
761 gpd_source = (scene->
gpd ? scene->
gpd :
nullptr);
776 if (gpd_source ==
nullptr || (gpd_source && gpd_source != gpd)) {
790 int offsx, offsy, sizex, sizey;
794 if (gpd ==
nullptr) {
808 sizex = region->
winx;
809 sizey = region->
winy;
822 sizex = region->
winx;
823 sizey = region->
winy;
834 sizex = region->
winx;
835 sizey = region->
winy;
861 if (area ==
nullptr) {
865 if (gpd ==
nullptr) {
900 int offsx, offsy, winx, winy;
906 if (gpd ==
nullptr) {
915 scene, depsgraph, v3d, rv3d, region->
winx, region->
winy,
true,
false,
true);
949 Scene *scene,
bGPdata *gpd,
int winx,
int winy,
const int cfra,
const char spacetype)
Camera data-block and utility functions.
#define SET_FLAG_FROM_TEST(value, test, flag)
internal::ShallowDataConstRef< T > shallow_copy(const T &other)
void get_color_3fv(int colorid, float col[3])
static void annotation_draw_onionskins(bGPDlayer *gpl, bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag)
ScrArea * CTX_wm_area(const bContext *C)
void ED_annotation_draw_2dimage(const bContext *C)
struct bGPDframe * BKE_annotations_layer_frame_get(struct bGPDlayer *gpl, int cframe, eGP_GetFrame_Mode addnew)
MINLINE void copy_v3_v3(float r[3], const float a[3])
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_stroke_arrow_buffer(uint pos, const float *corner_point, const float *arrow_coords, const int arrow_style)
MINLINE int round_fl_to_int(float a)
@ GP_STROKE_USE_ARROW_START
@ GP_STROKE_USE_ARROW_END
void immBeginAtMost(GPUPrimType, uint max_vertex_len)
MINLINE void copy_v2_v2(float r[2], const float a[2])
GPUVertFormat * immVertexFormat()
void ED_annotation_draw_view3d(Scene *scene, Depsgraph *depsgraph, View3D *v3d, ARegion *region, bool only3d)
void GPU_point_size(float size)
void immBegin(GPUPrimType, uint vertex_len)
void GPU_line_smooth(bool enable)
void GPU_depth_mask(bool depth)
static bool annotation_can_draw_stroke(const bGPDstroke *gps, const int dflag)
static void annotation_draw_data(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
static void annotation_draw_data_layers(bGPdata *gpd, int offsx, int offsy, int winx, int winy, int cfra, int dflag)
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])
void wmOrtho2(float x1, float x2, float y1, float y2)
@ GP_STROKE_ARROWSTYLE_SQUARE
@ GP_STROKE_ARROWSTYLE_CLOSED
@ GP_STROKE_ARROWSTYLE_SEGMENT
@ GP_STROKE_ARROWSTYLE_NONE
@ GP_STROKE_ARROWSTYLE_OPEN
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void immUniform1f(const char *name, float x)
void immVertex2f(uint attr_id, float x, float y)
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)
void GPU_viewport_size_get_f(float coords[4])
@ GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR
@ GPU_SHADER_3D_POINT_UNIFORM_SIZE_UNIFORM_COLOR_AA
wmWindowManager * CTX_wm_manager(const bContext *C)
bool GPU_depth_mask_get()
rctf BKE_camera_view_border(const struct Scene *scene, const struct Depsgraph *depsgraph, const struct View3D *v3d, const struct RegionView3D *rv3d, int winx, int winy, bool no_shift, bool no_zoom, bool no_roll)
void GPU_program_point_size(bool enable)
bGPdata * ED_annotation_data_get_active(const bContext *C)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void immVertex3fv(uint attr_id, const float data[3])
MINLINE float max_ff(float a, float b)
static void annotation_draw_stroke_3d(const bGPDspoint *points, int totpoints, short thickness, const float ink[4], bool cyclic)
static void annotation_draw_stroke_buffer(bGPdata *gps, short thickness, short dflag, const float ink[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_2d(const bGPDspoint *points, int totpoints, short thickness_s, short sflag, int offsx, int offsy, int winx, int winy, const float ink[4])
Scene * CTX_data_scene(const bContext *C)
void immUniform2fv(const char *name, const float data[2])
void ED_annotation_draw_view2d(const bContext *C, bool onlyv2d)
void GPU_blend(GPUBlend blend)
void GPU_polygon_offset(float viewdist, float dist)
@ GP_LAYER_ONIONSKIN_CUSTOM_COLOR
void immVertex2fv(uint attr_id, const float data[2])
void immUniformColor3fvAlpha(const float rgb[3], float a)
void GPU_depth_test(GPUDepthTest test)
ARegion * CTX_wm_region(const bContext *C)
bScreen * ED_screen_animation_playing(const wmWindowManager *wm)
static void annotation_draw_strokes(const bGPDframe *gpf, int offsx, int offsy, int winx, int winy, int dflag, short lthick, const float color[4])
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float
eRegionView3D_Persp persp
ListBaseT< bGPDstroke > strokes
eGPDlayer_OnionFlag onion_flag
eGPDstroke_Flag sbuffer_sflag
eGPDstroke_Arrowstyle arrow_end_style
eGPDstroke_Arrowstyle arrow_start_style
ListBaseT< bGPDlayer > layers