Blender V5.0
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
15enum class PaintMode : int8_t;
16struct bContext;
17struct bToolRef;
18struct Depsgraph;
19struct Image;
20struct ImageUndoStep;
21struct ImageUser;
22struct ImBuf;
23struct Main;
24struct Object;
26struct PaintTileMap;
27struct ReportList;
28struct Scene;
29struct UndoStep;
30struct UndoType;
31struct wmKeyConfig;
32struct wmOperator;
33
34/* `paint_ops.cc` */
35
38void ED_keymap_paint(wmKeyConfig *keyconf);
39
40/* `paint_image.cc` */
41
44 Image *ima, ImBuf *ibuf, ImageUser *iuser, int x, int y, int w, int h, bool find_old);
46 const float color[3],
47 wmOperator *op,
48 const int mouse[2]);
49
50/* `paint_image_proj.cc` */
51
53 ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil);
59 Object &ob,
60 bool *r_has_uvs,
61 bool *r_has_mat,
62 bool *r_has_tex,
63 bool *r_has_stencil);
64
65/* `image_undo.cc` */
66
71void ED_image_undo_push_begin(const char *name, PaintMode paint_mode);
73 Image *image,
74 ImBuf *ibuf,
75 ImageUser *iuser);
77 Image *image,
78 ImageUser *iuser);
79void ED_image_undo_push(Image *image, ImBuf *ibuf, ImageUser *iuser, ImageUndoStep *us);
85
88
89void *ED_image_paint_tile_find(PaintTileMap *paint_tile_map,
90 Image *image,
91 ImBuf *ibuf,
92 ImageUser *iuser,
93 int x_tile,
94 int y_tile,
95 unsigned short **r_mask,
96 bool validate);
97void *ED_image_paint_tile_push(PaintTileMap *paint_tile_map,
98 Image *image,
99 ImBuf *ibuf,
100 ImBuf **tmpibuf,
101 ImageUser *iuser,
102 int x_tile,
103 int y_tile,
104 unsigned short **r_mask,
105 bool **r_valid,
106 bool use_thread_lock,
107 bool find_prev);
110
112
113#define ED_IMAGE_UNDO_TILE_BITS 6
114#define ED_IMAGE_UNDO_TILE_SIZE (1 << ED_IMAGE_UNDO_TILE_BITS)
115#define ED_IMAGE_UNDO_TILE_NUMBER(size) \
116 (((size) + ED_IMAGE_UNDO_TILE_SIZE - 1) >> ED_IMAGE_UNDO_TILE_BITS)
117
118/* `paint_curve_undo.cc` */
119
120void ED_paintcurve_undo_push_begin(const char *name);
122
125
126/* `paint_canvas.cc` */
127
130 const PaintModeSettings *settings,
131 Object &ob,
132 eV3DShadingColorType orig_color_type);
133
140
143
144void ED_object_vpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob);
146void ED_object_wpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob);
148
153
155 Scene &scene,
156 Depsgraph &depsgraph,
157 Object &ob);
159
160void ED_object_texture_paint_mode_exit_ex(Main &bmain, Scene &scene, Object &ob);
PaintMode
eV3DShadingColorType
void * 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_object_texture_paint_mode_enter_ex(Main &bmain, Scene &scene, Depsgraph &depsgraph, Object &ob)
void ED_object_wpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
void ED_paintcurve_undosys_type(UndoType *ut)
void * ED_image_paint_tile_push(PaintTileMap *paint_tile_map, Image *image, ImBuf *ibuf, ImBuf **tmpibuf, ImageUser *iuser, int x_tile, int y_tile, unsigned short **r_mask, bool **r_valid, bool use_thread_lock, bool find_prev)
void ED_image_paint_tile_lock_end()
Definition image_undo.cc:74
void ED_image_undo_push_begin(const char *name, PaintMode paint_mode)
void ED_operatortypes_paint()
Definition paint_ops.cc:969
void ED_imapaint_dirty_region(Image *ima, ImBuf *ibuf, ImageUser *iuser, int x, int y, int w, int h, bool find_old)
eV3DShadingColorType ED_paint_shading_color_override(bContext *C, const PaintModeSettings *settings, Object &ob, eV3DShadingColorType orig_color_type)
void ED_object_texture_paint_mode_exit(bContext *C)
void ED_image_undo_push_begin_with_image(const char *name, Image *image, ImBuf *ibuf, ImageUser *iuser)
void ED_image_undo_push_begin_with_image_all_udims(const char *name, Image *image, ImageUser *iuser)
void ED_object_wpaintmode_exit(bContext *C)
void ED_image_undosys_type(UndoType *ut)
void ED_object_vpaintmode_enter(bContext *C, Depsgraph &depsgraph)
void ED_operatormacros_paint()
Definition paint_ops.cc:953
void ED_image_undo_push(Image *image, ImBuf *ibuf, ImageUser *iuser, ImageUndoStep *us)
void ED_image_undo_push_end()
void ED_object_wpaintmode_exit_ex(Object &ob)
void ED_object_texture_paint_mode_enter(bContext *C)
void ED_object_vpaintmode_exit(bContext *C)
void ED_imapaint_bucket_fill(bContext *C, const float color[3], wmOperator *op, const int mouse[2])
PaintTileMap * ED_image_paint_tile_map_get()
void ED_image_paint_brush_type_update_sticky_shading_color(bContext *C, Object *ob)
void ED_object_vpaintmode_exit_ex(Object &ob)
void ED_object_vpaintmode_enter_ex(Main &bmain, Depsgraph &depsgraph, Scene &scene, Object &ob)
void ED_object_wpaintmode_enter(bContext *C, Depsgraph &depsgraph)
void ED_paintcurve_undo_push_begin(const char *name)
void ED_object_texture_paint_mode_exit_ex(Main &bmain, Scene &scene, Object &ob)
void ED_paint_data_warning(ReportList *reports, bool has_uvs, bool has_mat, bool has_tex, bool has_stencil)
void ED_image_undo_restore(UndoStep *us)
void ED_paintcurve_undo_push_end(bContext *C)
void ED_image_paint_tile_lock_init()
Definition image_undo.cc:69
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)
void ED_imapaint_clear_partial_redraw()
bool ED_image_paint_brush_type_use_canvas(bContext *C, bToolRef *tref)
void ED_keymap_paint(wmKeyConfig *keyconf)
#define C
Definition RandGen.cpp:29
BPy_StructRNA * depsgraph
SIMD_FORCE_INLINE const btScalar & w() const
Return the w value.
Definition btQuadWord.h:119
const char * name
struct ReportList * reports