canvas-bpath.cpp revision fdc44da6a01ea7605271feed15df61005ddd0219
#define __SP_CANVAS_BPATH_C__
/*
* Simple bezier bpath CanvasItem for inkscape
*
* Authors:
* Lauris Kaplinski <lauris@ximian.com>
*
* Copyright (C) 2001 Lauris Kaplinski and Ximian, Inc.
*
* Released under GNU GPL
*
*/
#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
#include "sp-canvas-util.h"
#include "canvas-bpath.h"
#include "display/display-forward.h"
#include <livarot/int-line.h>
#include <livarot/BitLigne.h>
#include <libnr/nr-pixops.h>
void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride);
static void sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags);
static SPCanvasItemClass *parent_class;
sp_canvas_bpath_get_type (void)
{
if (!type) {
GtkTypeInfo info = {
"SPCanvasBPath",
sizeof (SPCanvasBPath),
sizeof (SPCanvasBPathClass),
};
}
return type;
}
static void
{
}
static void
{
}
static void
{
}
if (cbp->stroke_shp) {
delete cbp->stroke_shp;
}
}
}
static void
{
sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
}
if (cbp->stroke_shp) {
delete cbp->stroke_shp;
}
} else {
}
delete theShape;
} else {
}
}
}
// Shape* theShape=new Shape;
thePath->Stroke(cbp->stroke_shp,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit );
// thePath->Stroke(theShape,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit );
// cbp->stroke_shp->ConvertToShape(theShape,fill_nonZero);
} else {
}
}
// delete theShape;
}
delete thePath;
}
sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
}
static void
{
nr_pixblock_render_bpath_rgba (cbp->fill_shp,cbp->fill_rgba,area,(char*)buf->buf, buf->buf_rowstride);
}
if ( cbp->stroke_shp ) {
nr_pixblock_render_bpath_rgba (cbp->stroke_shp,cbp->stroke_rgba,area,(char*)buf->buf, buf->buf_rowstride);
}
}
#define BIGVAL 1e18
static double
{
*actual_item = item;
return 0.0;
}
if (cbp->stroke_shp ) {
*actual_item = item;
return 0.0;
}
}
}
return BIGVAL;
}
{
return item;
}
void
{
}
if (curve) {
}
}
void
{
}
void
sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap)
{
}
static void
{
union {
} tempCol;
unsigned int r, g, b, a;
if (a == 0) return;
vst*=a;
ven*=a;
if ( sv > 249.999 ) {
/* Simple copy */
while (len > 0) {
d[0] = NR_COMPOSEN11 (r, 255, d[0]);
d += 3;
len -= 1;
}
} else {
c0_24&=0xFF;
while (len > 0) {
d[0] = NR_COMPOSEN11 (r, c0_24, d[0]);
d += 3;
len -= 1;
}
}
} else {
c0_24&=0xFF;
d[0] = NR_COMPOSEN11 (r, c0_24, d[0]);
} else {
sv*=65536;
dv*=65536;
while (len > 0) {
unsigned int ca;
/* Draw */
d[0] = NR_COMPOSEN11 (r, ca, d[0]);
d += 3;
len -= 1;
}
}
}
}
void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride)
{
/* // version par FloatLigne
int curPt;
float curY;
theS->BeginRaster(curY,curPt,1.0);
FloatLigne* theI=new FloatLigne();
IntLigne* theIL=new IntLigne();
theS->Scan(curY,curPt,(float)(it),1.0);
char* mdata=(char*)destBuf;
uint32_t* ligStart=((uint32_t*)(mdata+(3*(il-area.x0)+stride*(it-area.y0))));
for (int y=it;y<ib;y++) {
theI->Reset();
if ( y&0x00000003 ) {
theS->Scan(curY,curPt,((float)(y+1)),theI,false,1.0);
} else {
theS->Scan(curY,curPt,((float)(y+1)),theI,true,1.0);
}
theI->Flatten();
theIL->Copy(theI);
raster_info dest;
dest.startPix=il;
dest.endPix=ir;
dest.sth=il;
dest.stv=y;
dest.buffer=ligStart;
theIL->Raster(dest,&color,bpath_run_A8_OR);
ligStart=((uint32_t*)(((char*)ligStart)+stride));
}
theS->EndRaster();
delete theI;
delete theIL; */
// version par BitLigne directe
int curPt;
float curY;
for (int i = 0; i < 4; i++)
for (int i = 0; i < 4; i++)
// theI[0]->Affiche();
// theIL->Affiche();
}
theS->EndQuickRaster();
for (int i=0;i<4;i++) delete theI[i];
delete theIL;
}