コード例 #1
0
ファイル: showtext.c プロジェクト: jsgf/frond
void text_pix(unsigned char pix)
{
    static unsigned char revs = REV_PER_MSG;
    struct st *st = (struct st *)SHBSS;

    if (pix == 0) {
        unsigned char w;

        if (revs-- == 0) {
            revs = REV_PER_MSG;
            if (lpm(&strings[++st->string]) == 0)
                st->string = 0;
        }

        w = width(st->string);
        st->strptr = strdata + st->string;
        st->start = PPR/2 - w/2;
        st->end = PPR/2 + w/2;
        st->charleft = -CHRSPC;
    }

    if (pix < st->start || pix > st->end)
        return;

    if (st->charleft == -CHRSPC) {
        st->charptr = chardata + lpm(st->strptr++);
        st->charleft = lpm(st->charptr++);
    }

    if (st->charleft > 0)
        set_led(lpm(st->charptr++) << 8, MAX_LVL);
    st->charleft--;
}
コード例 #2
0
ファイル: showtext.c プロジェクト: jsgf/frond
static inline unsigned char width(unsigned char str)
{
    const unsigned char *addr = strdata + str;
    unsigned char width = 0;
    unsigned char ch;

    while((ch = lpm(addr++)) != 255)
        width += lpm(chardata+ch) + CHRSPC;

    return width;
}
コード例 #3
0
ファイル: showtext.c プロジェクト: jsgf/frond
static unsigned char len(unsigned char str)
{
    unsigned char len = 0;
    const unsigned char *addr = strdata + str;

    while(lpm(addr++) != 255)
        len++;

    return len;
}
コード例 #4
0
  void checkInputNotAltered(const std::vector<Coordinate>& pt, int scaleFactor)
  {
    // save input points
    std::vector<Coordinate> savePt = pt;

		geos::algorithm::LineIntersector li;
    PrecisionModel lpm(scaleFactor);
    li.setPrecisionModel(&lpm);
    li.computeIntersection(pt[0], pt[1], pt[2], pt[3]);

    // check that input points are unchanged
    for (int i = 0; i < 4; i++) {
      ensure_equals(savePt[i], pt[i]);
    }
  }