Need a solution for this

Boudewijn Rempt boud at
Sat Dec 31 11:00:22 CET 2005

In the export filters we need to cast the activeLayer to a KisPaintLayer to be 
able to get at the annotations, and I don't that's the perfect solution:

    KisPaintLayerSP dst;

    KisImageSP img = new KisImage(*output->currentImage());

    // Don't store this information in the document's undo adapter
    bool undo = output->undoAdapter()->undo();

    KisImageMagickConverter ib(output, output->undoAdapter());


    dst = (KisPaintLayer*)img->activeLayer().data();

    vKisAnnotationSP_it beginIt = img->beginAnnotations();
    vKisAnnotationSP_it endIt = img->endAnnotations();
    if (ib.buildFile(url, dst, beginIt, endIt) == KisImageBuilder_RESULT_OK) {
        return KoFilter::OK;

I'm thinking that KisImage::flatten should maybe return a shared pointer to
the paint layer it has created -- that would solve this problem.

Boudewijn Rempt
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url :

More information about the kimageshop mailing list