]> git.sesse.net Git - casparcg/blob - test/psd-test/psd-test.cpp
8bbe94bdbbad84c5f6431e866016fa66efbeee37
[casparcg] / test / psd-test / psd-test.cpp
1 // psd-test.cpp : Defines the entry point for the console application.
2 //
3
4 #include "stdafx.h"
5 #include "../../modules/psd/doc.h"
6 #include "../../modules/psd/layer.h"
7 #include "../../common/utf.h"
8
9 #include <sstream>
10 #include <iostream>
11
12 #include <boost/property_tree/ptree.hpp>
13 #include <boost/property_tree/json_parser.hpp>
14
15
16 int _tmain(int argc, _TCHAR* argv[])
17 {
18         caspar::psd::psd_document doc;
19         doc.parse(L"C:\\Lokala Filer\\Utveckling\\CasparCG\\Server 2.1\\test\\data\\test1.psd");
20
21         int a = 42;
22
23         //std::wstringstream trace;
24
25         //trace << L"<doc filename='" << doc.filename() << L"' color_mode='" << caspar::psd::color_mode_to_string(doc.color_mode()) << L"' color_depth='" << doc.color_depth() << L"' channel_count='" << doc.channels_count() << L"' width='" << doc.width() << L"' height='" << doc.height() << L"'>" << std::endl;
26
27         //
28         //auto end = doc.layers().end();
29         //for(auto it = doc.layers().begin(); it != end; ++it)
30         //{
31         //      caspar::psd::layer_ptr layer = (*it);
32         //      trace << L"     <layer name='" << layer->name() << L"' opacity='" << layer->opacity() << L"'>" << std::endl;
33         //      if(layer->image())
34         //              trace << L"             <bounding-box left='" << layer->rect().left << "' top='" << layer->rect().top << "' right='" << layer->rect().right << "' bottom='" << layer->rect().bottom << "' />" << std::endl;
35         //      if(layer->mask())
36         //              trace << L"             <mask default-value='" << layer->default_mask_value() << "' left='" << layer->mask_rect().left << "' top='" << layer->mask_rect().top << "' right='" << layer->mask_rect().right << "' bottom='" << layer->mask_rect().bottom << "' />" << std::endl;
37         //      trace << L"     </layer>" << std::endl;
38         //}
39
40         //trace << L"</doc>" << std::endl;
41
42         //std::cout << caspar::u8(trace.str());
43         return 0;
44 }
45