2 * CasparCG is free software: you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License as published by
4 * the Free Software Foundation, either version 3 of the License, or
5 * (at your option) any later version.
7 * CasparCG is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with CasparCG. If not, see <http://www.gnu.org/licenses/>.
15 * Author: Niklas P Andersson, niklas.p.andersson@svt.se
23 namespace caspar { namespace psd {
29 image(std::uint32_t width, std::uint32_t height, std::uint8_t channels) : width_(width), height_(height), channels_(channels)
31 data_.resize(width*height*channels);
34 std::uint32_t width() const { return width_; }
35 std::uint32_t height() const { return height_; }
36 std::uint8_t channel_count() const { return channels_; }
38 T* data() { return data_.data(); }
43 std::uint32_t height_;
44 std::uint8_t channels_;
47 typedef image<std::uint8_t> image8bit;
48 typedef image<std::uint16_t> image16bit;
49 typedef image<std::uint32_t> image32bit;
51 typedef std::shared_ptr<image8bit> image8bit_ptr;
52 typedef std::shared_ptr<image16bit> image16bit_ptr;
53 typedef std::shared_ptr<image32bit> image32bit_ptr;