HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
COP2_Parse.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: COP2_Parse.h
7  *
8  * COMMENTS:
9  * Parses a plane creation expression.
10  */
11 #ifndef COP2_PARSE_H
12 #define COP2_PARSE_H
13 
14 #include "COP2_API.h"
15 #include <TIL/TIL_Defines.h>
16 class TIL_Sequence;
17 class UT_String;
18 
20 {
21 public:
23  ~COP2_Parse();
24 
25  // creates planes from the passed string.
26  // syntax <Name> [(N)] [{C1,C2[,C3[,C4]]}] [:i8|i16|i32|f32[(B,W)]
27  // Name = vector name
28  // N = array size (int)
29  // C1/C2/C3/C4 = component name
30  // B/W = Black/white points (int)
31  int parse(UT_String &create_string, TIL_DataFormat default_type,
32  int use_bw, int b, int w);
33 
34  // Scopes the channels in the sequence with the passed string
35  // (sets the plane masks).
36  // returns 0 if the scope string is invalid.
37  // If allow_partially_scoped_planes is false, then entire planes are
38  // scoped.
39  int scope(UT_String &scope_string,
40  bool allow_partially_scoped_planes);
41 
42  void frameScope(UT_String &frame_scope, bool scope,
43  int start, int length = 1);
44 
45  const char *getError() const;
46 
47 private:
48  int parseSingle(char *create, int length);
49  int parseVector(char *comps, int length);
50  int parsePoints(char *pnts, int length);
51 
52  int scopeSingle(char *scope, int length,
53  bool allow_partially_scoped_planes);
54  int scopeArray(char *bounds, int length);
55 
56  void createPlanes(const char *name);
57  void addError(const char *error);
58 
59  TIL_Sequence *mySequence;
60 
61  // parsing stuff...
62  TIL_DataFormat myDefaultType;
63  TIL_DataFormat myPlaneType;
64  int myPlaneArraySize;
65  int myPlaneBlack;
66  int myPlaneWhite;
67  int myPlaneUsePoints;
68  int myDefaultBlack;
69  int myDefaultWhite;
70 
71  // scoping stuff...
72  int myCompScope;
73  int myCompCount;
74  char myComp[PLANE_MAX_VECTOR_SIZE][256];
75  int myArrayScope;
76  int myArrayStart, myArrayEnd, myArrayStep;
77 
78  // error reporting.
79  const char *myError;
80 };
81 
82 
83 
84 
85 #endif
GLuint start
Definition: glcorearb.h:475
GLuint GLsizei GLsizei * length
Definition: glcorearb.h:795
< returns > If no error
Definition: snippets.dox:2
#define TIL_DataFormat
Definition: TIL_Defines.h:65
#define PLANE_MAX_VECTOR_SIZE
Definition: TIL_Defines.h:167
GLuint const GLchar * name
Definition: glcorearb.h:786
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
#define COP2_API
Definition: COP2_API.h:10
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857