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

List:       kde-kimageshop
Subject:    Re: canvas widget
From:       Matthias Elter <me () main-echo ! net>
Date:       1999-08-02 21:09:36
[Download RAW message or body]

On Mon, 02 Aug 1999, Andrew Richards wrote:
> I have (somewhat reticently) uploaded the canvas widget I have been working on
> in my spare time.
> 
> The files are in the CVS under koffice/kimageshop/canvas and contain a test
> Makefile and program which demonstrates some of the features of the widget.
> 
> DISCLAIMERS
>  - It is work in progress
>  - You *will* have to modify the local Makefile to get it to work for you
>    no autoconf yet
>  - Painting into a layer with an alpha channel is broken
>  - The "test images" will be replaced in the future (at the moment they have
>    some useful features (other than visual appeal))
>  - The classes are not tidy - I haven't decided what needs to be
>    public/protected etc.
>  - I have been learning a lot about the best way of implementing memory
>    management and packing and I expect to rewrite most of this code in the
>    near future.
>  - Lots of optimizations are possible but I am holding off doing these
>    (especially the case based ones) until I decide on a final implementation.
>    So don't panic about speed.
>  - I WILL tidy it up and the API will change (the basics should stay the same
>    though)
> 
> No frills test program
>  - layers can be selected and turned on and off via the layerlist
>    (anyone want to make a nice layer dialog with the relevant signals and
>    slots? Also need better eye and link icons)
>  - dragging in the image will drag the selected layer
>  - Ctrl-clicking in the image will paint into the current layer
> 
> A lot of stuff has been designed but not implemented yet - other colour
> spaces, zooming, faster repainting, various caching schemes.
> 
> Fast Visual
>   Check out canvas::setUpVisual() and change the "if (false" to "if (true"
>   to see if you can use my fast version of convertFromImage(...) (called
>   canvas::convertImageToPixmap(...). On my machine I get a speedup of 2x
>   (wrt QT's version) for 32bpp and 3x for 16bpp (Linux intel). This might
>   crap out if your machine has a different endianness. Play and code.
> 
> Planned changes
>  - At the moment the canvas class is a qwidget. I plan to make another class 
>    canvasView which handles the display of the widget. That way we can have
>    multiple views of the same canvas
> 
> What we need
>  - Toolbar (signals, slots, blah blah blah)
>  - Palettes - brushes, colour, layer
>  - Style (copy the good, ditch the bad and invent some thing stylish and new)
> 
> I'd like the toolbar and palettes to be based on a palettes class so it can
> have a thinner title bar and do nice things like hiding at appropriate
> times. Screen real estate is vital in image processing programs so try
> not to waste space.
> 
> I suggest using QImage as an internal image format until the canvas
> stuff settles down (yes, that means RGBA for the moment).

It looks very promising! I'm going to start integrating it into the kimageshop
framework tomorrow. :-)

canvas::convertImageToPixmap(...) works for me and I get a speedup of about
1.5x.

By the way, KOffice has a basic ocument/view framework. Please keep this in
mind and use that framework to seperate the actual document from the view (and
support multiple views this way) when implementing the canvasView class you
mention.

Greetings,
Matthias

-- 
Matthias Elter
me@kde.org / me@main-echo.net
KDE developer
Computer science student university of Wuerzburg, Germany

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

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