File: color4.h

package info (click to toggle)
atom4 4.1-10
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 908 kB
  • sloc: cpp: 4,451; makefile: 25; perl: 6
file content (32 lines) | stat: -rw-r--r-- 614 bytes parent folder | download | duplicates (7)
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
32
/*
 * Atom-4 triboard celltype wrapper
 * Header file
 *
 * $Id$
 */

#ifndef COLOR4_H
#define COLOR4_H

#include "triboard.h"


class color4 {
  celltype val;
public:
  color4(celltype c=BAD_CELL) : val(c) {}
  operator celltype () { return val; }

  int colortype();		// -1 = invalid, 0 = propagator, 1 = additive,
				// 2 = subtractive
  color4 propagator() { return propagator(colortype()); }
  static color4 propagator(int type);

  color4 complement() { return color4(((val-'a')^7) + 'a'); }
  color4 mix(color4 c);

  color4 rotl();		// rotate left
  color4 rotr();		// rotate right
};

#endif // COLOR4_H