2011-02-18 13:05:18 +00:00
|
|
|
/*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** BEGIN GPL LICENSE BLOCK *****
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
2008-04-16 22:40:48 +00:00
|
|
|
* of the License, or (at your option) any later version.
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*
|
2008-04-16 22:40:48 +00:00
|
|
|
* ***** END GPL LICENSE BLOCK *****
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
*/
|
|
|
|
|
|
2012-02-17 18:59:41 +00:00
|
|
|
#ifndef __BKE_BRUSH_H__
|
|
|
|
|
#define __BKE_BRUSH_H__
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
|
2011-02-18 13:05:18 +00:00
|
|
|
/** \file BKE_brush.h
|
|
|
|
|
* \ingroup bke
|
2013-07-02 10:14:59 +00:00
|
|
|
*
|
|
|
|
|
* General operations for brushes.
|
2011-02-18 13:05:18 +00:00
|
|
|
*/
|
|
|
|
|
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
struct ID;
|
|
|
|
|
struct Brush;
|
2006-07-31 15:53:03 +00:00
|
|
|
struct ImBuf;
|
2013-01-22 08:05:00 +00:00
|
|
|
struct ImagePool;
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Main;
|
2013-04-30 09:59:40 +00:00
|
|
|
struct rctf;
|
2009-03-11 00:43:08 +00:00
|
|
|
struct Scene;
|
2009-01-25 07:28:11 +00:00
|
|
|
struct wmOperator;
|
2010-10-30 17:16:37 +00:00
|
|
|
// enum CurveMappingPreset;
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
|
2013-03-19 14:25:12 +00:00
|
|
|
|
|
|
|
|
/* globals for brush execution */
|
|
|
|
|
void BKE_brush_system_init(void);
|
|
|
|
|
void BKE_brush_system_exit(void);
|
|
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* datablock functions */
|
2013-02-05 12:46:15 +00:00
|
|
|
struct Brush *BKE_brush_add(struct Main *bmain, const char *name);
|
2012-05-05 00:58:22 +00:00
|
|
|
struct Brush *BKE_brush_copy(struct Brush *brush);
|
|
|
|
|
void BKE_brush_make_local(struct Brush *brush);
|
|
|
|
|
void BKE_brush_free(struct Brush *brush);
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
|
2012-05-05 00:58:22 +00:00
|
|
|
void BKE_brush_sculpt_reset(struct Brush *brush);
|
2010-07-27 16:09:02 +00:00
|
|
|
|
2010-07-20 02:18:10 +00:00
|
|
|
/* image icon function */
|
2010-07-20 11:32:30 +00:00
|
|
|
struct ImBuf *get_brush_icon(struct Brush *brush);
|
2010-07-20 02:18:10 +00:00
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* brush library operations used by different paint panels */
|
2012-05-05 00:58:22 +00:00
|
|
|
int BKE_brush_texture_set_nr(struct Brush *brush, int nr);
|
|
|
|
|
int BKE_brush_texture_delete(struct Brush *brush);
|
|
|
|
|
int BKE_brush_clone_image_set_nr(struct Brush *brush, int nr);
|
|
|
|
|
int BKE_brush_clone_image_delete(struct Brush *brush);
|
2006-07-31 15:53:03 +00:00
|
|
|
|
2011-01-08 01:45:02 +00:00
|
|
|
/* jitter */
|
2012-05-05 00:58:22 +00:00
|
|
|
void BKE_brush_jitter_pos(const struct Scene *scene, struct Brush *brush,
|
2012-05-12 20:39:39 +00:00
|
|
|
const float pos[2], float jitterpos[2]);
|
2013-04-22 10:46:01 +00:00
|
|
|
void BKE_brush_randomize_texture_coordinates(struct UnifiedPaintSettings *ups, bool mask);
|
2011-01-08 01:45:02 +00:00
|
|
|
|
2009-01-07 04:38:30 +00:00
|
|
|
/* brush curve */
|
2013-03-26 07:29:01 +00:00
|
|
|
void BKE_brush_curve_preset(struct Brush *b, int preset);
|
2012-05-05 00:58:22 +00:00
|
|
|
float BKE_brush_curve_strength_clamp(struct Brush *br, float p, const float len);
|
|
|
|
|
float BKE_brush_curve_strength(struct Brush *br, float p, const float len); /* used for sculpt */
|
2009-01-07 04:38:30 +00:00
|
|
|
|
2006-07-31 15:53:03 +00:00
|
|
|
/* sampling */
|
2013-03-13 05:23:53 +00:00
|
|
|
float BKE_brush_sample_tex_3D(const Scene *scene, struct Brush *br, const float point[3],
|
2013-03-14 05:59:34 +00:00
|
|
|
float rgba[4], const int thread, struct ImagePool *pool);
|
2014-03-29 08:42:11 +11:00
|
|
|
float BKE_brush_sample_masktex(const Scene *scene, struct Brush *br, const float point[2],
|
2013-03-25 02:41:30 +00:00
|
|
|
const int thread, struct ImagePool *pool);
|
2013-04-30 16:07:52 +00:00
|
|
|
|
2009-01-25 07:28:11 +00:00
|
|
|
/* texture */
|
2013-09-05 14:02:59 +00:00
|
|
|
unsigned int *BKE_brush_gen_texture_cache(struct Brush *br, int half_side, bool use_secondary);
|
2009-01-25 07:28:11 +00:00
|
|
|
|
|
|
|
|
/* radial control */
|
2013-09-05 14:02:59 +00:00
|
|
|
struct ImBuf *BKE_brush_gen_radial_control_imbuf(struct Brush *br, bool secondary);
|
2009-01-25 07:28:11 +00:00
|
|
|
|
2010-07-14 14:11:03 +00:00
|
|
|
/* unified strength and size */
|
|
|
|
|
|
2012-05-05 00:58:22 +00:00
|
|
|
int BKE_brush_size_get(const struct Scene *scene, struct Brush *brush);
|
|
|
|
|
void BKE_brush_size_set(struct Scene *scene, struct Brush *brush, int value);
|
2012-01-14 23:54:51 +00:00
|
|
|
|
2012-05-05 00:58:22 +00:00
|
|
|
float BKE_brush_unprojected_radius_get(const struct Scene *scene, struct Brush *brush);
|
|
|
|
|
void BKE_brush_unprojected_radius_set(struct Scene *scene, struct Brush *brush, float value);
|
2012-01-14 23:54:51 +00:00
|
|
|
|
2012-05-05 00:58:22 +00:00
|
|
|
float BKE_brush_alpha_get(const struct Scene *scene, struct Brush *brush);
|
2013-01-01 21:23:12 +00:00
|
|
|
void BKE_brush_alpha_set(Scene *scene, struct Brush *brush, float alpha);
|
2012-05-05 00:58:22 +00:00
|
|
|
float BKE_brush_weight_get(const Scene *scene, struct Brush *brush);
|
|
|
|
|
void BKE_brush_weight_set(const Scene *scene, struct Brush *brush, float value);
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2012-05-05 00:58:22 +00:00
|
|
|
int BKE_brush_use_locked_size(const struct Scene *scene, struct Brush *brush);
|
|
|
|
|
int BKE_brush_use_alpha_pressure(const struct Scene *scene, struct Brush *brush);
|
|
|
|
|
int BKE_brush_use_size_pressure(const struct Scene *scene, struct Brush *brush);
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2012-01-14 23:54:51 +00:00
|
|
|
/* scale unprojected radius to reflect a change in the brush's 2D size */
|
2012-05-05 00:58:22 +00:00
|
|
|
void BKE_brush_scale_unprojected_radius(float *unprojected_radius,
|
2012-05-12 20:39:39 +00:00
|
|
|
int new_brush_size,
|
|
|
|
|
int old_brush_size);
|
2010-07-22 18:56:46 +00:00
|
|
|
|
2012-01-14 23:54:51 +00:00
|
|
|
/* scale brush size to reflect a change in the brush's unprojected radius */
|
2012-05-05 00:58:22 +00:00
|
|
|
void BKE_brush_scale_size(int *BKE_brush_size_get,
|
2012-05-12 20:39:39 +00:00
|
|
|
float new_unprojected_radius,
|
|
|
|
|
float old_unprojected_radius);
|
2010-07-14 14:11:03 +00:00
|
|
|
|
2011-02-14 03:15:55 +00:00
|
|
|
/* debugging only */
|
2012-05-05 00:58:22 +00:00
|
|
|
void BKE_brush_debug_print_state(struct Brush *br);
|
2011-02-14 03:15:55 +00:00
|
|
|
|
Brush Datablock:
- Added a new Brush datablock, only used by image paint, but intended
to be used in texture paint, vertex paint, weight paint and sculpt
mode also.
- Being a datablock, these brushes can be saved, appended and linked.
They have a fake user by default, to make sure they are saved even if
not selected.
Image Painting:
- Replaced the img module with C code in imagepaint.c
- Airbrush is no longer a separate tool, but rather an option that can
be used for soften, smear and clone also.
- Blend modes mix, add, subtract, multiply, darken and lighten have been
added, code taken directly from vertex paint.
Note to project files maintainers:
- The img module was removed from SCons and Makefiles, and this should
be done in other build systems also. I'll wait to remove the module
from cvs, to not break compilation.
2006-07-26 22:29:23 +00:00
|
|
|
#endif
|
|
|
|
|
|