File Header Structure#
-
struct FileHeader : public FileSection#
Public Functions
-
FileHeader() = default#
-
inline FileHeader(Enum::Version version, uint16_t numChannels, uint32_t width, uint32_t height, Enum::BitDepth depth, Enum::ColorMode colorMode)#
Each FileSection must implement a way to calculate its own section size in bytes based on the data it holds. This is important for writing to disk as we sometimes hold a section size marker. The size must include this marker (if applicable) and when writing the marker we subtract the size of it.
Note
Any sections that include image data (LayerAndMaskInformation and ImageData) will not be able to calculate the section size due to offloading the compression to the write step. For these sections the size calculation gets done on write.
- Parameters:
header – An optional ptr to the document FileHeader, only some functions require this to be present
-
void read(File &document)#
Read and Initialize the FileHeader from disk.
Public Members
-
Signature m_Signature = {}#
Has to be ‘8BPS’.
-
uint16_t m_NumChannels = {}#
Supported range by Photoshop is 1-56. This does not account for mask channels.
-
uint32_t m_Height = {}#
1 - 30,000 for PSD and 1 - 300,000 for PSB
-
uint32_t m_Width = {}#
1 - 30,000 for PSD and 1 - 300,000 for PSB
-
FileHeader() = default#