GradientInterface Class Reference Data Types

#include <gradient.h>

详细描述

This is the interface for the 渐变 data type. The data is reference-counted and a copy will automatically be created if a non-const function is called. Alpha Gradients ONLY set Brightness, Color is always 1.0 Regular Gradients can set Brightness & Color

公共成员函数

MAXON_METHOD Result < 渐变 * >  AllocAlphaGradient ()
MAXON_METHOD 渐变 GetAlphaGradient ()
MAXON_METHOD void  SetIsAlphaGradient ( Bool alphaGradient)
MAXON_METHOD Bool   IsAlphaGradient () const
MAXON_METHOD COMPARERESULT   比较 (const GradientInterface *arg2) const
MAXON_METHOD HashInt   GetHashCode () const
MAXON_METHOD Result < GradientRenderData >  InitRender (const TransformColorDelegate &transformColorDelegate) const

私有成员函数

  MAXON_INTERFACE_NONVIRTUAL ( GradientInterface , MAXON_REFERENCE_COPY_ON_WRITE , "net.maxon.interface.gradient")

Knots

MAXON_METHOD Int   GetKnotCount () const
MAXON_METHOD Result < Int InsertKnot (const GradientKnot &knot, Bool keepId=false)
MAXON_METHOD Result < void >  RemoveKnot ( Int index)
MAXON_METHOD GradientKnot   GetKnot ( Int index) const
MAXON_METHOD Result < void >  SetKnot ( Int index, const GradientKnot &k)
MAXON_METHOD void  ConvertToAlphaGradient ()
MAXON_METHOD void  SortKnots ()
MAXON_METHOD Result < Bool InvertKnots ()
MAXON_METHOD Result < Bool DoubleKnots ()
MAXON_METHOD Bool   DistributeKnots ()
MAXON_METHOD void  Flush ()

成员函数文档编制

◆  MAXON_INTERFACE_NONVIRTUAL()

MAXON_INTERFACE_NONVIRTUAL ( GradientInterface   ,
MAXON_REFERENCE_COPY_ON_WRITE   ,
"net.maxon.interface.gradient"   
)
private

◆  AllocAlphaGradient()

MAXON_METHOD Result < 渐变 *> AllocAlphaGradient ( )

Allocates an alpha gradient.

返回
The alpha gradient.

◆  GetAlphaGradient()

MAXON_METHOD 渐变 * GetAlphaGradient ( )

Returns the internal alpha gradient.

返回
The alpha gradient.

◆  GetKnotCount()

MAXON_METHOD Int GetKnotCount ( ) const

Gets the number of knots.

返回
The knot count.

◆  InsertKnot()

MAXON_METHOD Result < Int > InsertKnot ( const GradientKnot knot ,
Bool   keepId = false  
)

Inserts a knot.

参数
[in] knot The knot to insert.
[in] keepId Specifies if the knot ID should be taken from knot or if a new one should be generated.
返回
The index of the inserted knot, GetKnotCount() - 1

◆  RemoveKnot()

MAXON_METHOD Result <void> RemoveKnot ( Int   index )

Removes a knot.

参数
[in] index The knot index. 0 <= index < GetKnotCount()
返回
OK on success.

◆  GetKnot()

MAXON_METHOD GradientKnot GetKnot ( Int   index ) const

Gets the knot at index .

参数
[in] index The knot index. 0 <= index < GetKnotCount()
返回
The knot.

◆  SetKnot()

MAXON_METHOD Result <void> SetKnot ( Int   index ,
const GradientKnot k  
)

Sets knot at index .

参数
[in] index The knot index. 0 <= index < GetKnotCount()
[in] k The knot.

◆  ConvertToAlphaGradient()

MAXON_METHOD void ConvertToAlphaGradient ( )

Converts the current gradient to an alpha gradient.

◆  SortKnots()

MAXON_METHOD void SortKnots ( )

Sorts the knots according to their position.

◆  InvertKnots()

MAXON_METHOD Result < Bool > InvertKnots ( )

Inverts the knots.

返回
True if any knot inverted, otherwise false.

◆  DoubleKnots()

MAXON_METHOD Result < Bool > DoubleKnots ( )

Doubles the knots.

返回
True if any knot doubled, otherwise false.

◆  DistributeKnots()

MAXON_METHOD Bool DistributeKnots ( )

Distributes the knots evenly.

返回
True if any knot distributed, otherwise false.

◆  Flush()

MAXON_METHOD void Flush ( )

Flushes all the knots.

◆  SetIsAlphaGradient()

MAXON_METHOD void SetIsAlphaGradient ( Bool   alphaGradient )

Sets the alpha mode.

参数
[in] alphaGradient The gradient alpha type.

◆  IsAlphaGradient()

MAXON_METHOD Bool IsAlphaGradient ( ) const

Checks if this is an alpha gradient.

返回
True, if this is an alpha gradient.

◆  Compare()

MAXON_METHOD COMPARERESULT 比较 ( const GradientInterface arg2 ) const

Compares this with another gradient.

参数
[in] arg2 The other gradient to compare with.
返回
The comparison result.

◆  GetHashCode()

MAXON_METHOD HashInt GetHashCode ( ) const

Gets the hash code for the gradient.

返回
The checksum.

◆  InitRender()

MAXON_METHOD Result <GradientRenderData> InitRender ( const TransformColorDelegate transformColorDelegate ) const

Initializes the gradient for rendering.

参数
[in] transformColorDelegate A delegate to transform the color of a gradient knot.
返回
The render data.