~valavanisalex/ubuntu/oneiric/inkscape/inkscape_0.48.1-2ubuntu4

« back to all changes in this revision

Viewing changes to src/display/canvas-bpath.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Kees Cook, Ted Gould, Kees Cook
  • Date: 2009-06-24 14:00:43 UTC
  • mfrom: (1.1.8 upstream)
  • Revision ID: james.westby@ubuntu.com-20090624140043-07stp20mry48hqup
Tags: 0.47~pre0-0ubuntu1
* New upstream release

[ Ted Gould ]
* debian/control: Adding libgsl0 and removing version specifics on boost

[ Kees Cook ]
* debian/watch: updated to run uupdate and mangle pre-release versions.
* Dropped patches that have been taken upstream:
  - 01_mips
  - 02-poppler-0.8.3
  - 03-chinese-inkscape
  - 05_fix_latex_patch
  - 06_gcc-4.4
  - 07_cdr2svg
  - 08_skip-bad-utf-on-pdf-import
  - 09_gtk-clist
  - 10_belarussian
  - 11_libpng
  - 12_desktop
  - 13_slider
  - 100_svg_import_improvements
  - 102_sp_pattern_painter_free
  - 103_bitmap_type_print

Show diffs side-by-side

added added

removed removed

Lines of Context:
15
15
#ifdef HAVE_CONFIG_H
16
16
# include "config.h"
17
17
#endif
 
18
#include "color.h"
18
19
#include "sp-canvas-util.h"
 
20
#include "inkscape-cairo.h"
19
21
#include "canvas-bpath.h"
20
22
#include "display/display-forward.h"
21
23
#include "display/curve.h"
22
 
#include <livarot/Shape.h>
23
 
#include <livarot/Path.h>
24
 
#include <livarot/int-line.h>
25
 
#include <livarot/BitLigne.h>
26
 
#include <libnr/nr-pixops.h>
 
24
#include "display/inkscape-cairo.h"
 
25
#include <libnr/nr-pixops.h>
 
26
#include "helper/geom.h"
 
27
 
 
28
#include <sstream>
 
29
#include <string.h>
 
30
#include <desktop.h>
 
31
 
 
32
/**
 
33
#ifdef HAVE_CONFIG_H
 
34
# include "config.h"
 
35
#endif
 
36
#include <color.h>
 
37
 
 
38
#include <libnr/nr-pixops.h>
 
39
**/
27
40
 
28
41
void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride);
29
42
 
31
44
static void sp_canvas_bpath_init (SPCanvasBPath *path);
32
45
static void sp_canvas_bpath_destroy (GtkObject *object);
33
46
 
34
 
static void sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags);
 
47
static void sp_canvas_bpath_update (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags);
35
48
static void sp_canvas_bpath_render (SPCanvasItem *item, SPCanvasBuf *buf);
36
 
static double sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item);
 
49
static double sp_canvas_bpath_point (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item);
37
50
 
38
51
static SPCanvasItemClass *parent_class;
39
52
 
43
56
    static GtkType type = 0;
