[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    Re: [calligra/calligra/2.9] krita/plugins/paintops/colorsmudge: Fix for color smudge radius darkenin
From:       Lukast dev <lukast.dev () gmail ! com>
Date:       2014-12-19 7:23:02
Message-ID: CAKdU0rO-L4e=Je4Tb_6wPrzC4vWz=1D1EaT=ohXBCjqZ_qm49Q () mail ! gmail ! com
[Download RAW message or body]

Hi Wolthera,

why do you copy rawdata now instead of oldrawdata?

Lukas

2014-12-18 22:32 GMT+01:00 Wolthera van Hovell <griffinvalley@gmail.com>:
> Git commit d905dd37a2c69e5a23f94067e1c217412f8798a1 by Wolthera van Hovell.
> Committed on 18/12/2014 at 21:32.
> Pushed by woltherav into branch 'calligra/2.9'.
> 
> Fix for color smudge radius darkening results
> 
> There's still a couple of issues, but at the least the colour don't
> become darker.
> 
> It was a for loop iterator that was named incorrectly resulting in the
> darkening of colours, because the weights were set incorrectly.
> 
> CCBUG:329622
> 
> M  +7    -4    krita/plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp
> 
> http://commits.kde.org/calligra/d905dd37a2c69e5a23f94067e1c217412f8798a1
> 
> diff --git a/krita/plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp \
> b/krita/plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp index \
>                 c7f0a21..3fc0f36 100644
> --- a/krita/plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp
> +++ b/krita/plugins/paintops/colorsmudge/kis_smudge_radius_option.cpp
> @@ -35,6 +35,7 @@
> #include "KoColorSet.h"
> #include <KoChannelInfo.h>
> #include <KoMixColorsOp.h>
> +#include <kis_cross_device_color_picker.h>
> 
> #include <KoColor.h>
> 
> @@ -80,6 +81,8 @@ void KisSmudgeRadiusOption::apply(KisPainter& painter, const \
> KisPaintInformation int k = 0;
> int j = 0;
> KisRandomConstAccessorSP accessor = dev->createRandomConstAccessorNG(0, 0);
> +        KisCrossDeviceColorPickerInt colorPicker(painter.device(), color);
> +        colorPicker.pickColor(posx, posy, color.data());
> 
> for (int y = 0; y <= smudgeRadius; y = y + loop_increment) {
> for (int x = 0; x <= smudgeRadius; x = x + loop_increment) {
> @@ -97,10 +100,10 @@ void KisSmudgeRadiusOption::apply(KisPainter& painter, const \
> KisPaintInformation x = x*(-1);
> }
> accessor->moveTo(posx + x, posy + y);
> -                        memcpy(pixels[1], accessor->oldRawData(), pixelSize);
> +                        memcpy(pixels[1], accessor->rawDataConst(), pixelSize);
> if(i == 0)
> {
> -                            memcpy(pixels[0],accessor->oldRawData(),pixelSize);
> +                            memcpy(pixels[0],accessor->rawDataConst(),pixelSize);
> }
> if (x == 0 && y == 0) {
> // Because the sum of the weights must be 255,
> @@ -108,9 +111,9 @@ void KisSmudgeRadiusOption::apply(KisPainter& painter, const \
> KisPaintInformation // to sum to 255 in total
> // It's -(counts -1), because we'll add the center one implicitly
> // through that calculation
> -                            weights[1] = (255 - (i + 1) * (255 /(i+2)));
> +                            weights[1] = (255 - (k + 1) * (255 /(k+2)));
> } else {
> -                            weights[1] = 255 /(i+2);
> +                            weights[1] = 255 /(k+2);
> }
> 
> 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic