2011/10/22 Eric Firing <efir...@hawaii.edu>:
> moved from matplotlib-users:
>
> http://sourceforge.net/mailarchive/forum.php?thread_name=CAN06%3DCx2zgh8YrnF2WRaJ%3D0E8i3ROLdYW4VuurtqKrx3mdkeEg%40mail.gmail.com&forum_name=matplotlib-users

OK

> On 10/22/2011 09:31 AM, Friedrich Romstedt wrote:
>>
>> 2011/10/21 Friedrich Romstedt<friedrichromst...@gmail.com>:
>> <snippet>
>> 3)  Providing a dedicated Filter class, that can be fed to
>> set_filter() instead of set_gray().  This I like best.
>> </snippet>
>>
>> So the filter idea was Ben's idea.  I still like idea (3) for the
>> design best.  I will check if it is possible to inject the filter code
>> into the renderer framework, since all colour settings arguments
>> somewhen flow into a call into the renderer.

This is apparently a no-go.  The backends are too tightly bound to the
C extensions moduled, e.g. aggdraw.  E.g. the image drawing method of
the Agg backend is directly assigned in the fashion::

    self.draw_image = self._renderer.draw_image

So no, this will not work this way.

>>  Pro: No rcParams
>> addition necessary, no modification of the peculiar colors.py
>> ColorConverter framework necessary, just leaving those things
>> untouched and hence no worries and headaches about them.

So I'll touch it again.  I will just check my refactor I did a year
ago on ColorConverter, which was pretty decent, but well, it needs
some check.  I would first commit that to my repo, than people who are
interested can test, and then we can go on testing the higher level
functionality.

I think the filters will, instead of signalling colors.colorConveter
via rcParams that some conversion mode is turned on, signal that in
the decorator function simply directly to colors.colorConverter.
There are some open ends, though.

>> No disabling
>> of higher-level caching and at the same time negligible small impact
>> if there is no filter active.  Con: I don't know yet if it works.  I
>> vaguely remember there were some problems when I checked that
>> possibility last time (with pixmaps or something like that).  I think
>> I will find out soon enough.

:-)  Apparently I found out the same thing a year ago.

The methodology will be like this: The Artists can store a stack of
filters, and also provide some easy-appetite-wetter .set_gray()
method.  When their draw method is decorated with a special decorator,
say @filtered, then the filters will be activated upon entering and
deactivated upon exit.  The activation happens via putting the filters
onto the filter stack in the ColorConverter instance.  I'm pretty sure
this will work, somehow at least. ;-)

I've run into some strange Bus error compiling the latest matplotlib,
I'll drop another email on the user list probably (since I'm acting
here as a user, I just want to run the tests).

Friedrich

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Reply via email to