44
57
    if (!type) {
45
58
        GtkTypeInfo info = {
46
 
            "SPCanvasBPath",
 
59
            (gchar *)"SPCanvasBPath",
47
60
            sizeof (SPCanvasBPath),
48
61
            sizeof (SPCanvasBPathClass),
49
62
            (GtkClassInitFunc) sp_canvas_bpath_class_init,
76
89
static void
77
90
sp_canvas_bpath_init (SPCanvasBPath * bpath)
78
91
{
79
 
    bpath->fill_rgba = 0x000000ff;
 
92
    bpath->fill_rgba = 0x00000000;
80
93
    bpath->fill_rule = SP_WIND_RULE_EVENODD;
81
94
 
82
95
    bpath->stroke_rgba = 0x00000000;
84
97
    bpath->stroke_linejoin = SP_STROKE_LINEJOIN_MITER;
85
98
    bpath->stroke_linecap = SP_STROKE_LINECAP_BUTT;
86
99
    bpath->stroke_miterlimit = 11.0;
87
 
 
88
 
    bpath->fill_shp=NULL;
89
 
    bpath->stroke_shp=NULL;
90
100
}
91
101
 
92
102
static void
93
103
sp_canvas_bpath_destroy (GtkObject *object)
94
104
{
95
105
    SPCanvasBPath *cbp = SP_CANVAS_BPATH (object);
96
 
    if (cbp->fill_shp) {
97
 
        delete cbp->fill_shp;
98
 
        cbp->fill_shp = NULL;
99
 
    }
100
106
 
101
 
    if (cbp->stroke_shp) {
102
 
        delete cbp->stroke_shp;
103
 
        cbp->stroke_shp = NULL;
104
 
    }
105
107
    if (cbp->curve) {
106
 
        cbp->curve = sp_curve_unref (cbp->curve);
 
108
        cbp->curve = cbp->curve->unref();
107
109
    }
108
110
 
109
111
    if (GTK_OBJECT_CLASS (parent_class)->destroy)
111
113
}
112
114
 
113
115
static void
114
 
sp_canvas_bpath_update (SPCanvasItem *item, NR::Matrix const &affine, unsigned int flags)
 
116
sp_canvas_bpath_update (SPCanvasItem *item, Geom::Matrix const &affine, unsigned int flags)
115
117
{
116
118
    SPCanvasBPath *cbp = SP_CANVAS_BPATH (item);
117
119
 
122
124
 
123
125
    sp_canvas_item_reset_bounds (item);
124
126
 
125
 
    if (cbp->fill_shp) {
126
 
        delete cbp->fill_shp;
127
 
        cbp->fill_shp = NULL;
128
 
    }
129
 
 
130
 
    if (cbp->stroke_shp) {
131
 
        delete cbp->stroke_shp;
132
 
        cbp->stroke_shp = NULL;
133
 
    }
134
127
    if (!cbp->curve) return;
135
128
 
136
 
    NRRect dbox;
137
 
 
138
 
    dbox.x0 = dbox.y0 = 0.0;
139
 
    dbox.x1 = dbox.y1 = -1.0;
140
 
 
141
 
    if ((cbp->fill_rgba & 0xff) || (cbp->stroke_rgba & 0xff)) {
142
 
        Path*  thePath=new Path;
143
 
        thePath->LoadArtBPath(SP_CURVE_BPATH(cbp->curve), affine, true);
144
 
        thePath->Convert(0.25);
145
 
        if ((cbp->fill_rgba & 0xff) && (cbp->curve->end > 2)) {
146
 
            Shape* theShape=new Shape;
147
 
            thePath->Fill(theShape,0);
148
 
            if ( cbp->fill_shp == NULL ) cbp->fill_shp=new Shape;
149
 
            if ( cbp->fill_rule == SP_WIND_RULE_EVENODD ) {
150
 
                cbp->fill_shp->ConvertToShape(theShape,fill_oddEven);
151
 
            } else {
152
 
                cbp->fill_shp->ConvertToShape(theShape,fill_nonZero);
153
 
            }
154
 
            delete theShape;
155
 
            cbp->fill_shp->CalcBBox();
156
 
            if ( cbp->fill_shp->leftX < cbp->fill_shp->rightX ) {
157
 
                if ( dbox.x0 >= dbox.x1 ) {
158
 
                    dbox.x0 = cbp->fill_shp->leftX; dbox.x1 = cbp->fill_shp->rightX;
159
 
                    dbox.y0 = cbp->fill_shp->topY; dbox.y1 = cbp->fill_shp->bottomY;
160
 
                } else {
161
 
                    if ( cbp->fill_shp->leftX < dbox.x0 ) dbox.x0=cbp->fill_shp->leftX;
162
 
                    if ( cbp->fill_shp->rightX > dbox.x1 ) dbox.x1=cbp->fill_shp->rightX;
163
 
                    if ( cbp->fill_shp->topY < dbox.y0 ) dbox.y0=cbp->fill_shp->topY;
164
 
                    if ( cbp->fill_shp->bottomY > dbox.y1 ) dbox.y1=cbp->fill_shp->bottomY;
165
 
                }
166
 
            }
167
 
        }
168
 
        if ((cbp->stroke_rgba & 0xff) && (cbp->curve->end > 1)) {
169
 
            JoinType join=join_straight;
170
 
//      Shape* theShape=new Shape;
171
 
            ButtType butt=butt_straight;
172
 
            if ( cbp->stroke_shp == NULL ) cbp->stroke_shp=new Shape;
173
 
            if ( cbp->stroke_linecap == SP_STROKE_LINECAP_BUTT ) butt=butt_straight;
174
 
            if ( cbp->stroke_linecap == SP_STROKE_LINECAP_ROUND ) butt=butt_round;
175
 
            if ( cbp->stroke_linecap == SP_STROKE_LINECAP_SQUARE ) butt=butt_square;
176
 
            if ( cbp->stroke_linejoin == SP_STROKE_LINEJOIN_MITER ) join=join_pointy;
177
 
            if ( cbp->stroke_linejoin == SP_STROKE_LINEJOIN_ROUND ) join=join_round;
178
 
            if ( cbp->stroke_linejoin == SP_STROKE_LINEJOIN_BEVEL ) join=join_straight;
179
 
            thePath->Stroke(cbp->stroke_shp,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit );
180
 
            //     thePath->Stroke(theShape,false,0.5*cbp->stroke_width, join,butt,cbp->stroke_width*cbp->stroke_miterlimit );
181
 
            //     cbp->stroke_shp->ConvertToShape(theShape,fill_nonZero);
182
 
 
183
 
            cbp->stroke_shp->CalcBBox();
184
 
            if ( cbp->stroke_shp->leftX < cbp->stroke_shp->rightX ) {
185
 
                if ( dbox.x0 >= dbox.x1 ) {
186
 
                    dbox.x0 = cbp->stroke_shp->leftX;dbox.x1 = cbp->stroke_shp->rightX;
187
 
                    dbox.y0 = cbp->stroke_shp->topY;dbox.y1 = cbp->stroke_shp->bottomY;
188
 
                } else {
189
 
                    if ( cbp->stroke_shp->leftX < dbox.x0 ) dbox.x0 = cbp->stroke_shp->leftX;
190
 
                    if ( cbp->stroke_shp->rightX > dbox.x1 ) dbox.x1 = cbp->stroke_shp->rightX;
191
 
                    if ( cbp->stroke_shp->topY < dbox.y0 ) dbox.y0 = cbp->stroke_shp->topY;
192
 
                    if ( cbp->stroke_shp->bottomY > dbox.y1 ) dbox.y1 = cbp->stroke_shp->bottomY;
193
 
                }
194
 
            }
195
 
//      delete theShape;
196
 
        }
197
 
        delete thePath;
 
129
    cbp->affine = affine;
 
130
 
 
131
    Geom::OptRect bbox = bounds_exact_transformed(cbp->curve->get_pathvector(), affine);
 
132
 
 
133
    if (bbox) {
 
134
        item->x1 = (int)bbox->min()[Geom::X] - 1;
 
135
        item->y1 = (int)bbox->min()[Geom::Y] - 1;
 
136
        item->x2 = (int)bbox->max()[Geom::X] + 1;
 
137
        item->y2 = (int)bbox->max()[Geom::Y] + 1;
 
138
    } else {
 
139
        item->x1 = 0;
 
140
        item->y1 = 0;
 
141
        item->x2 = 0;
 
142
        item->y2 = 0;
198
143
    }
199
 
 
200
 
 
201
 
    item->x1 = (int)dbox.x0;
202
 
    item->y1 = (int)dbox.y0;
203
 
    item->x2 = (int)dbox.x1;
204
 
    item->y2 = (int)dbox.y1;
205
 
 
206
144
    sp_canvas_request_redraw (item->canvas, (int)item->x1, (int)item->y1, (int)item->x2, (int)item->y2);
207
145
}
208
146
 
213
151
 
214
152
    sp_canvas_prepare_buffer(buf);
215
153
 
216
 
    NRRectL  area;
217
 
    area.x0=buf->rect.x0;
218
 
    area.x1=buf->rect.x1;
219
 
    area.y0=buf->rect.y0;
220
 
    area.y1=buf->rect.y1;
221
 
    if ( cbp->fill_shp ) {
222
 
        nr_pixblock_render_bpath_rgba (cbp->fill_shp,cbp->fill_rgba,area,(char*)buf->buf, buf->buf_rowstride);
223
 
    }
224
 
    if ( cbp->stroke_shp ) {
225
 
        nr_pixblock_render_bpath_rgba (cbp->stroke_shp,cbp->stroke_rgba,area,(char*)buf->buf, buf->buf_rowstride);
226
 
    }
227
 
 
 
154
    Geom::Rect area (Geom::Point(buf->rect.x0, buf->rect.y0), Geom::Point(buf->rect.x1, buf->rect.y1));
 
155
 
 
156
    if ( !cbp->curve  || 
 
157
         ((cbp->stroke_rgba & 0xff) == 0 && (cbp->fill_rgba & 0xff) == 0 ) || 
 
158
         cbp->curve->get_segment_count() < 1)
 
159
        return;
 
160
 
 
161
    if (!buf->ct)
 
162
        return;
 
163
 
 
164
    bool dofill = ((cbp->fill_rgba & 0xff) != 0);
 
165
    bool dostroke = ((cbp->stroke_rgba & 0xff) != 0);
 
166
 
 
167
    cairo_set_tolerance(buf->ct, 1.25); // low quality, but good enough for canvas items
 
168
    cairo_new_path(buf->ct);
 
169
 
 
170
    if (!dofill)
 
171
        feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), cbp->affine, area, true, 1);
 
172
    else
 
173
        feed_pathvector_to_cairo (buf->ct, cbp->curve->get_pathvector(), cbp->affine, area, false, 1);
 
174
 
 
175
    if (dofill) {
 
176
        // RGB / BGR
 
177
        cairo_set_source_rgba(buf->ct, SP_RGBA32_B_F(cbp->fill_rgba), SP_RGBA32_G_F(cbp->fill_rgba), SP_RGBA32_R_F(cbp->fill_rgba), SP_RGBA32_A_F(cbp->fill_rgba));
 
178
        cairo_set_fill_rule(buf->ct, cbp->fill_rule == SP_WIND_RULE_EVENODD? CAIRO_FILL_RULE_EVEN_ODD
 
179
                            : CAIRO_FILL_RULE_WINDING);
 
180
        if (dostroke)
 
181
            cairo_fill_preserve(buf->ct);
 
182
        else 
 
183
            cairo_fill(buf->ct);
 
184
    }
 
185
 
 
186
    if (dostroke) {
 
187
        // RGB / BGR
 
188
        cairo_set_source_rgba(buf->ct, SP_RGBA32_B_F(cbp->stroke_rgba), SP_RGBA32_G_F(cbp->stroke_rgba), SP_RGBA32_R_F(cbp->stroke_rgba), SP_RGBA32_A_F(cbp->stroke_rgba));
 
189
        cairo_set_line_width(buf->ct, 1);
 
190
        if (cbp->dashes[0] != 0 && cbp->dashes[1] != 0) {
 
191
            cairo_set_dash (buf->ct, cbp->dashes, 2, 0);
 
192
        }
 
193
        cairo_stroke(buf->ct);
 
194
    }
228
195
}
229
196
 
