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

List:       kde-kimageshop
Subject:    Re: https://bugs.kde.org/show_bug.cgi?id=281761 -- scaling between
From:       Boudewijn Rempt <boud () valdyas ! org>
Date:       2011-09-19 13:34:37
Message-ID: 201109191534.37388.boud () valdyas ! org
[Download RAW message or body]

On Monday 19 September 2011 Sep, Silvio Heinrich wrote:
> On 09/19/2011 10:08 AM, Boudewijn Rempt wrote:
> > On Sunday 18 September 2011 Sep, Silvio Heinrich wrote:
> > > On 09/18/2011 03:06 PM, Boudewijn Rempt wrote:
> > > > hi,
> > > > 
> > > > I'm stuck with this bug... Could someone with adequate templating foo please \
> > > > check my patch and help me out a bit? I get a crash now if I follow the \
> > > > instructions in the bug report exactly.
> > > 
> > > Ok I got it. Now it seems to work.
> > > Now just one part is missing.
> > > We need to test if the destination colorspace uses floating point
> > > channels so that the second part of the "else" part is executed.
> > 
> > Looks good! I think we can skip the check for floating point, though, since \
> > KoColorSpaceAbstract isn't used as a base class for floating point colorspaces, \
> > we use ctlcs for that. Otherwise, it would be simple enough -- we can check for \
> > the type of the first channel, since KoColorSpaceAbstract is guaranteed to be \
> > homogenous. 
> 
> I think if we don't need to check for floating point, we shouldn't do it 
> and check instead if the destination colorspace is an instance of 
> KoColorSpaceAbstract.

Right.

> But I think we should distinguish between signed 
> and unsigned integer channels. I attached the patch.
> There is one problem: The _Tdst scaleToA(_T a) method in 
> KoColorSpaceMath is not generic enough. It refuses to compile with 
> certain POD type combinations or gives warnings (what will certainly 
> result in malfunctioning). And for me it looks like if this method is 
> only able to scale a value up but not down.
> The problem is, if we don't have a specialization of this method for a 
> certain type, it probably won't give the expected result.
> 
> I replaced the code with a more generic version. The code is slower but 
> should work for most type combinations.
> Maybe you should ask Cyrille first about his opinion.

Okay -- Cyrille, what do you think of this patch?

-- 
Boudewijn Rempt
http://www.valdyas.org, http://www.krita.org, http://www.boudewijnrempt.nl
_______________________________________________
kimageshop mailing list
kimageshop@kde.org
https://mail.kde.org/mailman/listinfo/kimageshop


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

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