Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tiff_psd_layer_record.h
Go to the documentation of this file.
1/*
2 * This file is part of Krita
3 *
4 * SPDX-FileCopyrightText: 2021 L. E. Segovia <amy@amyspark.me>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef _KIS_TIFF_PSD_LAYER_RECORD_H
10#define _KIS_TIFF_PSD_LAYER_RECORD_H
11
12#include <cstdint>
13#include <memory>
14#include <psd.h>
15#include <psd_layer_section.h>
16
17#include "kritatiffpsd_export.h"
18
19class KRITATIFFPSD_EXPORT KisTiffPsdLayerRecord
20{
21public:
22 KisTiffPsdLayerRecord(bool isBigEndian,
23 uint32_t width,
24 uint32_t height,
25 uint16_t channelDepth,
26 uint16_t nChannels,
27 uint16_t photometricInterpretation,
28 bool hasTransparency = false);
29
30 bool read(QIODevice &io);
31
32 bool write(QIODevice &io, KisNodeSP rootLayer, psd_compression_type compressionType);
33
34 std::shared_ptr<PSDLayerMaskSection> record() const;
35
37 {
38 return m_colorMode;
39 }
40
41 uint16_t channelDepth() const
42 {
43 return m_channelDepth;
44 }
45
46 bool valid() const;
47
48private:
50 uint32_t m_width;
51 uint32_t m_height;
53 uint16_t m_nChannels;
55 std::shared_ptr<PSDLayerMaskSection> m_record;
57 bool m_valid;
58
59private:
60 template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian>
61 bool readImpl(QIODevice &device);
62
63 template<psd_byte_order byteOrder = psd_byte_order::psdBigEndian>
64 bool writeImpl(QIODevice &device, KisNodeSP rootLayer, psd_compression_type compressionType);
65};
66
67#endif // _KIS_TIFF_PSD_LAYER_RECORD_H
psd_color_mode colorMode() const
std::shared_ptr< PSDLayerMaskSection > m_record
psd_byte_order
Definition psd.h:33
psd_compression_type
Definition psd.h:39
psd_color_mode
Definition psd.h:50