24 #include <SDL_image.h>
37 "Helper program to create images for the unit tests.\n"
39 "The DIR is the output directory, will be created if doesn't exist.\n"
41 "-h, --help Show this help and terminate the program.\n"
62 for(Uint32
r = 0;
r < 256;
r += 4) {
63 for(Uint32
g = 0;
g < 256;
g += 2) {
64 for(Uint32
b = 0;
b < 256;
b += 2, ++
pixels) {
66 *pixels = (0xFF << 24) | (
r << 16) | (
g << 8) |
b;
98 typedef std::pair<std::string, tfunctor>
tcreator;
115 if(root ==
"-h" || root ==
"--help") {
141 for(
const tcreator& creator : creators) {
142 creator.second(base_image, root + creator.first);
146 std::cerr <<
"Error: Failed with error »" << err.
message <<
"«.\n";
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
GLvoid **typedef void(GLAPIENTRY *PFNGLGETVERTEXATTRIBDVPROC)(GLuint
std::pair< std::string, tfunctor > tcreator
void blend_image(const surface &src, tblend_functor functor)
static surface create_image_base(const std::string &filename)
bool save_image(const locator &i_locator, const std::string &filename)
GLdouble GLdouble GLdouble b
bool is_directory(const std::string &fname)
Returns true if the given file is a directory.
Helper class for pinning SDL surfaces into memory.
const std::string ¶meters float amount
bool make_directory(const std::string &dirname)
Declarations for File-IO.
GLdouble GLdouble GLdouble r
std::string blend_get_filename(std::string root, const Uint8 amount, const Uint32 color)
static const tcreator creators[]
static void create_image_blend(const surface &src, const std::string &root)
static void create_image_blend_functor(const surface &dst, const std::string root, const Uint8 amount, const Uint32 color)
int main(int argc, char *argv[])
void(* tfunctor)(const surface &, const std::string &)
bool file_exists(const std::string &name)
Returns true if a file or directory with such name already exists.
GLsizei const GLcharARB ** string