source: trunk/Packages/bgrabitmap/multishapeline.inc

Last change on this file was 2, checked in by chronos, 5 years ago
File size: 2.0 KB
Line 
1 begin
2 for k := 0 to NbShapeRows-1 do
3 with shapeRow[shapeRowsList[k]],shapes[shapeRowsList[k]] do
4 if densMinx <= densMaxx then
5 begin
6 if densMinx < minx then densMinx := minx;
7 if densMaxx > maxx then densMaxx := maxx;
8
9 if texture <> nil then
10 begin
11 texture.ScanMoveTo(densMinx,yb);
12 ScanNextFunc := @texture.ScanNextPixel;
13 pdens := density+(densMinX-minx);
14 for xb := densMinx to densMaxx do
15 with sums[xb-minx] do
16 begin
17 if pdens^ <> 0 then
18 begin
19 ec := GammaExpansion(ScanNextFunc());
20 {$ifdef PARAM_ANTIALIASINGFACTOR}
21 w := DivByAntialiasPrecision65536(pdens^ * ec.alpha);
22 {$else}
23 w := (pdens^ * ec.alpha) shr 16;
24 {$endif}
25 if w <> 0 then
26 begin
27 inc(sumR,ec.red*w);
28 inc(sumG,ec.green*w);
29 inc(sumB,ec.blue*w);
30 inc(sumA,w);
31 end;
32 end else
33 ScanNextFunc();
34 inc(pdens);
35 end;
36 end else
37 begin
38 ec := color;
39 pdens := density+(densMinX-minx);
40 for xb := densMinx to densMaxx do
41 with sums[xb-minx] do
42 begin
43 if pdens^ <> 0 then
44 begin
45 {$ifdef PARAM_ANTIALIASINGFACTOR}
46 w := DivByAntialiasPrecision65536(pdens^ * ec.alpha);
47 {$else}
48 w := (pdens^ * ec.alpha) shr 16;
49 {$endif}
50 if w <> 0 then
51 begin
52 inc(sumR,ec.red*w);
53 inc(sumG,ec.green*w);
54 inc(sumB,ec.blue*w);
55 inc(sumA,w);
56 end;
57 end;
58 inc(pdens);
59 end;
60 end;
61 end;
62
63 end
64{$undef PARAM_ANTIALIASINGFACTOR}
Note: See TracBrowser for help on using the repository browser.