230
 
#define BIGVAL 1e18
231
 
 
232
197
static double
233
 
sp_canvas_bpath_point (SPCanvasItem *item, NR::Point p, SPCanvasItem **actual_item)
 
198
sp_canvas_bpath_point (SPCanvasItem *item, Geom::Point p, SPCanvasItem **actual_item)
234
199
{
235
200
    SPCanvasBPath *cbp = SP_CANVAS_BPATH (item);
236
201
 
237
 
    if (cbp->fill_shp && (cbp->fill_shp->PtWinding(p) > 0 )) {
 
202
    if ( !cbp->curve  || 
 
203
         ((cbp->stroke_rgba & 0xff) == 0 && (cbp->fill_rgba & 0xff) == 0 ) || 
 
204
         cbp->curve->get_segment_count() < 1)
 
205
        return NR_HUGE;
 
206
 
 
207
    double width = 0.5;
 
208
    Geom::Rect viewbox = item->canvas->getViewbox();
 
209
    viewbox.expandBy (width);
 
210
    double dist = NR_HUGE;
 
211
    pathv_matrix_point_bbox_wind_distance(cbp->curve->get_pathvector(), cbp->affine, p, NULL, NULL, &dist, 0.5, &viewbox);
 
212
 
 
213
    if (dist <= 1.0) {
238
214
        *actual_item = item;
239
 
        return 0.0;
240
 
    }
241
 
    if (cbp->stroke_shp ) {
242
 
        if (cbp->stroke_shp->PtWinding(p) > 0 ) {
243
 
            *actual_item = item;
244
 
            return 0.0;
245
 
        }
246
 
        return distance(cbp->stroke_shp, p);
247
 
    }
248
 
    if (cbp->fill_shp) {
249
 
        return distance(cbp->fill_shp, p);
250
215
    }
251
216
 
252
 
    return BIGVAL;
 
217
    return dist;
253
218
}
254
219
 
255
220
SPCanvasItem *
272
237
    g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));
