2 * Copyright (c) 2011 Sveriges Television AB <info@casparcg.com>
4 * This file is part of CasparCG (www.casparcg.com).
6 * CasparCG is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
11 * CasparCG is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
19 * Author: Niklas P Andersson, niklas.p.andersson@svt.se
29 #include "common/memory.h"
30 #include "util\bigendian_file_input_stream.h"
35 #include <boost/property_tree/ptree_fwd.hpp>
37 namespace caspar { namespace psd {
40 typedef std::shared_ptr<layer> layer_ptr;
46 spl::shared_ptr<impl> impl_;
51 friend struct layer::impl;
53 void read_mask_data(BEFileInputStream&);
55 image8bit_ptr bitmap_;
56 unsigned char default_value_;
62 bool enabled() const { return (flags_ & 2) == 0; }
63 bool linked() const { return (flags_ & 1) == 0; }
64 bool inverted() const { return (flags_ & 4) == 4; }
66 const point<long>& location() const { return rect_.location; }
67 const image8bit_ptr& bitmap() const { return bitmap_; }
72 void populate(BEFileInputStream&, const psd_document&);
73 void read_channel_data(BEFileInputStream&);
75 const std::wstring& name() const;
76 unsigned char opacity() const;
77 unsigned short sheet_color() const;
79 bool is_position_protected();
81 float text_scale() const;
83 const boost::property_tree::wptree& text_data() const;
85 bool is_solid() const;
86 color<unsigned char> solid_color() const;
88 bool has_timeline() const;
89 const boost::property_tree::wptree& timeline_data() const;
91 const point<long>& location() const;
92 const image8bit_ptr& bitmap() const;
94 int link_group_id() const;
95 void set_link_group_id(int id);
101 #endif //_PSDLAYER_H__