Add PDF writer.
This commit is contained in:
parent
c05b7b6315
commit
9c116b1efd
72 changed files with 1819 additions and 114 deletions
35
src/image/Image.h
Normal file
35
src/image/Image.h
Normal file
|
@ -0,0 +1,35 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
|
||||
class Image
|
||||
{
|
||||
public:
|
||||
|
||||
Image(unsigned width, unsigned height);
|
||||
static std::unique_ptr<Image> Create(unsigned width, unsigned height);
|
||||
|
||||
unsigned GetBytesPerRow() const;
|
||||
unsigned GetWidth() const;
|
||||
unsigned GetHeight() const;
|
||||
unsigned GetBitDepth() const;
|
||||
unsigned GetNumChannels() const;
|
||||
unsigned char GetByte(unsigned idx, unsigned jdx) const;
|
||||
|
||||
void SetData(const std::vector<unsigned char>& data);
|
||||
void SetWidth(unsigned width);
|
||||
void SetHeight(unsigned height);
|
||||
void SetBitDepth(unsigned bitDepth);
|
||||
void SetNumChannels(unsigned numChannels);
|
||||
|
||||
private:
|
||||
unsigned mWidth{1};
|
||||
unsigned mHeight{1};
|
||||
unsigned mBitDepth{8};
|
||||
unsigned mNumChannels{1};
|
||||
std::vector<unsigned char> mData;
|
||||
};
|
||||
|
||||
using ImagePtr = std::unique_ptr<Image>;
|
Loading…
Add table
Add a link
Reference in a new issue