273
238
 
274
239
    if (cbp->curve) {
275
 
        cbp->curve = sp_curve_unref (cbp->curve);
 
240
        cbp->curve = cbp->curve->unref();
276
241
    }
277
242
 
278
243
    if (curve) {
279
 
        cbp->curve = sp_curve_ref (curve);
 
244
        cbp->curve = curve->ref();
280
245
    }
281
246
 
282
247
    sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
295
260
}
296
261
 
297
262
void
298
 
sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap)
 
263
sp_canvas_bpath_set_stroke (SPCanvasBPath *cbp, guint32 rgba, gdouble width, SPStrokeJoinType join, SPStrokeCapType cap, double dash, double gap)
299
264
{
300
265
    g_return_if_fail (cbp != NULL);
301
266
    g_return_if_fail (SP_IS_CANVAS_BPATH (cbp));
304
269
    cbp->stroke_width = MAX (width, 0.1);
305
270
    cbp->stroke_linejoin = join;
306
271
    cbp->stroke_linecap = cap;
 
272
    cbp->dashes[0] = dash;
 
273
    cbp->dashes[1] = gap;
307
274
 
308
275
    sp_canvas_item_request_update (SP_CANVAS_ITEM (cbp));
309
276
}
310
277
 
311
 
 
312
 
 
313
 
