File: Color4.cpp

package info (click to toggle)
imath 3.1.12-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,468 kB
  • sloc: cpp: 44,687; ansic: 171; sh: 153; python: 60; makefile: 32
file content (17 lines) | stat: -rw-r--r-- 353 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include <Imath/ImathColor.h>
#include <cassert>

void
color4_example()
{
    Imath::C4f   r (1.0f, 0.0f, 0.0f, 1.0f);
    Imath::C4f   g (0.0f, 1.0f, 0.0f, 1.0f);
    Imath::C4f   b (0.0f, 0.0f, 1.0f, 1.0f);
    
    Imath::C4f   w = r + g + b;

    assert (w.r == 1.0f);
    assert (w.g == 1.0f);
    assert (w.b == 1.0f);
    assert (w.a == 3.0f);
}