File: SbColor.i

package info (click to toggle)
pivy 0.6.10-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 11,232 kB
  • sloc: python: 36,331; cpp: 787; ansic: 733; makefile: 30; sh: 27; objc: 5
file content (31 lines) | stat: -rw-r--r-- 970 bytes parent folder | download | duplicates (11)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
%typemap(in) float hsv[3] (float temp[3]) {
  convert_SbVec3f_array($input, temp);
  $1 = temp;
}

%typemap(typecheck) float hsv[3] {
  $1 = PySequence_Check($input) ? 1 : 0;
}

%typemap(in) float *rgb (float temp[3]) {
  convert_SbVec3f_array($input, temp);
  $1 = temp;
}

%typemap(typecheck) float *rgb = float hsv[3];

%apply float *OUTPUT { float & h, float & s, float & v };

%ignore SbColor::getHSVValue(float hsv[3]) const;

%extend SbColor {
  SbColor __add__(const SbColor &u) { return *self + u; }
  SbColor __sub__(const SbColor &u) { return *self - u; }
  SbColor __mul__(const float d) { return *self * d; }
  SbColor __rmul__(const float d) { return *self * d; }
  SbColor __div__( const float d) { return *self / d; }
  int __eq__(const SbColor &u ) { return *self == u; }
  int __nq__(const SbColor &u) { return *self != u; }
  float __getitem__(int i) { return (self->getValue())[i]; }
  void  __setitem__(int i, float value) { (*self)[i] = value; }
}