static void
314
 
bpath_run_A8_OR (raster_info &dest,void *data,int st,float vst,int en,float ven)
315
 
{
316
 
    union {
317
 
        uint8_t  comp[4];
318
 
        uint32_t col;
319
 
    } tempCol;
320
 
    if ( st >= en ) return;
321
 
    tempCol.col=*(uint32_t*)data;
322
 
 
323
 
    unsigned int r, g, b, a;
324
 
    r = NR_RGBA32_R (tempCol.col);
325
 
    g = NR_RGBA32_G (tempCol.col);
326
 
    b = NR_RGBA32_B (tempCol.col);
327
 
    a = NR_RGBA32_A (tempCol.col);
328
 
    if (a == 0) return;
329
 
 
330
 
    vst*=a;
331
 
    ven*=a;
332
 
 
333
 
    if ( vst < 0 ) vst=0;
334
 
    if ( vst > 255 ) vst=255;
335
 
    if ( ven < 0 ) ven=0;
336
 
    if ( ven > 255 ) ven=255;
337
 
    float      sv=vst;
338
 
    float      dv=ven-vst;
339
 
    int        len=en-st;
340
 
    uint8_t*   d=(uint8_t*)dest.buffer;
341
 
 
342
 
    d+=3*(st-dest.startPix);
343
 
    if ( fabs(dv) < 0.001 ) {
344
 
        if ( sv > 249.999 ) {
345
 
            /* Simple copy */
346
 
            while (len > 0) {
347
 
                d[0] = NR_COMPOSEN11_1111 (r, 255, d[0]);
348
 
                d[1] = NR_COMPOSEN11_1111 (g, 255, d[1]);
349
 
                d[2] = NR_COMPOSEN11_1111 (b, 255, d[2]);
350
 
                d += 3;
351
 
                len -= 1;
352
 
            }
353
 
        } else {
354
 
            unsigned int c0_24=(int)sv;
355
 
            c0_24&=0xFF;
356
 
            while (len > 0) {
357
 
                d[0] = NR_COMPOSEN11_1111 (r, c0_24, d[0]);
358
 
                d[1] = NR_COMPOSEN11_1111 (g, c0_24, d[1]);
359
 
                d[2] = NR_COMPOSEN11_1111 (b, c0_24, d[2]);
360
 
                d += 3;
361
 
                len -= 1;
362
 
            }
363
 
        }
364
 
    } else {
365
 
        if ( en <= st+1 ) {
366
 
            sv=0.5*(vst+ven);
367
 
            unsigned int c0_24=(int)sv;
368
 
            c0_24&=0xFF;
369
 
            d[0] = NR_COMPOSEN11_1111 (r, c0_24, d[0]);
370
 
            d[1] = NR_COMPOSEN11_1111 (g, c0_24, d[1]);
371
 
            d[2] = NR_COMPOSEN11_1111 (b, c0_24, d[2]);
372
 
        } else {
373
 
            dv/=len;
374
 
            sv+=0.5*dv; // correction trapezoidale
375
 
            sv*=65536;
376
 
            dv*=65536;
377
 
            int c0_24 = static_cast<int>(CLAMP(sv, 0, 16777216));
378
 
            int s0_24 = static_cast<int>(dv);
379
 
            while (len > 0) {
380
 
                unsigned int ca;
381
 
                /* Draw */
382
 
                ca = c0_24 >> 16;
383
 
                if ( ca > 255 ) ca=255;
384
 
                d[0] = NR_COMPOSEN11_1111 (r, ca, d[0]);
385
 
                d[1] = NR_COMPOSEN11_1111 (g, ca, d[1]);
386
 
                d[2] = NR_COMPOSEN11_1111 (b, ca, d[2]);
387
 
                d += 3;
388
 
                c0_24 += s0_24;
389
 
                c0_24 = CLAMP (c0_24, 0, 16777216);
390
 
                len -= 1;
391
 
            }
392
 
        }
393
 
    }
394
 
}
395
 
 
396
 
