diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-30 10:07:42 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2013-04-30 10:07:42 +0400 |
commit | 63f05576b840c597f91414fd2ca6db8ca869e3e9 (patch) | |
tree | e6d0bbd3dc57e67a0799a5fc066e72c8f630abc7 /source/blender/blenkernel/intern/brush.c | |
parent | b735402c19782402e4a9970280cd3a3c8457296f (diff) |
More image painting fixes:
* 2D image painting support for masking to limit the max contribution of a stroke
to a pixel, to get it working compatible with projection painting. Not strictly
a bugfix, but the inconsistency here was annoying.
* Fix python errors in Texture Mask panel in image editor, was missing overlay
options.
* Clamp paint mask to 0..1 in case some texture exceeds it, this could give black
pixels due to integer overflow.
Diffstat (limited to 'source/blender/blenkernel/intern/brush.c')
-rw-r--r-- | source/blender/blenkernel/intern/brush.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/brush.c b/source/blender/blenkernel/intern/brush.c index 517180964a5..c24aab1629c 100644 --- a/source/blender/blenkernel/intern/brush.c +++ b/source/blender/blenkernel/intern/brush.c @@ -828,14 +828,15 @@ float BKE_brush_sample_tex_2D(const Scene *scene, Brush *brush, const float xy[2 /* TODO, use define for 'texfall' arg * NOTE: only used for 2d brushes currently! */ -void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, ImBuf **outbuf, int use_color_correction) +void BKE_brush_imbuf_new(const Scene *scene, Brush *brush, short flt, short texfall, int bufsize, + ImBuf **outbuf, bool use_color_correction, bool use_brush_alpha) { ImBuf *ibuf; float xy[2], rgba[4], *dstf; int x, y, rowbytes, xoff, yoff, imbflag; const int radius = BKE_brush_size_get(scene, brush); unsigned char *dst, crgb[3]; - const float alpha = BKE_brush_alpha_get(scene, brush); + const float alpha = (use_brush_alpha)? BKE_brush_alpha_get(scene, brush): 1.0f; float brush_rgb[3]; imbflag = (flt) ? IB_rectfloat : IB_rect; |