... |
... |
@@ -1486,139 +1486,6 @@ typedef ptrdiff_t FT_PtrDist; |
1486
|
1486
|
}
|
1487
|
1487
|
|
1488
|
1488
|
|
1489
|
|
- static void
|
1490
|
|
- gray_sweep( RAS_ARG )
|
1491
|
|
- {
|
1492
|
|
- int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
|
1493
|
|
- : INT_MIN;
|
1494
|
|
- int coverage;
|
1495
|
|
- int y;
|
1496
|
|
-
|
1497
|
|
-
|
1498
|
|
- for ( y = ras.min_ey; y < ras.max_ey; y++ )
|
1499
|
|
- {
|
1500
|
|
- PCell cell = ras.ycells[y - ras.min_ey];
|
1501
|
|
- TCoord x = ras.min_ex;
|
1502
|
|
- TArea cover = 0;
|
1503
|
|
-
|
1504
|
|
- unsigned char* line = ras.target.origin - ras.target.pitch * y;
|
1505
|
|
-
|
1506
|
|
-
|
1507
|
|
- for ( ; cell != ras.cell_null; cell = cell->next )
|
1508
|
|
- {
|
1509
|
|
- TArea area;
|
1510
|
|
-
|
1511
|
|
-
|
1512
|
|
- if ( cover != 0 && cell->x > x )
|
1513
|
|
- {
|
1514
|
|
- FT_FILL_RULE( coverage, cover, fill );
|
1515
|
|
- FT_GRAY_SET( line + x, coverage, cell->x - x );
|
1516
|
|
- }
|
1517
|
|
-
|
1518
|
|
- cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
|
1519
|
|
- area = cover - cell->area;
|
1520
|
|
-
|
1521
|
|
- if ( area != 0 && cell->x >= ras.min_ex )
|
1522
|
|
- {
|
1523
|
|
- FT_FILL_RULE( coverage, area, fill );
|
1524
|
|
- line[cell->x] = (unsigned char)coverage;
|
1525
|
|
- }
|
1526
|
|
-
|
1527
|
|
- x = cell->x + 1;
|
1528
|
|
- }
|
1529
|
|
-
|
1530
|
|
- if ( cover != 0 ) /* only if cropped */
|
1531
|
|
- {
|
1532
|
|
- FT_FILL_RULE( coverage, cover, fill );
|
1533
|
|
- FT_GRAY_SET( line + x, coverage, ras.max_ex - x );
|
1534
|
|
- }
|
1535
|
|
- }
|
1536
|
|
- }
|
1537
|
|
-
|
1538
|
|
-
|
1539
|
|
- static void
|
1540
|
|
- gray_sweep_direct( RAS_ARG )
|
1541
|
|
- {
|
1542
|
|
- int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
|
1543
|
|
- : INT_MIN;
|
1544
|
|
- int coverage;
|
1545
|
|
- int y;
|
1546
|
|
-
|
1547
|
|
- FT_Span span[FT_MAX_GRAY_SPANS];
|
1548
|
|
- int n = 0;
|
1549
|
|
-
|
1550
|
|
-
|
1551
|
|
- for ( y = ras.min_ey; y < ras.max_ey; y++ )
|
1552
|
|
- {
|
1553
|
|
- PCell cell = ras.ycells[y - ras.min_ey];
|
1554
|
|
- TCoord x = ras.min_ex;
|
1555
|
|
- TArea cover = 0;
|
1556
|
|
-
|
1557
|
|
-
|
1558
|
|
- for ( ; cell != ras.cell_null; cell = cell->next )
|
1559
|
|
- {
|
1560
|
|
- TArea area;
|
1561
|
|
-
|
1562
|
|
-
|
1563
|
|
- if ( cover != 0 && cell->x > x )
|
1564
|
|
- {
|
1565
|
|
- FT_FILL_RULE( coverage, cover, fill );
|
1566
|
|
-
|
1567
|
|
- span[n].coverage = (unsigned char)coverage;
|
1568
|
|
- span[n].x = (short)x;
|
1569
|
|
- span[n].len = (unsigned short)( cell->x - x );
|
1570
|
|
-
|
1571
|
|
- if ( ++n == FT_MAX_GRAY_SPANS )
|
1572
|
|
- {
|
1573
|
|
- /* flush the span buffer and reset the count */
|
1574
|
|
- ras.render_span( y, n, span, ras.render_span_data );
|
1575
|
|
- n = 0;
|
1576
|
|
- }
|
1577
|
|
- }
|
1578
|
|
-
|
1579
|
|
- cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
|
1580
|
|
- area = cover - cell->area;
|
1581
|
|
-
|
1582
|
|
- if ( area != 0 && cell->x >= ras.min_ex )
|
1583
|
|
- {
|
1584
|
|
- FT_FILL_RULE( coverage, area, fill );
|
1585
|
|
-
|
1586
|
|
- span[n].coverage = (unsigned char)coverage;
|
1587
|
|
- span[n].x = (short)cell->x;
|
1588
|
|
- span[n].len = 1;
|
1589
|
|
-
|
1590
|
|
- if ( ++n == FT_MAX_GRAY_SPANS )
|
1591
|
|
- {
|
1592
|
|
- /* flush the span buffer and reset the count */
|
1593
|
|
- ras.render_span( y, n, span, ras.render_span_data );
|
1594
|
|
- n = 0;
|
1595
|
|
- }
|
1596
|
|
- }
|
1597
|
|
-
|
1598
|
|
- x = cell->x + 1;
|
1599
|
|
- }
|
1600
|
|
-
|
1601
|
|
- if ( cover != 0 ) /* only if cropped */
|
1602
|
|
- {
|
1603
|
|
- FT_FILL_RULE( coverage, cover, fill );
|
1604
|
|
-
|
1605
|
|
- span[n].coverage = (unsigned char)coverage;
|
1606
|
|
- span[n].x = (short)x;
|
1607
|
|
- span[n].len = (unsigned short)( ras.max_ex - x );
|
1608
|
|
-
|
1609
|
|
- ++n;
|
1610
|
|
- }
|
1611
|
|
-
|
1612
|
|
- if ( n )
|
1613
|
|
- {
|
1614
|
|
- /* flush the span buffer and reset the count */
|
1615
|
|
- ras.render_span( y, n, span, ras.render_span_data );
|
1616
|
|
- n = 0;
|
1617
|
|
- }
|
1618
|
|
- }
|
1619
|
|
- }
|
1620
|
|
-
|
1621
|
|
-
|
1622
|
1489
|
#ifdef STANDALONE_
|
1623
|
1490
|
|
1624
|
1491
|
/**************************************************************************
|
... |
... |
@@ -1934,7 +1801,7 @@ typedef ptrdiff_t FT_PtrDist; |
1934
|
1801
|
if ( continued )
|
1935
|
1802
|
FT_Trace_Enable();
|
1936
|
1803
|
|
1937
|
|
- FT_TRACE7(( "band [%d..%d]: %td cell%s remaining/\n",
|
|
1804
|
+ FT_TRACE7(( "band [%d..%d]: %td cell%s remaining\n",
|
1938
|
1805
|
ras.min_ey,
|
1939
|
1806
|
ras.max_ey,
|
1940
|
1807
|
ras.cell_null - ras.cell_free,
|
... |
... |
@@ -1952,6 +1819,139 @@ typedef ptrdiff_t FT_PtrDist; |
1952
|
1819
|
}
|
1953
|
1820
|
|
1954
|
1821
|
|
|
1822
|
+ static void
|
|
1823
|
+ gray_sweep( RAS_ARG )
|
|
1824
|
+ {
|
|
1825
|
+ int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
|
|
1826
|
+ : INT_MIN;
|
|
1827
|
+ int coverage;
|
|
1828
|
+ int y;
|
|
1829
|
+
|
|
1830
|
+
|
|
1831
|
+ for ( y = ras.min_ey; y < ras.max_ey; y++ )
|
|
1832
|
+ {
|
|
1833
|
+ PCell cell = ras.ycells[y - ras.min_ey];
|
|
1834
|
+ TCoord x = ras.min_ex;
|
|
1835
|
+ TArea cover = 0;
|
|
1836
|
+
|
|
1837
|
+ unsigned char* line = ras.target.origin - ras.target.pitch * y;
|
|
1838
|
+
|
|
1839
|
+
|
|
1840
|
+ for ( ; cell != ras.cell_null; cell = cell->next )
|
|
1841
|
+ {
|
|
1842
|
+ TArea area;
|
|
1843
|
+
|
|
1844
|
+
|
|
1845
|
+ if ( cover != 0 && cell->x > x )
|
|
1846
|
+ {
|
|
1847
|
+ FT_FILL_RULE( coverage, cover, fill );
|
|
1848
|
+ FT_GRAY_SET( line + x, coverage, cell->x - x );
|
|
1849
|
+ }
|
|
1850
|
+
|
|
1851
|
+ cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
|
|
1852
|
+ area = cover - cell->area;
|
|
1853
|
+
|
|
1854
|
+ if ( area != 0 && cell->x >= ras.min_ex )
|
|
1855
|
+ {
|
|
1856
|
+ FT_FILL_RULE( coverage, area, fill );
|
|
1857
|
+ line[cell->x] = (unsigned char)coverage;
|
|
1858
|
+ }
|
|
1859
|
+
|
|
1860
|
+ x = cell->x + 1;
|
|
1861
|
+ }
|
|
1862
|
+
|
|
1863
|
+ if ( cover != 0 ) /* only if cropped */
|
|
1864
|
+ {
|
|
1865
|
+ FT_FILL_RULE( coverage, cover, fill );
|
|
1866
|
+ FT_GRAY_SET( line + x, coverage, ras.max_ex - x );
|
|
1867
|
+ }
|
|
1868
|
+ }
|
|
1869
|
+ }
|
|
1870
|
+
|
|
1871
|
+
|
|
1872
|
+ static void
|
|
1873
|
+ gray_sweep_direct( RAS_ARG )
|
|
1874
|
+ {
|
|
1875
|
+ int fill = ( ras.outline.flags & FT_OUTLINE_EVEN_ODD_FILL ) ? 0x100
|
|
1876
|
+ : INT_MIN;
|
|
1877
|
+ int coverage;
|
|
1878
|
+ int y;
|
|
1879
|
+
|
|
1880
|
+ FT_Span span[FT_MAX_GRAY_SPANS];
|
|
1881
|
+ int n = 0;
|
|
1882
|
+
|
|
1883
|
+
|
|
1884
|
+ for ( y = ras.min_ey; y < ras.max_ey; y++ )
|
|
1885
|
+ {
|
|
1886
|
+ PCell cell = ras.ycells[y - ras.min_ey];
|
|
1887
|
+ TCoord x = ras.min_ex;
|
|
1888
|
+ TArea cover = 0;
|
|
1889
|
+
|
|
1890
|
+
|
|
1891
|
+ for ( ; cell != ras.cell_null; cell = cell->next )
|
|
1892
|
+ {
|
|
1893
|
+ TArea area;
|
|
1894
|
+
|
|
1895
|
+
|
|
1896
|
+ if ( cover != 0 && cell->x > x )
|
|
1897
|
+ {
|
|
1898
|
+ FT_FILL_RULE( coverage, cover, fill );
|
|
1899
|
+
|
|
1900
|
+ span[n].coverage = (unsigned char)coverage;
|
|
1901
|
+ span[n].x = (short)x;
|
|
1902
|
+ span[n].len = (unsigned short)( cell->x - x );
|
|
1903
|
+
|
|
1904
|
+ if ( ++n == FT_MAX_GRAY_SPANS )
|
|
1905
|
+ {
|
|
1906
|
+ /* flush the span buffer and reset the count */
|
|
1907
|
+ ras.render_span( y, n, span, ras.render_span_data );
|
|
1908
|
+ n = 0;
|
|
1909
|
+ }
|
|
1910
|
+ }
|
|
1911
|
+
|
|
1912
|
+ cover += (TArea)cell->cover * ( ONE_PIXEL * 2 );
|
|
1913
|
+ area = cover - cell->area;
|
|
1914
|
+
|
|
1915
|
+ if ( area != 0 && cell->x >= ras.min_ex )
|
|
1916
|
+ {
|
|
1917
|
+ FT_FILL_RULE( coverage, area, fill );
|
|
1918
|
+
|
|
1919
|
+ span[n].coverage = (unsigned char)coverage;
|
|
1920
|
+ span[n].x = (short)cell->x;
|
|
1921
|
+ span[n].len = 1;
|
|
1922
|
+
|
|
1923
|
+ if ( ++n == FT_MAX_GRAY_SPANS )
|
|
1924
|
+ {
|
|
1925
|
+ /* flush the span buffer and reset the count */
|
|
1926
|
+ ras.render_span( y, n, span, ras.render_span_data );
|
|
1927
|
+ n = 0;
|
|
1928
|
+ }
|
|
1929
|
+ }
|
|
1930
|
+
|
|
1931
|
+ x = cell->x + 1;
|
|
1932
|
+ }
|
|
1933
|
+
|
|
1934
|
+ if ( cover != 0 ) /* only if cropped */
|
|
1935
|
+ {
|
|
1936
|
+ FT_FILL_RULE( coverage, cover, fill );
|
|
1937
|
+
|
|
1938
|
+ span[n].coverage = (unsigned char)coverage;
|
|
1939
|
+ span[n].x = (short)x;
|
|
1940
|
+ span[n].len = (unsigned short)( ras.max_ex - x );
|
|
1941
|
+
|
|
1942
|
+ ++n;
|
|
1943
|
+ }
|
|
1944
|
+
|
|
1945
|
+ if ( n )
|
|
1946
|
+ {
|
|
1947
|
+ /* flush the span buffer and reset the count */
|
|
1948
|
+ ras.render_span( y, n, span, ras.render_span_data );
|
|
1949
|
+ n = 0;
|
|
1950
|
+ }
|
|
1951
|
+ }
|
|
1952
|
+ }
|
|
1953
|
+
|
|
1954
|
+
|
1955
|
1955
|
static int
|
1956
|
1956
|
gray_convert_glyph( RAS_ARG )
|
1957
|
1957
|
{
|