hugin::Images

Pablo d'Angelo pablo at mathematik.uni-ulm.de
Wed Jun 11 23:53:42 BST 2003


Hi!

> Hi Pablo,
> I like to add and erase images as in the dialog and ended with an function
>     void panoramaChanged(PT::Panorama &pano);
>     void panoramaChanged(PT::Panorama &pano, int added);
>     void panoramaChanged(PT::Panorama &pano, int removed[512]);
> in CPEditorPanel:: with it special usefullnes for one of three purposes:
> add, delete and check all.
> I think this is not the best way. I will rename each of the three
> overloaded functions.

Hmm, I haven't decided wether to split the changed messages into smaller
parts yet. We have 3 ways:

1. leave it like it is, notifies about any change.
2. create special functions for different changes (like you
   suggest).
3. One function with an argument (enum) that indicates what
   has changed.

I see that it is tempting to specialize the change messages a lot, but
sometimes it can be counterproductive, when clients assume to much about
the Panorama. I had this in the first version in QT hugin. the code to
handle the changes was more complicated than the one for the global
panoramaChanged() version.

But for "heavy" operations like adding or removing an image (what about
moving an image, this must also result in a gui update) it probably makes
sense. but it will be hard to notice anyway since our machines are so
fast. I wasn't sure what excatly we need, so I started with the safe way
of updating everything when the model changes. This results in
unnescessary updates, but is easier to code and maintain.

not everybody might want to listen for specific messages. so the
panoramaChanged() method should be always called whenever a change
occures.

which operations do we need?
panoramaImageAdded(int imgNr);
panoramaImageRemoved(int imgNr);
panoramaImageChanged(int imgNr);
  this then should be called for many images when one in the middle is
  removed. or when images are swapped.

do we need versions that add/remove multiple images with one function
call?

do we need the same for control points?

> You added an class ImageChache. Isnt it the same like wxImageList?

Nope, wxImageList only stores wxBitmap, not wxImage (wonderful naming,
isn't it). But I need wxImage's to do image processing on them, wxBitmap
is a platform dependant format, for fast display, not image processing.
We also might need to be able to unload some images from memory, when
projects consist of many images, and only store some small thumbnails.

And one can ask ImageCache automatically loads images if its not already
there.

btw. Panorama::setObserver() is not Panorama::addObserver(), it
overwrites the old observer. probably I should add addObserver() and
removeObserver()

> What would You suggest to connect next to the gui?

let me compile the current state first ;)

ciao
  Pablo
--
http://wurm.wohnheim.uni-ulm.de/~redman/
Please use PGP


More information about the ptX mailing list