new file format with versioning and layer opacity

This commit is contained in:
2018-09-20 21:12:48 +02:00
parent 3a81d337d4
commit 9ea1ca4fae
8 changed files with 94 additions and 15 deletions

View File

@@ -42,6 +42,49 @@ public:
void destroy();
};
struct PPIThumb
{
int width = 128;
int height = 128;
int comp = 4;
bool valid() const
{
return (width == 128 && height == 128 && comp == 4);
}
};
struct PPIDocVersion
{
int major = 0;
int minor = 1;
};
struct PPISoftVersion
{
int major = g_version_major;
int minor = g_version_minor;
int fix = g_version_fix;
int build = g_version_build;
};
struct PPIHeader
{
char magic[4]{ 'P', 'P', 'I', 0 };
PPIDocVersion doc_version;
PPISoftVersion soft_version;
PPIThumb thumb_header;
bool valid()
{
if (strcmp(magic, "PPI") != 0)
return false;
if (doc_version.major != 0 || doc_version.minor != 1)
return false;
if (!thumb_header.valid())
return false;
return true;
}
};
class Canvas
{
public: