Mercurial > hg > octave-nkf
changeset 6564:efa1716abd4c
[project @ 2007-04-23 19:32:01 by jwe]
author | jwe |
---|---|
date | Mon, 23 Apr 2007 19:33:36 +0000 |
parents | 7a65c1a09ec3 |
children | 3e2cfed6c87e |
files | src/graphics.cc |
diffstat | 1 files changed, 18 insertions(+), 18 deletions(-) [+] |
line wrap: on
line diff
--- a/src/graphics.cc +++ b/src/graphics.cc @@ -65,10 +65,10 @@ public: color_property (double r = 0, double g = 0, double b = 1, double a = 1) { - rgba[0] = r; - rgba[1] = g; - rgba[2] = b; - rgba[3] = a; + xrgba[0] = r; + xrgba[1] = g; + xrgba[2] = b; + xrgba[3] = a; validate (); } @@ -87,7 +87,7 @@ if (! error_state && m.numel () >= 3 && m.numel () <= 4) { for (int i = 0; i < m.numel (); i++) - rgba[i] = m(i); + xrgba[i] = m(i); validate (); } @@ -96,7 +96,7 @@ std::string c = val.string_value (); if (! error_state && c.length () == 1) - c2rgb(c[0]); + c2rgba (c[0]); else error ("invalid color specification"); } @@ -106,7 +106,7 @@ { for (int i = 0; i < 4; i++) { - if (rgba[i] < 0 || rgba[i] > 1) + if (xrgba[i] < 0 || xrgba[i] > 1) { error ("invalid RGB color specification"); break; @@ -119,18 +119,18 @@ Matrix retval (1, 4); for (int i = 0; i < 4 ; i++) - retval(i) = rgba[i]; + retval(i) = xrgba[i]; return retval; } const double* rgba (void) const { - return rgba; + return xrgba; } private: - double rgba[4]; + double xrgba[4]; void c2rgba (char c) { @@ -139,31 +139,31 @@ switch(c) { case 'r': - tmp_rgb[0] = 1; + tmp_rgba[0] = 1; break; case 'g': - tmp_rgb[1] = 1; + tmp_rgba[1] = 1; break; case 'b': - tmp_rgb[2] = 1; + tmp_rgba[2] = 1; break; case 'c': - tmp_rgb[1] = tmp_rgb[2] = 1; + tmp_rgba[1] = tmp_rgba[2] = 1; break; case 'm': - tmp_rgb[0] = tmp_rgb[2] = 1; + tmp_rgba[0] = tmp_rgba[2] = 1; break; case 'y': - tmp_rgb[0] = tmp_rgb[1] = 1; + tmp_rgba[0] = tmp_rgba[1] = 1; break; case 'w': - tmp_rgb[0] = tmp_rgb[1] = tmp_rgb[2] = 1; + tmp_rgba[0] = tmp_rgba[1] = tmp_rgba[2] = 1; break; default: @@ -173,7 +173,7 @@ if (! error_state) { for (int i = 0; i < 4; i++) - rgba[i] = tmp_rgba[i]; + xrgba[i] = tmp_rgba[i]; } } };