Blender V5.3
ED_paint.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9#pragma once
10
11#include "DNA_view3d_enums.h"
12
13#include <cstdint>
14
15namespace blender {
16
17enum class PaintMode : int8_t;
18struct bContext;
19struct bToolRef;
20struct Depsgraph;
21struct Image;
22struct ImageUndoStep;
23struct ImageUser;
24struct ImBuf;
25struct Main;
26struct Object;
28struct PaintTileMap;
29struct ReportList;
30struct Scene;
31struct UndoStep;
32struct UndoType;
33struct wmKeyConfig;
34struct wmOperator;
35
36void ED_paint_cursor_start(Paint *paint, bool (*poll)(bContext *C));
37
38/* `paint_ops.cc` */
39
42void ED_keymap_paint(wmKeyConfig *keyconf);
43
44/* `paint_image.cc` */
45
48 Image *ima, ImBuf *ibuf, ImageUser *iuser, int x, int y, int w, int h);
50 const float color[3],
51 wmOperator *op,
52 const int mouse[2]);
53
54/* `paint_image_proj.cc` */
55
57 ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil);
63 Object &ob,
64 bool *r_has_uvs,
65 bool *r_has_mat,
66 bool *r_has_tex,
67 bool *r_has_stencil);
68
69/* `image_undo.cc` */
70
78void ED_image_undo_push_begin(const char *name, PaintMode paint_mode);
79void ED_image_undo_push_begin_with_image(const char *name,
80 Image *image,
81 ImBuf *ibuf,
82 ImageUser *iuser);
84 Image *image,
85 ImageUser *iuser);
92
95
96const ImBuf *ED_image_paint_tile_find(PaintTileMap *paint_tile_map,
97 Image *image,
98 ImBuf *ibuf,
99 ImageUser *iuser,
100 int x_tile,
101 int y_tile,
102 unsigned short **r_mask,
103 bool validate);
104const ImBuf *ED_image_paint_tile_push(PaintTileMap *paint_tile_map,
105 Image *image,
106 ImBuf *ibuf,
107 ImageUser *iuser,
108 int x_tile,
109 int y_tile,
110 unsigned short **r_mask,
111 bool **r_valid);
112
114
115#define ED_IMAGE_UNDO_TILE_BITS 6
116#define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS)
117#define ED_IMAGE_UNDO_TILE_NUMBER(size) \
118 (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS)
119
120/* `paint_curve_undo.cc` */
121
122void ED_paintcurve_undo_push_begin(const char *name);
123void ED_paintcurve_undo_push_end(bContext *C);
124
126void ED_paintcurve_undosys_type(UndoType *ut);
127
128/* `paint_canvas.cc` */
129
132 const PaintModeSettings *settings,
133 Object &ob,
134 eV3DShadingColorType orig_color_type);
135
141bool ED_paint_brush_type_use_canvas(bContext *C, bToolRef *tref);
142
145
146void ED_object_vpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob);
147void ED_object_vpaintmode_enter(bContext *C, Depsgraph &depsgraph);
148void ED_object_wpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob);
149void ED_object_wpaintmode_enter(bContext *C, Depsgraph &depsgraph);
150
152void ED_object_vpaintmode_exit(bContext *C);
154void ED_object_wpaintmode_exit(bContext *C);
155
157 Scene &scene,
158 Depsgraph &depsgraph,
159 Object &ob);
161
162void ED_object_texture_paint_mode_exit_ex(Main &bmain, Scene &scene, Object &ob);
164
165} // namespace blender
#define C
Definition RandGen.cpp:29
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
Definition scene.h:133
BMesh Iterators.
void ED_paintcurve_undosys_type(UndoType *ut)
void ED_image_undo_restore(UndoStep *us)
void ED_image_undosys_type(UndoType *ut)
void ED_imapaint_clear_partial_redraw()
void ED_image_undo_push_end()
void ED_image_undo_push_begin(const char *name, PaintMode paint_mode)
void ED_image_undo_push(Image *image, ImBuf *ibuf, ImageUser *iuser, ImageUndoStep *us)
void ED_object_wpaintmode_exit(bContext *C)
void ED_paintcurve_undo_push_begin(const char *name)
void ED_paint_brush_type_update_sticky_shading_color(bContext *C, Object *ob)
bool ED_paint_brush_type_use_canvas(bContext *C, bToolRef *tref)
PaintTileMap * ED_image_paint_tile_map_get()
void ED_paint_cursor_start(Paint *paint, bool(*poll)(bContext *C))
void ED_object_texture_paint_mode_enter_ex(Main &bmain, Scene &scene, Depsgraph &depsgraph, Object &ob)
void ED_object_texture_paint_mode_exit_ex(Main &bmain, Scene &scene, Object &ob)
void ED_object_texture_paint_mode_exit(bContext *C)
void ED_operatormacros_paint()
Definition paint_ops.cc:531
void ED_object_vpaintmode_exit_ex(Scene &scene, Object &ob)
void ED_image_undo_push_begin_with_image_all_udims(const char *name, Image *image, ImageUser *iuser)
bool ED_paint_proj_mesh_data_check(Scene &scene, Object &ob, bool *r_has_uvs, bool *r_has_mat, bool *r_has_tex, bool *r_has_stencil)
eV3DShadingColorType ED_paint_shading_color_override(bContext *C, const PaintModeSettings *settings, Object &ob, eV3DShadingColorType orig_color_type)
void ED_imapaint_bucket_fill(bContext *C, const float color[3], wmOperator *op, const int mouse[2])
const ImBuf * ED_image_paint_tile_find(PaintTileMap *paint_tile_map, Image *image, ImBuf *ibuf, ImageUser *iuser, int x_tile, int y_tile, unsigned short **r_mask, bool validate)
void ED_imapaint_dirty_region(Image *ima, ImBuf *ibuf, ImageUser *iuser, int x, int y, int w, int h)
void ED_keymap_paint(wmKeyConfig *keyconf)
Definition paint_ops.cc:676
void ED_paintcurve_undo_push_end(bContext *C)
const ImBuf * ED_image_paint_tile_push(PaintTileMap *paint_tile_map, Image *image, ImBuf *ibuf, ImageUser *iuser, int x_tile, int y_tile, unsigned short **r_mask, bool **r_valid)
void ED_object_texture_paint_mode_enter(bContext *C)
void ED_object_vpaintmode_enter(bContext *C, Depsgraph &depsgraph)
void ED_object_vpaintmode_exit(bContext *C)
void ED_paint_data_warning(ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil)
void ED_object_vpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
void ED_operatortypes_paint()
Definition paint_ops.cc:547
void ED_image_undo_push_begin_with_image(const char *name, Image *image, ImBuf *ibuf, ImageUser *iuser)
void ED_object_wpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
signed char int8_t
Definition BKE_text.h:76
void ED_object_wpaintmode_exit_ex(Scene &scene, Object &ob)
void ED_object_wpaintmode_enter(bContext *C, Depsgraph &depsgraph)
eV3DShadingColorType