Need a solution for this

Boudewijn Rempt boud at valdyas.org
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());
    Q_CHECK_PTR(img);

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

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

    img->flatten();

    dst = (KisPaintLayer*)img->activeLayer().data();
    Q_ASSERT(dst);
    
    output->undoAdapter()->setUndo(undo);

    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 
http://www.valdyas.org/fading/index.cgi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kimageshop/attachments/20051231/05d43ad0/attachment.pgp


More information about the kimageshop mailing list