void nr_pixblock_render_bpath_rgba (Shape* theS,uint32_t color,NRRectL &area,char* destBuf,int stride)
397
 
{
398
 
 
399
 
    theS->CalcBBox();
400
 
    float  l=theS->leftX,r=theS->rightX,t=theS->topY,b=theS->bottomY;
401
 
    int    il,ir,it,ib;
402
 
    il=(int)floor(l);
403
 
    ir=(int)ceil(r);
404
 
    it=(int)floor(t);
405
 
    ib=(int)ceil(b);
406
 
 
407
 
    if ( il >= area.x1 || ir <= area.x0 || it >= area.y1 || ib <= area.y0 ) return;
408
 
    if ( il < area.x0 ) il=area.x0;
409
 
    if ( it < area.y0 ) it=area.y0;
410
 
    if ( ir > area.x1 ) ir=area.x1;
411
 
    if ( ib > area.y1 ) ib=area.y1;
412
 
 
413
 
/*  // version par FloatLigne
414
 
    int    curPt;
415
 
    float  curY;
416
 
    theS->BeginRaster(curY,curPt,1.0);
417
 
 
418
 
    FloatLigne* theI=new FloatLigne();
419
 
    IntLigne*   theIL=new IntLigne();
420
 
 
421
 
    theS->Scan(curY,curPt,(float)(it),1.0);
422
 
 
423
 
    char* mdata=(char*)destBuf;
424
 
    uint32_t* ligStart=((uint32_t*)(mdata+(3*(il-area.x0)+stride*(it-area.y0))));
425
 
    for (int y=it;y<ib;y++) {
426
 
    theI->Reset();
427
 
    if ( y&0x00000003 ) {
428
 
    theS->Scan(curY,curPt,((float)(y+1)),theI,false,1.0);
429
 
    } else {
430
 
    theS->Scan(curY,curPt,((float)(y+1)),theI,true,1.0);
431
 
    }
432
 
    theI->Flatten();
433
 
    theIL->Copy(theI);
434
 
 
435
 
    raster_info  dest;
436
 
    dest.startPix=il;
437
 
    dest.endPix=ir;
438
 
    dest.sth=il;
439
 
    dest.stv=y;
440
 
    dest.buffer=ligStart;
441
 
    theIL->Raster(dest,&color,bpath_run_A8_OR);
442
 
    ligStart=((uint32_t*)(((char*)ligStart)+stride));
443
 
    }
444
 
    theS->EndRaster();
445
 
    delete theI;
446
 
    delete theIL;  */
447
 
 
448
 
    // version par BitLigne directe
449
 
    int    curPt;
450
 
    float  curY;
451
 
    theS->BeginQuickRaster(curY, curPt);
452
 
 
453
 
    BitLigne*   theI[4];
454
 
    for (int i=0;i<4;i++) theI[i]=new BitLigne(il,ir);
455
 
    IntLigne*   theIL=new IntLigne();
456
 
 
457
 
    theS->DirectQuickScan(curY,curPt,(float)(it),true,0.25);
458
 
 
459
 
    char* mdata=(char*)destBuf;
460
 
    uint32_t* ligStart=((uint32_t*)(mdata+(3*(il-area.x0)+stride*(it-area.y0))));
461
 
    for (int y=it;y<ib;y++) {
462
 
        for (int i = 0; i < 4; i++)
463
 
            theI[i]->Reset();
464
 
 
465
 
        for (int i = 0; i < 4; i++)
466
 
            theS->QuickScan(curY, curPt, ((float)(y+0.25*(i+1))),
467
 
                            fill_oddEven, theI[i], 0.25);
468
 
 
469
 
        theIL->Copy(4,theI);
470
 
        //   theI[0]->Affiche();
471
 
        //   theIL->Affiche();
472
 
 
473
 
        raster_info  dest;
474
 
        dest.startPix=il;
475
 
        dest.endPix=ir;
476
 
        dest.sth=il;
477
 
        dest.stv=y;
478
 
        dest.buffer=ligStart;
479
 
        theIL->Raster(dest,&color,bpath_run_A8_OR);
480
 
        ligStart=((uint32_t*)(((char*)ligStart)+stride));
481
 
    }
482
 
    theS->EndQuickRaster();
483
 
    for (int i=0;i<4;i++) delete theI[i];
484
 
    delete theIL;
485
 
}
486
 
 
487
 
 
488
278
/*
489
279
  Local Variables:
490
280
  mode:c++