home *** CD-ROM | disk | FTP | other *** search
/ RISC DISC 3 / RISC_DISC_3.iso / resources / etexts / gems / gemsv / ch5_5 / pigment.cxx < prev    next >
C/C++ Source or Header  |  1995-03-04  |  802b  |  30 lines

  1. #include <iostream.h>
  2. #include <math.h>
  3.  
  4. #include "global.h"
  5.  
  6. ostream& operator<<(ostream& o, pigment& p) {
  7.         o<<"pigment {\n";
  8.         p.out(o);
  9.         o<<"turbulence "<<p.t<<"\n"<<"octaves "<<p.o<<"\n";
  10.         o<<"omega "<<p.m<<"\n"<<"lambda "<<p.l<<"\n";
  11.         o<<"frequency "<<p.f<<"\n"<<"phase "<<p.p<<"\n";
  12.         o<<"quick_color "<<p.q<<"\n"<<p.T;
  13.         o<<"}\n";
  14.         return o;
  15. }
  16.  
  17. ostream& operator<<(ostream& o, colormap& m) {
  18.         o<<"color_map{\n";
  19.         for(register int i=0; i<m.nI; i++) {
  20.                 o<<"    ["<<m.I[i].b<<", "<<m.I[i].e;
  21.                 o<<"  "<<m.I[i].cb<<"  "<<m.I[i].ce<<"]\n";
  22.         }
  23.         o<<"}\n";
  24.         return o;
  25. }
  26.  
  27. ostream& operator<<(ostream& o, colormapped& m) {
  28.         o<<"undefined colormapped {\n"<<m.cm<<"}\n"; return o;
  29. }
  30.