/src/harfbuzz/src/OT/glyf/coord-setter.hh
Line | Count | Source (jump to first uncovered line) |
1 | | #ifndef OT_GLYF_COORD_SETTER_HH |
2 | | #define OT_GLYF_COORD_SETTER_HH |
3 | | |
4 | | |
5 | | #include "../../hb.hh" |
6 | | |
7 | | |
8 | | namespace OT { |
9 | | namespace glyf_impl { |
10 | | |
11 | | |
12 | | struct coord_setter_t |
13 | | { |
14 | | coord_setter_t (hb_array_t<int> coords) : |
15 | 0 | coords (coords) {} |
16 | | |
17 | | int& operator [] (unsigned idx) |
18 | 0 | { |
19 | 0 | if (unlikely (idx >= HB_GLYF_VAR_COMPOSITE_MAX_AXES)) |
20 | 0 | return Crap(int); |
21 | 0 | if (coords.length < idx + 1) |
22 | 0 | coords.resize (idx + 1); |
23 | 0 | return coords[idx]; |
24 | 0 | } |
25 | | |
26 | | hb_array_t<int> get_coords () |
27 | 0 | { return coords.as_array (); } |
28 | | |
29 | | hb_vector_t<int> coords; |
30 | | }; |
31 | | |
32 | | |
33 | | } /* namespace glyf_impl */ |
34 | | } /* namespace OT */ |
35 | | |
36 | | #endif /* OT_GLYF_COORD_SETTER_HH */ |