diff options
author | Campbell Barton <ideasman42@gmail.com> | 2018-07-02 19:48:24 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2018-07-02 19:55:24 +0300 |
commit | e35f9f0408a77422f0f7c1593dcabede69820527 (patch) | |
tree | 396535726e3aeab9e0d125eaeb5bc3fcd42ac025 /source/blender/editors/sculpt_paint/paint_image_proj.c | |
parent | 12603826eac9bd7399e065987d3c583e2734b0a7 (diff) | |
parent | dbe1b07e058db33a9e806d8e9808463d563d4aa5 (diff) |
Merge branch 'master' into blender2.8
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_image_proj.c | 91 |
1 files changed, 53 insertions, 38 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.c b/source/blender/editors/sculpt_paint/paint_image_proj.c index 8c5fdc617c6..04329697b54 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.c +++ b/source/blender/editors/sculpt_paint/paint_image_proj.c @@ -2604,8 +2604,9 @@ static void project_paint_face_init( if (pixel_bounds_array(uv_clip, &bounds_px, ibuf->x, ibuf->y, uv_clip_tot)) { #if 0 - project_paint_undo_tiles_init(&bounds_px, ps->projImages + image_index, tmpibuf, - tile_width, threaded, ps->do_masking); + project_paint_undo_tiles_init( + &bounds_px, ps->projImages + image_index, tmpibuf, + tile_width, threaded, ps->do_masking); #endif /* clip face and */ @@ -2654,10 +2655,10 @@ static void project_paint_face_init( if (mask > 0.0f) { BLI_linklist_prepend_arena( bucketPixelNodes, - project_paint_uvpixel_init(ps, arena, &tinf, x, y, mask, tri_index, - pixelScreenCo, wco, w), - arena - ); + project_paint_uvpixel_init( + ps, arena, &tinf, x, y, mask, tri_index, + pixelScreenCo, wco, w), + arena); } } @@ -4187,8 +4188,9 @@ static void do_projectpaint_clone_f(ProjPaintState *ps, ProjPixel *projPixel, fl * accumulation of color greater than 'projPixel->mask' however in the case of smear its not * really that important to be correct as it is with clone and painting */ -static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, float mask, - MemArena *smearArena, LinkNode **smearPixels, const float co[2]) +static void do_projectpaint_smear( + ProjPaintState *ps, ProjPixel *projPixel, float mask, + MemArena *smearArena, LinkNode **smearPixels, const float co[2]) { unsigned char rgba_ub[4]; @@ -4199,8 +4201,9 @@ static void do_projectpaint_smear(ProjPaintState *ps, ProjPixel *projPixel, floa BLI_linklist_prepend_arena(smearPixels, (void *)projPixel, smearArena); } -static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, float mask, - MemArena *smearArena, LinkNode **smearPixels_f, const float co[2]) +static void do_projectpaint_smear_f( + ProjPaintState *ps, ProjPixel *projPixel, float mask, + MemArena *smearArena, LinkNode **smearPixels_f, const float co[2]) { float rgba[4]; @@ -4211,8 +4214,9 @@ static void do_projectpaint_smear_f(ProjPaintState *ps, ProjPixel *projPixel, fl BLI_linklist_prepend_arena(smearPixels_f, (void *)projPixel, smearArena); } -static void do_projectpaint_soften_f(ProjPaintState *ps, ProjPixel *projPixel, float mask, - MemArena *softenArena, LinkNode **softenPixels) +static void do_projectpaint_soften_f( + ProjPaintState *ps, ProjPixel *projPixel, float mask, + MemArena *softenArena, LinkNode **softenPixels) { float accum_tot = 0.0f; int xk, yk; @@ -4267,8 +4271,9 @@ static void do_projectpaint_soften_f(ProjPaintState *ps, ProjPixel *projPixel, f } } -static void do_projectpaint_soften(ProjPaintState *ps, ProjPixel *projPixel, float mask, - MemArena *softenArena, LinkNode **softenPixels) +static void do_projectpaint_soften( + ProjPaintState *ps, ProjPixel *projPixel, float mask, + MemArena *softenArena, LinkNode **softenPixels) { float accum_tot = 0; int xk, yk; @@ -4549,8 +4554,9 @@ static void *do_projectpaint_thread(void *ph_v) if (is_floatbuf) { /* convert to premultipied */ mul_v3_fl(color_f, color_f[3]); - IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->origColor.f_pt, - color_f, ps->blend); + IMB_blend_color_float( + projPixel->pixel.f_pt, projPixel->origColor.f_pt, + color_f, ps->blend); } else { linearrgb_to_srgb_v3_v3(color_f, color_f); @@ -4562,8 +4568,9 @@ static void *do_projectpaint_thread(void *ph_v) unit_float_to_uchar_clamp_v3(projPixel->newColor.ch, color_f); } projPixel->newColor.ch[3] = unit_float_to_uchar_clamp(color_f[3]); - IMB_blend_color_byte(projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, - projPixel->newColor.ch, ps->blend); + IMB_blend_color_byte( + projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, + projPixel->newColor.ch, ps->blend); } } else { @@ -4572,16 +4579,18 @@ static void *do_projectpaint_thread(void *ph_v) newColor_f[3] = ((float)projPixel->mask) * (1.0f / 65535.0f) * brush->alpha; copy_v3_v3(newColor_f, ps->paint_color_linear); - IMB_blend_color_float(projPixel->pixel.f_pt, projPixel->origColor.f_pt, - newColor_f, ps->blend); + IMB_blend_color_float( + projPixel->pixel.f_pt, projPixel->origColor.f_pt, + newColor_f, ps->blend); } else { float mask = ((float)projPixel->mask) * (1.0f / 65535.0f); projPixel->newColor.ch[3] = mask * 255 * brush->alpha; rgb_float_to_uchar(projPixel->newColor.ch, ps->paint_color); - IMB_blend_color_byte(projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, - projPixel->newColor.ch, ps->blend); + IMB_blend_color_byte( + projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, + projPixel->newColor.ch, ps->blend); } } @@ -4609,15 +4618,17 @@ static void *do_projectpaint_thread(void *ph_v) ps->reproject_ibuf_free_float = true; } - bicubic_interpolation_color(ps->reproject_ibuf, NULL, projPixel->newColor.f, - projPixel->projCoSS[0], projPixel->projCoSS[1]); + bicubic_interpolation_color( + ps->reproject_ibuf, NULL, projPixel->newColor.f, + projPixel->projCoSS[0], projPixel->projCoSS[1]); if (projPixel->newColor.f[3]) { float mask = ((float)projPixel->mask) * (1.0f / 65535.0f); mul_v4_v4fl(projPixel->newColor.f, projPixel->newColor.f, mask); - blend_color_mix_float(projPixel->pixel.f_pt, projPixel->origColor.f_pt, - projPixel->newColor.f); + blend_color_mix_float( + projPixel->pixel.f_pt, projPixel->origColor.f_pt, + projPixel->newColor.f); } } else { @@ -4626,14 +4637,16 @@ static void *do_projectpaint_thread(void *ph_v) ps->reproject_ibuf_free_uchar = true; } - bicubic_interpolation_color(ps->reproject_ibuf, projPixel->newColor.ch, NULL, - projPixel->projCoSS[0], projPixel->projCoSS[1]); + bicubic_interpolation_color( + ps->reproject_ibuf, projPixel->newColor.ch, NULL, + projPixel->projCoSS[0], projPixel->projCoSS[1]); if (projPixel->newColor.ch[3]) { float mask = ((float)projPixel->mask) * (1.0f / 65535.0f); projPixel->newColor.ch[3] *= mask; - blend_color_mix_byte(projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, - projPixel->newColor.ch); + blend_color_mix_byte( + projPixel->pixel.ch_pt, projPixel->origColor.ch_pt, + projPixel->newColor.ch); } } } @@ -5495,12 +5508,13 @@ void PAINT_OT_image_from_view(wmOperatorType *ot) void BKE_paint_data_warning(struct ReportList *reports, bool uvs, bool mat, bool tex, bool stencil) { - BKE_reportf(reports, RPT_WARNING, "Missing%s%s%s%s detected!", - !uvs ? " UVs," : "", - !mat ? " Materials," : "", - !tex ? " Textures," : "", - !stencil ? " Stencil," : "" - ); + BKE_reportf( + reports, RPT_WARNING, "Missing%s%s%s%s detected!", + !uvs ? " UVs," : "", + !mat ? " Materials," : "", + !tex ? " Textures," : "", + !stencil ? " Stencil," : "" + ); } /* Make sure that active object has a material, and assign UVs and image layers if they do not exist */ @@ -5628,8 +5642,9 @@ static Image *proj_paint_image_create(wmOperator *op, Main *bmain) alpha = RNA_boolean_get(op->ptr, "alpha"); RNA_string_get(op->ptr, "name", imagename); } - ima = BKE_image_add_generated(bmain, width, height, imagename, alpha ? 32 : 24, use_float, - gen_type, color, false); + ima = BKE_image_add_generated( + bmain, width, height, imagename, alpha ? 32 : 24, use_float, + gen_type, color, false); return ima; } |