40 class Image :
public Contents,
public std::enable_shared_from_this<Image>
43 std::shared_ptr<const Image>
AsImage()
const override;
53 virtual size_t ReadData(
size_t bytes, offset_t offset,
void * buffer)
const = 0;
56 uint64_t
ReadUnsigned(
size_t bytes, offset_t offset, EndianType endiantype)
const;
59 uint64_t
ReadUnsigned(
size_t bytes, offset_t offset)
const;
62 int64_t
ReadSigned(
size_t bytes, offset_t offset, EndianType endiantype)
const;
65 int64_t
ReadSigned(
size_t bytes, offset_t offset)
const;
70 int GetByte(offset_t offset)
const;
77 virtual offset_t
WriteFile(
const std::shared_ptr<Writer>& wr, offset_t count, offset_t offset = 0)
const;
79 offset_t
WriteFile(
const std::shared_ptr<Writer>& wr)
const override;
Represents abstract data contents whose data can be written to a file.
Definition image.h:17
virtual offset_t ImageSize() const =0
Retrieves the offset of the byte after the last one belonging to this format from the first one.
virtual std::shared_ptr< const Image > AsImage() const
Retrieves a randomly accessible image.
Definition image.cc:10
virtual offset_t WriteFile(const std::shared_ptr< Writer > &wr) const =0
Writes data of non-zero filled sections.
int64_t ReadSigned(size_t bytes, offset_t offset, EndianType endiantype) const
Reads a signed number at a specific offset.
Definition image.cc:51
uint64_t ReadUnsigned(size_t bytes, offset_t offset, EndianType endiantype) const
Reads an unsigned number at a specific offset.
Definition image.cc:39
virtual size_t ReadData(size_t bytes, offset_t offset, void *buffer) const =0
Attempts to fill a buffer with data.
virtual offset_t WriteFile(const std::shared_ptr< Writer > &wr, offset_t count, offset_t offset=0) const
Writes data of non-zero filled sections.
Definition image.cc:68