inkscape-cairo.cpp revision 9e268605aad18efb0fabff57f4deea18759fec25
/*
* Helper functions to use cairo with inkscape
*
* Copyright (C) 2007 bulia byak
*
* Released under GNU GPL
*
*/
#include <cairo.h>
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
#include <libnr/n-art-bpath.h>
#include <libnr/nr-matrix-ops.h>
#include <libnr/nr-matrix-fns.h>
#include <libnr/nr-pixblock.h>
#include "../style.h"
#include "nr-arena.h"
/** Creates a cairo context to render to the given pixblock on the given area */
cairo_t *
{
return NULL;
unsigned char *dpx = NR_PIXBLOCK_PX (pb) + (clip.y0 - pb->area.y0) * pb->rs + NR_PIXBLOCK_BPP (pb) * (clip.x0 - pb->area.x0);
// even though cairo cannot draw in nonpremul mode, select ARGB32 for R8G8B8A8N as the closest; later eliminate R8G8B8A8N everywhere
(dpx,
((pb->mode == NR_PIXBLOCK_MODE_R8G8B8A8P || pb->mode == NR_PIXBLOCK_MODE_R8G8B8A8N) ? CAIRO_FORMAT_ARGB32 : (pb->mode == NR_PIXBLOCK_MODE_R8G8B8? CAIRO_FORMAT_RGB24 : CAIRO_FORMAT_A8)),
return ct;
}
/** Feeds path-creating calls to the cairo context translating them from the SPCurve, with the given transform and shift */
void
{
bool closed = false;
case NR_MOVETO_OPEN:
case NR_MOVETO:
break;
case NR_LINETO:
break;
case NR_CURVETO: {
break;
}
default:
break;
}
}
}
/*
Local Variables:
mode:c++
c-file-style:"stroustrup"
c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
indent-tabs-mode:nil
fill-column:99
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:encoding=utf-8:textwidth=99 :