openMSX
BaseImage.cc
Go to the documentation of this file.
1#include "BaseImage.hh"
2#include "MSXException.hh"
3
4namespace openmsx {
5
6static constexpr int MAX_SIZE = 2048;
7
9{
10 auto [w, h] = size;
11 if (w < -MAX_SIZE || w > MAX_SIZE) {
12 throw MSXException("Image width too large: ", w,
13 " (max ", MAX_SIZE, ')');
14 }
15 if (h < -MAX_SIZE || h > MAX_SIZE) {
16 throw MSXException("Image height too large: ", h,
17 " (max ", MAX_SIZE, ')');
18 }
19}
20
21} // namespace openmsx
gl::ivec2 size
Definition: BaseImage.hh:31
static void checkSize(gl::ivec2 size)
Performs a sanity check on image size.
Definition: BaseImage.cc:8
This file implemented 3 utility functions:
Definition: Autofire.cc:9
size_t size(std::string_view utf8)