v_sim.Shade¶
Fields¶
None
Methods¶
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
class  | 
  | 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Details¶
- class v_sim.Shade¶
 Short name to address _ToolShade objects.
- classmethod getById(id)¶
 - Parameters:
 id (
int) – an id.- Returns:
 a
v_sim.Shadefrom the pool.- Return type:
 
Convenience function calling
v_sim.Pool.getById() on the defaultv_sim.Shadestorage.New in version 3.8.
- classmethod getStorage()¶
 - Returns:
 a pointer to the internal shade list.
- Return type:
 
It returns a read-only pointer to the internal shade list. Use tool_shade_appendList() to add new shades to this list.
New in version 3.8.
- classmethod new(labelUTF8, vectA, vectB, colorMode)¶
 - Parameters:
 labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;vectA (
float) – an array of three floating point values ;vectB (
float) – an array of three floating point values ;colorMode (
v_sim.ShadeColorMode) – an integer that describes the color code (seev_sim.ShadeColorModeenumeration).
- Returns:
 the newly created
v_sim.Shade.- Return type:
 
Create a linear shade. Its profile is given by an AX+B formula, dealing on three channels. These channels are defined by the colorMode parameter. All given values are copied when the new shade is created.
- classmethod newFromData(labelUTF8, len, vectCh1, vectCh2, vectCh3, colorMode)¶
 - Parameters:
 labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;len (
int) – the size of arguments vectCh1, vectCh2 and vectCh3 ;vectCh1 (
float) – an array of floating point values for the first channel ;vectCh2 (
float) – an array of floating point values for the second channel ;vectCh3 (
float) – an array of floating point values for the third channel ;colorMode (
v_sim.ShadeColorMode) – an integer that describes the color code (seev_sim.ShadeColorModeenumeration).
- Returns:
 the newly created
v_sim.Shade.- Return type:
 
Create a
v_sim.Shadefrom direct data for three channels. These channels are defined by the colorMode parameter. All given values are copied when the new shade is created.
- classmethod newFromSteps(labelUTF8, lst, colorMode)¶
 - Parameters:
 labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;lst ([
v_sim.ShadeStep]) – a list of color steps.colorMode (
v_sim.ShadeColorMode) – av_sim.ShadeColorModemode.
- Returns:
 the newly created
v_sim.Shade.- Return type:
 
Create a
v_sim.Shadefrom a set of steps defining colours at given indexes. These channels are defined by the colorMode parameter. All given values are copied when the new shade is created. The values of indexes will be normalised by this call to range in [0;1]. Colour channel values must be in [0;1] for each step.New in version 3.7.
- classmethod newFromString(labelUTF8, descr, colorMode)¶
 - Parameters:
 labelUTF8 (
str) – a UTF8 string that shortly named this new shade ;descr (
str) – a string with the shade description.colorMode (
v_sim.ShadeColorMode) – av_sim.ShadeColorModemode.
- Raises:
 - Returns:
 the newly created
v_sim.Shade.- Return type:
 
As
v_sim.Shade.newFromSteps() routine, but it takes an unparsed string describing the steps in descr.New in version 3.7.
- channelToRGB(rgba, values)¶
 - Parameters:
 
Like
v_sim.Shade.valueToRGB() but here, the three values are applied respectivly for the Red, the Green and the Blue channel.
- compare(sh2)¶
 - Parameters:
 sh2 (
v_sim.Shade) – av_sim.Shade.- Returns:
 Trueif shade1 is equivalent to shade2.- Return type:
 
Compare if the two shade are identical (first, smae mode, then same values).
- copy()¶
 - Returns:
 a newly created shade.
- Return type:
 
Create a new shade deep copy of the first.
- free()¶
 Free all dynamic memory from self and free self itself.
- getColorMode()¶
 - Returns:
 the color mode.
- Return type:
 
Get the color mode of the shade (RGB or HSV).
- getLabel()¶
 - Returns:
 a string naming the shade.
- Return type:
 
Get the name (in UTF8) of the shade.
- getLinearCoeff(vectA, vectB)¶
 - Parameters:
 - Returns:
 Trueif vectA, vectB and vectX have been set correctly.- Return type:
 
This methods can get the linear color transformation. The given arrays (vectA, vectB) are read-only. This method return
Falseif the self is not in av_sim.ShadeMode.LINEARstate.
- getMode()¶
 - Returns:
 the mode.
- Return type:
 
Get the mode of the shade (linear, array…).
- setColorMode(mode)¶
 - Parameters:
 mode (
v_sim.ShadeColorMode) – a new mode for the shade.- Returns:
 Trueif mode is different from previous self mode.- Return type:
 
Change the mode of the shade, see
v_sim.ShadeColorMode.