#include "stdafx.h" #include "emb-pattern.h" #include #include #include "thread-color.h" using namespace std; int main() { EmbPattern* p = embPattern_create(); int ok = embPattern_read(p, "C:\\Users\\Roy\\Desktop\\abc.dst"); if (ok) { cout << "Embroidery file read OK" << endl; cout << "Writing Stitches..." << endl; int stitchCount = embStitchList_count(p->stitchList); int t_count = embThreadList_count(p->threadList); for (size_t i = 0; i < t_count; i++) { EmbThread t = embThreadList_getAt(p->threadList, i); cout << "R: " << (int)t.color.r << ", "; cout << "G: " << (int)t.color.g << ", "; cout << "B: " << (int)t.color.b << endl; } EmbStitchList* sList = p->stitchList; while (sList) { EmbStitch s = sList->stitch; //cout << " X: " << setprecision(3) << s.xx << " Y: " << setprecision(3) << s.yy << " Color Index: " << s.color << endl; printf("\"%f\",\"%f\"\n", s.xx, s.yy); sList = sList->next; } //for (size_t i = 0; i < 1000; i++) //{ // EmbStitch stitch = embStitchList_getAt(p->stitchList, i); // cout << i << " X: " << setprecision(3) << stitch.xx << " Y: " << setprecision(3) << stitch.yy << " Color Index: " << stitch.color << endl; //} } else { cout << "Embroidery file read failed!"; } getchar(); return 0; }