Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_image_proj.c')
-rw-r--r--source/blender/editors/sculpt_paint/paint_image_proj.c91
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 e9fdbdb7f26..6b13decd41b 100644
--- a/source/blender/editors/sculpt_paint/paint_image_proj.c
+++ b/source/blender/editors/sculpt_paint/paint_image_proj.c
@@ -2611,8 +2611,9 @@ static void project_paint_face_init(
}
#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 */
@@ -2661,10 +2662,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);
}
}
@@ -4218,8 +4219,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];
@@ -4230,8 +4232,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];
@@ -4242,8 +4245,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;
@@ -4298,8 +4302,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;
@@ -4580,8 +4585,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);
@@ -4593,8 +4599,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 {
@@ -4603,16 +4610,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);
}
}
@@ -4640,15 +4649,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 {
@@ -4657,14 +4668,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);
}
}
}
@@ -5524,12 +5537,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 */
@@ -5666,8 +5680,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;
}