blob: 64c5814003a6b37302987970b9b7a405e1009455 (
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
37
38
39
40
41
42
43
44
45
46
47
48
|
#include "stdafx.h"
#include "emb-pattern.h"
#include <iostream>
#include <iomanip>
#include "thread-color.h"
using namespace std;
int main()
{
EmbPattern* p = embPattern_create();
int ok = embPattern_read(p, "C:\\Tests\\Blueangel.pes");
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++)
{
cout << "R: " << (int)p->threadList[i].thread.color.r << ", ";
cout << "G: " << (int)p->threadList[i].thread.color.g << ", ";
cout << "B: " << (int)p->threadList[i].thread.color.b << endl;
}
for (size_t i = 0; i < 100; i++)
{
EmbStitch stitch = p->stitchList[i].stitch;
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;
}
|