On 25 March 2011 07:04, Bill van Melle <[email protected]> wrote:

> Pivot comes with a number of Decorator implementations.  If there isn't one
>> that does exactly you need, I wouldn't describe that as a bug.
>>
>
> Well, if not a bug, at least an inadequacy.
>
IMVHO that is also a little strong.  In an alternate reality, Pivot could
end up being a 20mb download with 90% of that being Decorator
implementations.  Obviously that is not going to happen, but hopefully you
understand the point I am trying to make.

Pivot provides the interface, but cannot possibly provide every
implementation that users might want, even if they could be foreseen.  FWIW
the same applies to renderers too.

You are free to write your own implementations to meet your needs
>>
> As always.  Would be more comfortable advice if I were a graphics expert...
>
Understood.  I am also not a graphics expert and have very limited
experience with Graphics2D, but in the past a quick 'google' has provided
all I needed.  Once you realise how Pivot uses them, it then moves into a
non-Pivot area of expertise where solutions can be researched & tested
independently.


> For example, a quick search found this post demonstrating 3 different
>> grayscale conversion techniques and some comments discussing transparency.
>>
>> http://blog.codebeach.com/2008/03/convert-color-image-to-gray-scale-image.html
>>
>
> ...but fortunately, others are!  Excellent to-the-point article.  I took
> the code helpfully supplied in the comment about the transparency
> shortcoming, dropped it into the current GrayscaleDecorator implementation,
> and it works beautifully right out of the box.  Thanks!
>
That post hopefully demonstrates the point I was trying to make earlier.
 Here are 3 alternative grayscale conversion techniques which give 3 very
different results from the same source.  Combine that with the fact that at
least one didn't respect transparency - which one *should* Pivot provide?
 Would there be a clear consensus?

I would argue that Pivot *need not* provide any, but does provide a single
version which can be used as a starting point or reference for those who
wish to create their own implementations (of a grayscale decorator, or any
decorator for that matter).


> I'll submit it as a proposed improvement, and y'all can decide whether it's
> a bug fix or not.  I think it is, since the current implementation, I claim,
> is not what anyone would properly expect it to do.
>
I won't argue regarding what anyone else might expect.  Don't get me wrong,
I'm not against including this, and submissions are always welcomed, so go
for it!

You might also consider posting the modified code to this mailing list in
case anyone following the thread might find it useful.  The same 'issue'
might apply to other decorators.

Chris

Reply via email to