summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/OT/glyf/coord-setter.hh
blob: cf05929362f5972f8af148dc78eb04ff21a6bfba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef OT_GLYF_COORD_SETTER_HH
#define OT_GLYF_COORD_SETTER_HH


#include "../../hb.hh"


namespace OT {
namespace glyf_impl {


struct coord_setter_t
{
  coord_setter_t (hb_array_t<int> coords) :
    coords (coords) {}

  int& operator [] (unsigned idx)
  {
    if (unlikely (idx >= HB_GLYF_VAR_COMPOSITE_MAX_AXES))
      return Crap(int);
    if (coords.length < idx + 1)
      coords.resize (idx + 1);
    return coords[idx];
  }

  hb_array_t<int> get_coords ()
  { return coords.as_array (); }

  hb_vector_t<int> coords;
};


} /* namespace glyf_impl */
} /* namespace OT */

#endif /* OT_GLYF_COORD_SETTER_HH */