aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp
diff options
context:
space:
mode:
authorRoy Ben-Shabat <Roy@Twine-s.com>2018-02-25 19:25:11 +0200
committerRoy Ben-Shabat <Roy@Twine-s.com>2018-02-25 19:25:11 +0200
commit6549d8672a93893599e921d9f1938af7dcabb8bf (patch)
treedc64b671e2186ab2252ace2f7cbf592b967b3cb2 /Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp
parenta89c62d8fc0401b437ecb51d1bbf46b8c66b9b77 (diff)
downloadTango-6549d8672a93893599e921d9f1938af7dcabb8bf.tar.gz
Tango-6549d8672a93893599e921d9f1938af7dcabb8bf.zip
Working on PES embroidery...
Diffstat (limited to 'Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp')
-rw-r--r--Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp48
1 files changed, 48 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp b/Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp
new file mode 100644
index 000000000..64c581400
--- /dev/null
+++ b/Software/Visual_Studio/Embroidery/libEmbroideryTest/libEmbroideryTest.cpp
@@ -0,0 +1,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;
+}