Esempio n. 1
0
static void writeGlyphLine(ufwCtx h, float x0, float y0) {
    writeStr(h, "\t\t\t<point x=\"");
    writeReal(h, x0);
    writeStr(h, "\" y=\"");
    writeReal(h, y0);
    writeLine(h, "\" type=\"line\"/>");
}
Esempio n. 2
0
static void writeGlyphInitialCurve(ufwCtx h, float *coords) {
    writeStr(h, "\t\t\t<point x=\"");
    writeReal(h, coords[0]);
    writeStr(h, "\" y=\"");
    writeReal(h, coords[1]);
    writeLine(h, "\" type=\"curve\"/>");
}
Esempio n. 3
0
static void writeGlyphFinalCurve(ufwCtx h, float *coords) {
    writeStr(h, "\t\t\t<point x=\"");
    writeReal(h, coords[0]);
    writeStr(h, "\" y=\"");
    writeReal(h, coords[1]);
    writeLine(h, "\" />");

    writeStr(h, "\t\t\t<point x=\"");
    writeReal(h, coords[2]);
    writeStr(h, "\" y=\"");
    writeReal(h, coords[3]);
    writeLine(h, "\" />");
}
Esempio n. 4
0
CSymbol* CData::addConstant (const std::string &name, const int &type, int size, const int &address)
{
   if (size == 0) {
      size = getTypeSize(type);
   }

   CSymbol *symbol = new CSymbol (CSymbol::GLOBAL, name, type, size, CSymbol::CONST, address);

   _symbols.push_back(symbol);

   //_data += symbol->getBinary();
   if (type == CSymbol::STRING) {
      // Para strings constantes e variaveis eh necessario indicar a categoria
      std::cout << "String constante [" << name << "] indicado o tipo..." << std::endl;
      writeByte(CSymbol::CONST);
      writeString(name, false);
   } else if (type == CSymbol::INT) {
      writeInt(atoi(name.c_str()));
   } else if (type == CSymbol::BOOL) {
      writeInt(atoi(name.c_str()));
   } else if (type == CSymbol::REAL) {
      writeReal(atof(name.c_str()));
   } else if (type == CSymbol::CHAR) {
      writeInt(toUTF8Char(name));
   } else {
     std::cout << "Ta faltando algum tipo ???" << endl;
     abort();
   }

   return symbol;
}
Esempio n. 5
0
void ModelFile::writePCA(const PCA* p)
{
    int i, j;
    int rows, cols;
    rows = p->eigenvectors.rows;
    cols = p->eigenvectors.cols;
    writeInt(rows);
    writeInt(cols);
    for (i=0;i<rows;i++)
        for (j=0;j<cols;j++)
            writeReal(p->eigenvectors.at<double>(i, j));
    for (i=0;i<rows;i++)
        writeReal(p->eigenvalues.at<double>(i, 0));
    
    for (i=0;i<cols;i++)
        writeReal(p->mean.at<double>(i, 0));
}