Code

Split SPCanvasItem and SPCanvasGroup to individual .h files. Removed forward header.
[inkscape.git] / src / libnrtype / raster-position.h
1 #ifndef SEEN_LIBNRTYPE_RASTER_POSITION_H
2 #define SEEN_LIBNRTYPE_RASTER_POSITION_H
4 #include <vector>
6 #include <libnr/nr-forward.h>
7 #include <libnrtype/nrtype-forward.h>
8 #include <livarot/livarot-forward.h>
10 // one subpixel position
11 // it's basically a set of trapezoids (=float_ligne_run) representing the black areas of the glyph
12 // all trapezoids are in the same array, hence the run_on_line array to give the number of 
13 // trapezoids on each line
14 // trapezoids store the x-positions as float, and are shifted to the x blit position
15 // so it's "exact" in the x direction and subpixel in the y direction
16 class raster_position {
17 public:
18     int               top, bottom; // baseline is y=0
19                                // top is the first pixel, bottom is the last
20     int*              run_on_line; // array of size (bottom-top+1): run_on_line[i] gives the number of runs on line top+i
21     int               nbRun;
22     float_ligne_run*  runs;
24 public:
25     raster_position();
26     virtual ~raster_position();
28                 // stuff runs into the structure
29     void AppendRuns(std::vector<float_ligne_run> const &r, int y);
30                 // blits the trapezoids.
31     void Blit(float ph, int pv, NRPixBlock &over);
32 };
35 #endif /* !SEEN_LIBNRTYPE_RASTER_POSITION_H */
37 /*
38   Local Variables:
39   mode:c++
40   c-file-style:"stroustrup"
41   c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
42   indent-tabs-mode:nil
43   fill-column:99
44   End:
45 */
46 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4 :