29 #ifndef NOMLIB_SDL2_GRADIENT_HPP
30 #define NOMLIB_SDL2_GRADIENT_HPP
38 #include "nomlib/config.hpp"
39 #include "nomlib/math/Coords.hpp"
40 #include "nomlib/math/Color.hpp"
41 #include "nomlib/graphics/IDrawable.hpp"
42 #include "nomlib/graphics/shapes/Rectangle.hpp"
43 #include "nomlib/system/make_unique.hpp"
53 typedef std::shared_ptr<Gradient> SharedPtr;
54 typedef std::unique_ptr<Gradient> UniquePtr;
76 Color gradient_color[2],
86 Color gradient_color[2],
91 const Coords getPosition (
void )
const;
92 const Coords getSize (
void )
const;
93 Color getStartColor (
void )
const;
94 Color getEndColor (
void )
const;
96 bool dithering (
void )
const;
98 void setStartColor (
const Color& starting_color );
99 void setEndColor (
const Color& ending_color );
100 void reverseColors (
void );
102 void setPosition ( int32 x, int32 y );
103 void setSize ( int32 width, int32 height );
104 void setMargins ( int32 x, int32 y );
105 void enableDithering (
bool toggle );
108 void draw ( RenderTarget target )
const;
111 void strategyTopDown (
void );
112 void strategyLeftToRight (
void );
150 #endif // include guard defined
void initialize(Color gradient_color[2], const Coords &bounds, int32 x_margin, int32 y_margin, Gradient::FillDirection direction)
Fully initialize this object.
virtual ~Gradient(void)
Destructor; OK to inherit me.
IDrawable::UniqueDrawables rectangles
void draw(RenderTarget target) const
Render the object onto the primary video buffer – your visible screen.
int32 x_margin
x coordinate offset
bool enable_dithering
Toggle automatic dithering of colors.
Base interface class for grouping objects under a united front.
enum Gradient::FillDirection fill_direction
Color fill axis – X or Y increment.
Rectangle fill class with dithered, linear gradient colors.
Coords coords
Rendering coordinates (X, Y, width & height)
Coordinate values (x, y, z, width, height ) wrapper.
int32 y_margin
y coordinate offset
std::vector< std::unique_ptr< IDrawable > > UniqueDrawables
std::unique_ptr vector container type
Utility class container for RGBA colors.