#65 Callbacks support

open
nobody
None
5
2013-03-29
2010-12-07
Mihail Naydenov
No

Supplied here is:
- Callbacks implementation;
- Full implemetation of callbacks for FIF_TIFF, FIF_JPEG Loading and FreeImage_Rotate utility function.
- Helper class (wraps the callback struct) for easy adding callbacks to any loading or utility function inside FreeImage.

Discussion

<< < 1 2 3 (Page 3 of 3)

  • Anonymous
    2013-02-02

    file: PluginTARGA.cpp line 1067:

    before "read in the bitmap bits" add:

        if(!CB.reportProgress(0.05)) {
                    FreeImage_Unload(dib);
                    return NULL;
                }
                else
                    CB.setupStepProgress(header.is_height, 0.99);
    

    to initialize the step progress, otherwise the app may crash on reportStepProgress!

    I will update the patch to current version soon.

     

  • Anonymous
    2013-03-29

    OK, after years of using this patch I hit a significant drawback.

    The fact that the dib can not be shared between workers if both need progress reports and/or cancellation. This is, you cant use one dib as a (read only) source of multiple operations.

    So, the only possible clean solution is to break the API and separate callbacks from the dib itself.

    This implementation is trivial to modify to workaround the said limitation - just dont store FreeImageCB object in the dib, but pass it every time into the functions.

    Drolon, any thoughts on the topic in general?

    Any specific wishes/concerns?
    Sooner or later we have to implement a solution and this one is very feature rich and also trivial to expand without breaking the API again (all callbacks and options to them are passed as one struct, which can be extended).

     
<< < 1 2 3 (Page 3 of 3)


Anonymous


Cancel   Add attachments