Colord.Vec3

Fields

Name Type Access Description
v0 float r/w  
v1 float r/w  
v2 float r/w  

Methods

  add (src2, dest)
  clear ()
  copy (dest)
  get_data ()
  init (v0, v1, v2)
  scalar_multiply (value, dest)
  squared_error (src2)
  subtract (src2, dest)
  to_string ()

Details

class Colord.Vec3
add(src2, dest)[source]
Parameters:

Adds two vector quantaties The arguments src and dest can be the same value.

clear()[source]

Clears a vector, setting all it’s values to zero.

copy(dest)[source]
Parameters:dest (Colord.Vec3) – the destination

Copies the vector into another vector. The arguments self and dest cannot be the same value.

get_data()[source]
Returns:the pointer to the data segment.
Return type:float

Gets the raw data for the vector.

init(v0, v1, v2)[source]
Parameters:
  • v0 (float) – component value
  • v1 (float) – component value
  • v2 (float) – component value

Initialises a vector.

scalar_multiply(value, dest)[source]
Parameters:
  • value (float) – the scalar multiplier
  • dest (Colord.Vec3) – the destination

Multiplies a vector with a scalar. The arguments self and dest can be the same value.

squared_error(src2)[source]
Parameters:src2 (Colord.Vec3) – another vector source
Returns:the floating point MSE.
Return type:float

Gets the mean squared error for a pair of vectors

subtract(src2, dest)[source]
Parameters:

Subtracts one vector quantity from another The arguments src and dest can be the same value.

to_string()[source]
Returns:the string. Free with GLib.free()
Return type:str

Obtains a string representaton of a vector.