The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
filter.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2012 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 /**
16  * @file
17  * Filters for wesmage
18  */
19 
20 #ifndef WESMAGE_FILTER_HPP_INCLUDED
21 #define WESMAGE_FILTER_HPP_INCLUDED
22 
23 #include "sdl/utils.hpp"
24 
25 #include <string>
26 #include <vector>
27 
28 void
30 
31 /**
32  * Helper structure to describe what a filter does.
33  *
34  * This structure should make it easier to create help messages.
35  */
37 {
38  /**
39  * Constructor.
40  *
41  * Creates an object from a specially formated string. The string
42  * contains of a number of fields seperated by a pipe-symbol. The number
43  * of fields should be 2 + 3 * params, where params is the number of
44  * parameters of the filter. The fields are:
45  * * 1 The @ref tfilter_description::name
46  * * 2 The @ref tfilter_description::description
47  * After these two fields there are three fields per parameter, the
48  * fields are:
49  * * 1 The @ref tfilter_description::tparameter::name
50  * * 2 The @ref tfilter_description::tparameter::type
51  * * 3 The @ref tfilter_description::tparameter::description
52  *
53  * @param fmt The format string as described above.
54  */
55  explicit tfilter_description(const std::string& fmt);
56 
57  /**
58  * Name of the filter.
59  *
60  * This is the ID parameter given on the command line.
61  */
63 
64  /**
65  * Description of the filter.
66  *
67  * Shortly describes what the filter does.
68  */
70 
71  /** Describes a filter parameter. */
72  struct tparameter
73  {
74  /** The name of the parameter. */
76 
77  /** The C type of the parameter. */
79 
80  /** Describes what the parameter does. */
82  };
83 
84  /** The list of filter parameters. */
85  std::vector<tparameter> parameters;
86 };
87 
88 /** Returns the list of available filters. */
89 std::vector<tfilter_description>
90 filter_list();
91 
92 #endif
tfilter_description(const std::string &fmt)
Constructor.
Definition: filter.cpp:209
std::string name
Name of the filter.
Definition: filter.hpp:62
Helper structure to describe what a filter does.
Definition: filter.hpp:36
Describes a filter parameter.
Definition: filter.hpp:72
surf
Definition: filter.cpp:143
std::vector< tfilter_description > filter_list()
Returns the list of available filters.
Definition: filter.cpp:239
std::string type
The C type of the parameter.
Definition: filter.hpp:78
std::vector< tparameter > parameters
The list of filter parameters.
Definition: filter.hpp:85
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glew.h:3448
std::string descripton
Describes what the parameter does.
Definition: filter.hpp:81
std::string name
The name of the parameter.
Definition: filter.hpp:75
void filter_apply(surface &surf, const std::string &filter)
GLsizei const GLcharARB ** string
Definition: glew.h:4503
std::string description
Description of the filter.
Definition: filter.hpp:69