52 lines
1.0 KiB
C++
52 lines
1.0 KiB
C++
/* -----------------------------------------------------------------------------
|
|
GSFramework
|
|
Copyright 2001-2013 Emmanuel Julien. All Rights Reserved.
|
|
----------------------------------------------------------------------------- */
|
|
|
|
|
|
#ifndef __NCOLORGRADIENT__
|
|
#define __NCOLORGRADIENT__
|
|
|
|
|
|
#include "ntypes.h"
|
|
#include "picture/pict.h"
|
|
#include "color/color.h"
|
|
|
|
|
|
namespace GS {
|
|
|
|
/*
|
|
@short Color gradient.
|
|
@author Emmanuel Julien (ejulien@nworks.fr)
|
|
*/
|
|
class Gradient
|
|
{
|
|
uint control_point_count;
|
|
|
|
Picture::BlendMode op;
|
|
|
|
public:
|
|
|
|
float k[8]; ///< Gradient coefficient.
|
|
Color color[8]; ///< Gradient color.
|
|
|
|
inline uint GetControlPointCount() const { return control_point_count; }
|
|
inline Picture::BlendMode GetOperator() const { return op; }
|
|
|
|
inline void SetOperator(Picture::BlendMode _op) { op = _op; }
|
|
inline void Reset() { control_point_count = 0; }
|
|
|
|
bool FromMetaTag(NML::Tag *);
|
|
|
|
Gradient()
|
|
{
|
|
control_point_count = 0;
|
|
op = Picture::BlendMultiply;
|
|
}
|
|
};
|
|
|
|
} // GS
|
|
|
|
|
|
#endif // __NCOLORGRADIENT__
|