Color Mode Data Structure#

struct ColorModeData : public FileSection#

The ColorModeData section holds information for e.g. how the image is tonemapped in 32-bit mode as well as mapping of indexed and duotone colours.

Public Functions

inline ColorModeData()#
inline ColorModeData(std::vector<uint8_t> &data)#
void read(File &document)#

Read the ColorModeData section as is without interpreting anything.

void write(File &document, FileHeader &header)#

Write the ColorModeData section, note that the m_Data field does not contain the length marker and we write it explicitly.

inline void initialize(size_t offset, size_t size) noexcept#

Initialize the file section with a size and offset. If re-initialization is needed this function may be called again

template<typename T = size_t>
inline T size() const#

Get the size of the FileSection as the given integral type checking internally if this access would overflow the template argument T. This function is primarily intended for structures such as a PascalString which may only be a max of uint8_t in size.

inline void size(size_t size) noexcept#

Set the size of the file section.

inline void addSize(size_t increment)#

Add to the size of the FileSection.

inline size_t offset() const noexcept#

Public Members

std::vector<uint8_t> m_Data#

The raw bytes held by this section excluding the section marker. This should only hold data for 32-bit files and Duotone/Indexed color mode. For the time being we do not interpret this data in any way and defaults are written automatically