27 std::istream *
is = bias->is;
30 is->read((
char*)&nlen, 1);
32 std::vector<char> buff(nlen);
33 is->read(&(buff[0]), nlen);
34 std::string name(buff.begin(), buff.end());
39 bias->deref.first.clear();
40 bias->deref.second.reset();
48 is->read(&(buff[0]), 4);
54 std::int16_t w = buff[0] | (buff[1] << 8);
55 std::int16_t h = buff[2] | (buff[3] << 8);
57 std::size_t imgwidth = w / 8 + ((w % 8) ? 1 : 0);
58 std::size_t length = imgwidth * h + 4;
62 is->read(&(buff[4]), length - 4);
63 if (!is->good() && !is->eof()) {
70 bias->deref.second = std::make_shared<BppImage>(buff);
90 std::uint32_t ver = buff[0] | (buff[1] << 8) | (buff[2] << 16) |
iterator begin()
Parses the first image in the stream and returns an iterator to that data.
boost::error_info< struct Info_ArchiveImageName, std::string > ImageArchiveImageName
The name of the image involved in an ImageArchiveError.
An input iterator that will parse and supply image data from the stream.
move_impl move(unsigned int c, unsigned int r)
Display stream manipulator that moves the display cursor to the given location.
The base class for errors resulting from the attempt to read an image archive stream or file...
BppImageArchiveFile(const std::string &path)
Opens the given file and parses headers at the start.
boost::error_info< struct Info_ImageArcFileName, std::string > ImageArchiveFileName
The name of the image archive file involved in an ImageArchiveStreamError.
void readHeader()
Parses the headers used in BppImageArchive files.
The stream appears to end early.
std::istream * is
The stream which contains image data.
boost::error_info< struct Info_ImageArcName, std::uint32_t > ImageArchiveVersion
The name of the image involved in an ImageArchiveError.
An attempt was made to advance past the end of a archive stream.
iterator & operator++()
Pre-increment operator; parses the next image.
The stream appears to not be an image archive.
General graphics related code.
#define DUDS_THROW_EXCEPTION(x)
Works like BOOST_THROW_EXCEPTION, but includes a stack trace if DUDS_ERRORS_VERBOSE is defined...
The archive is in an unsupported version of the format.