00001
00002
00003
00004
00005
00006 #ifndef SHADEBLEND_H
00007 #define SHADEBLEND_H
00008
00009 #include<Shade.h>
00010
00011 #include<vector>
00012 #include<pair.h>
00013
00014 typedef RefCount<Shade> RefShade;
00015
00018 class ShadeBlend : public Shade
00019 {
00020 DYNAMIC_OBJECT;
00021 public:
00026 typedef enum Operation {
00027 NoOp,
00028 Add,
00029 Multiply,
00030 Layer,
00031 In,
00032 HeldOut,
00033 Atop,
00034 Xor
00035 };
00036
00037 void blend(Operation o, RefShade &s);
00038
00039
00040 Color4 calculateColor(const SurfaceInfo &s, Scene &scene);
00041
00042
00043 void parseSymbol(Token &t, ObjectFile &file);
00044 void writeParams(ostream &stream);
00045
00046 private:
00047
00048 void createSymbols();
00049
00050 vector< pair<Operation, RefShade> > array;
00051
00052 private:
00053 typedef DynamicObject super;
00054 };
00055 #endif