COPASI API  4.40.278
CLGradientStops Class Reference

#include <CLGradientStops.h>

Public Member Functions

 CLGradientStops (const CLGradientBase *pGradient, const std::map< std::string, CLRGBAColor > &colormap)
 
const CLRGBAColorcolor () const
 
void update_color (double val)
 
 ~CLGradientStops ()
 

Protected Member Functions

void adjust_value (double &value) const
 

Protected Attributes

std::list< std::pair< double, unsigned int > >::const_iterator mBegin
 
CLRGBAColor mColor
 
unsigned char * mColorData
 
std::list< std::pair< double, unsigned int > >::const_iterator mCurrentPosition
 
std::list< std::pair< double, unsigned int > >::const_iterator mEnd
 
double mHelp
 
unsigned int mIndex
 
CLGradientBase::SPREADMETHOD mSpreadMethod
 
std::list< std::pair< double, unsigned int > > mStops
 
std::list< std::pair< double, unsigned int > >::const_iterator mTmp
 

Constructor & Destructor Documentation

◆ CLGradientStops()

◆ ~CLGradientStops()

CLGradientStops::~CLGradientStops ( )

References mColorData.

Member Function Documentation

◆ adjust_value()

void CLGradientStops::adjust_value ( double &  value) const
protected

This method takes the given offset value and adjust it if it is outside the rangr from 0.0 to 1.0 depending on the spread method that has been set from the gradient.

References mSpreadMethod, CLGradientBase::PAD, CLGradientBase::REFLECT, and CLGradientBase::REPEAT.

Referenced by update_color().

◆ color()

const CLRGBAColor & CLGradientStops::color ( ) const

◆ update_color()

void CLGradientStops::update_color ( double  val)

Given a relative value, this routine returns a const pointer to an rgba value that is 4 unsigned char long. If the gradient that was used to create the CLGradientStops object didn't have any gradient stops, the color that is returned is completly transparent black.

References adjust_value(), CLRGBAColor::mA, CLRGBAColor::mB, mBegin, mColor, mColorData, mCurrentPosition, mEnd, CLRGBAColor::mG, mHelp, mIndex, CLRGBAColor::mR, and mTmp.

Referenced by CLLayoutRenderer::create_linear_gradient_texture(), and CLLayoutRenderer::create_radial_gradient_texture().

Member Data Documentation

◆ mBegin

std::list<std::pair<double, unsigned int> >::const_iterator CLGradientStops::mBegin
protected

Referenced by CLGradientStops(), and update_color().

◆ mColor

CLRGBAColor CLGradientStops::mColor
protected

Referenced by color(), and update_color().

◆ mColorData

unsigned char* CLGradientStops::mColorData
protected

◆ mCurrentPosition

std::list<std::pair<double, unsigned int> >::const_iterator CLGradientStops::mCurrentPosition
protected

Referenced by CLGradientStops(), and update_color().

◆ mEnd

std::list<std::pair<double, unsigned int> >::const_iterator CLGradientStops::mEnd
protected

Referenced by CLGradientStops(), and update_color().

◆ mHelp

double CLGradientStops::mHelp
protected

Referenced by update_color().

◆ mIndex

unsigned int CLGradientStops::mIndex
protected

Referenced by CLGradientStops(), and update_color().

◆ mSpreadMethod

CLGradientBase::SPREADMETHOD CLGradientStops::mSpreadMethod
protected

Referenced by adjust_value().

◆ mStops

std::list<std::pair<double, unsigned int> > CLGradientStops::mStops
protected

Referenced by CLGradientStops().

◆ mTmp

std::list<std::pair<double, unsigned int> >::const_iterator CLGradientStops::mTmp
protected

Referenced by update_color().


The documentation for this class was generated from the following files: