Add missing PngOptions (related to a532f21ec4, #2153)

This commit is contained in:
David Capello 2019-09-24 09:58:52 -03:00
parent 8d5133fe09
commit ccb9dc6f25

View File

@ -0,0 +1,48 @@
// Aseprite
// Copyright (C) 2019 Igara Studio S.A.
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
#ifndef APP_FILE_PNG_OPTIONS_H_INCLUDED
#define APP_FILE_PNG_OPTIONS_H_INCLUDED
#pragma once
#include "app/file/format_options.h"
#include "base/buffer.h"
namespace app {
// Data for PNG files
class PngOptions : public FormatOptions {
public:
struct Chunk {
std::string name;
base::buffer data;
// Flags PNG_HAVE_IHDR/PNG_HAVE_PLTE/PNG_AFTER_IDAT
int location;
};
using Chunks = std::vector<Chunk>;
void addChunk(Chunk&& chunk) {
m_userChunks.emplace_back(std::move(chunk));
}
bool isEmpty() const {
return m_userChunks.empty();
}
int size() const {
return int(m_userChunks.size());
}
const Chunks& chunks() const { return m_userChunks; }
private:
Chunks m_userChunks;
};
} // namespace app
#endif