mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-06 06:58:15 +00:00
Add missing PngOptions (related to a532f21ec4
, #2153)
This commit is contained in:
parent
8d5133fe09
commit
ccb9dc6f25
48
src/app/file/png_options.h
Normal file
48
src/app/file/png_options.h
Normal 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
|
Loading…
Reference in New Issue
Block a user