25 #include <SDL_image.h>
33 clock_t begin = std::clock();
34 clock_t
end = std::clock();
36 while(begin == (end = std::clock())) {
39 std::cout <<
"Clock resolution "
41 <<
" ticks, using " << CLOCKS_PER_SEC <<
" ticks/second.\n"
42 <<
"This give resolution of about "
43 <<
static_cast<double>(end - begin) / CLOCKS_PER_SEC
48 while(begin == (end = std::clock())) {
56 main(
int argc,
char* argv[])
65 std::cerr <<
"Error: Failed to load input file »"
73 if(options.
count != 1) {
74 for(
int i = 1;
i < options.
count; ++
i) {
79 surfaces.push_back(
surf);
83 for(
int i = 0;
i < options.
count; ++
i) {
90 const clock_t
end = std::clock();
91 std::cout <<
"Applying the filters took "
94 <<
static_cast<double>(end - begin) / CLOCKS_PER_SEC
102 }
catch(
const texit& exit) {
105 std::cerr <<
"Error: Failed with error »" << err.
message <<
"«.\n";
A singleton class containing the parsed command line parameters.
bool time
Display the time that applying the filters took.
std::string output_filename
The filename of the output file.
bool save_image(const locator &i_locator, const std::string &filename)
int main(int argc, char *argv[])
std::string input_filename
The filename of the input file.
This exception when throw should terminate the application.
const GLvdpauSurfaceNV * surfaces
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
surface make_neutral_surface(const surface &surf)
Command line parameters for wesmage.
int status
The exit status for the application.
static const toptions & parse(int argc, char *argv[])
Parses the command line.
int count
The number of times the filter has to be applied.
void filter_apply(surface &surf, const std::string &filter)
static clock_t get_begin_time()
GLsizei const GLcharARB ** string
std::vector< std::string > filters
The filters to apply to the input file.