home *** CD-ROM | disk | FTP | other *** search
/ Archive Magazine 1996 / ARCHIVE_96.iso / discs / shareware / share_43 / source / h / FRAME < prev    next >
Text File  |  1991-08-22  |  15KB  |  617 lines

  1. /*****************************************************************************
  2. *
  3. *                                   frame.h
  4. *
  5. *   from DKBTrace (c) 1990  David Buck
  6. *
  7. *  This header file is included by all C modules in DKBTrace.  It defines all
  8. *  globally-accessible types and constants.
  9. *
  10. * This software is freely distributable. The source and/or object code may be
  11. * copied or uploaded to communications services so long as this notice remains
  12. * at the top of each file.  If any changes are made to the program, you must
  13. * clearly indicate in the documentation and in the programs startup message
  14. * who it was who made the changes. The documentation should also describe what
  15. * those changes were. This software may not be included in whole or in
  16. * part into any commercial package without the express written consent of the
  17. * author.  It may, however, be included in other public domain or freely
  18. * distributed software so long as the proper credit for the software is given.
  19. *
  20. * This software is provided as is without any guarantees or warranty. Although
  21. * the author has attempted to find and correct any bugs in the software, he
  22. * is not responsible for any damage caused by the use of the software.  The
  23. * author is under no obligation to provide service, corrections, or upgrades
  24. * to this package.
  25. *
  26. * Despite all the legal stuff above, if you do find bugs, I would like to hear
  27. * about them.  Also, if you have any comments or questions, you may contact me
  28. * at the following address:
  29. *
  30. *     David Buck
  31. *     22C Sonnet Cres.
  32. *     Nepean Ontario
  33. *     Canada, K2H 8W7
  34. *
  35. *  I can also be reached on the following bulleton boards:
  36. *
  37. *     ATX              (613) 526-4141
  38. *     OMX              (613) 731-3419
  39. *     Mystic           (613) 731-0088 or (613) 731-6698
  40. *
  41. *  Fidonet:   1:163/109.9
  42. *  Internet:  David_Buck@Carleton.CA
  43. *
  44. *  IBM Port by Aaron A. Collins. Aaron may be reached on the following BBS'es:
  45. *
  46. *     Lattice BBS                      (708) 916-1200
  47. *     The Information Exchange BBS     (708) 945-5575
  48. *     Stillwaters BBS                  (708) 403-2826
  49. *
  50. *****************************************************************************/
  51.  
  52.  
  53. /* Generic header for all modules */
  54.  
  55. #include "config.h"
  56. #include <stdio.h>
  57. #include <string.h>
  58. #include <math.h>
  59.  
  60. #ifndef TRUE
  61. #define TRUE 1
  62. #define FALSE 0
  63. #endif
  64.  
  65. #ifndef FILE_NAME_LENGTH
  66. #define FILE_NAME_LENGTH 150
  67. #endif
  68.  
  69. #ifndef DBL
  70. #define DBL double
  71. #endif
  72.  
  73. #ifndef HUGE_VAL
  74. #define HUGE_VAL 1.0e+17
  75. #endif
  76.  
  77. #ifndef DBL_FORMAT_STRING
  78. #define DBL_FORMAT_STRING "%lf"
  79. #endif
  80.  
  81. #ifndef TEST_ABORT
  82. #define TEST_ABORT
  83. #endif
  84.  
  85. /* These values determine the minumum and maximum distances
  86.    that qualify as ray-object intersections */
  87. #define Small_Tolerance 0.001
  88. #define Max_Distance 1.0e7
  89.  
  90. typedef struct q_entry INTERSECTION;
  91. typedef struct Vector_Struct VECTOR;
  92. typedef DBL MATRIX [4][4];
  93. typedef struct Colour_Struct COLOUR;
  94. typedef struct Colour_Map_Entry COLOUR_MAP_ENTRY;
  95. typedef struct Colour_Map_Struct COLOUR_MAP;
  96. typedef struct Transformation_Struct TRANSFORMATION;
  97. typedef struct Image_Struct IMAGE;
  98. typedef struct Texture_Struct TEXTURE;
  99. typedef struct Method_Struct METHODS;
  100. typedef struct Viewpoint_Struct VIEWPOINT;
  101. typedef struct Object_Shape SHAPE;
  102. typedef struct Object_Struct OBJECT;
  103. typedef struct Sphere_Shape SPHERE;
  104. typedef struct Quadric_Shape QUADRIC;
  105. typedef struct Triangle_Shape TRIANGLE;
  106. typedef struct Smooth_Triangle_Shape SMOOTH_TRIANGLE;
  107. typedef struct Plane_Shape PLANE;
  108. typedef struct CSG_Type CSG_SHAPE;
  109. typedef struct Composite_Object_Struct COMPOSITE;
  110. typedef struct Ray_Struct RAY;
  111. typedef struct Frame_Struct FRAME;
  112. typedef struct prioq_struct PRIOQ;
  113. typedef enum Token_Type TOKEN;
  114. typedef enum Constant_Type CONSTANT;
  115. typedef struct Chunk_Header_Struct CHUNK_HEADER;
  116.  
  117. struct Vector_Struct
  118.    {
  119.    DBL x, y, z;
  120.    };
  121.  
  122.  
  123.  
  124. struct Colour_Struct
  125.    {
  126.    DBL Red, Green, Blue, Alpha;
  127.    };
  128.  
  129.  
  130. struct Colour_Map_Entry
  131.    {
  132.    DBL start, end;
  133.    COLOUR Start_Colour, End_Colour;
  134.    };
  135.  
  136.  
  137. struct Colour_Map_Struct
  138.    {
  139.    int Number_Of_Entries;
  140.    COLOUR_MAP_ENTRY *Colour_Map_Entries;
  141.    };
  142.  
  143.  
  144. struct Transformation_Struct
  145.    {
  146.    MATRIX matrix;
  147.    MATRIX inverse;
  148.    };
  149.  
  150.  
  151. struct Image_Struct
  152.    {
  153.    DBL width, height;
  154.    int iwidth, iheight;
  155.    unsigned char *red, *green, *blue;
  156.    };
  157.  
  158.  
  159. enum Texture_Type { NO_TEXTURE, BOZO_TEXTURE, MARBLE_TEXTURE, WOOD_TEXTURE, CHECKER_TEXTURE, SPOTTED_TEXTURE, AGATE_TEXTURE, GRANITE_TEXTURE, GRADIENT_TEXTURE, IMAGEMAP_TEXTURE } ;
  160.  
  161. enum Bump_Type { NO_BUMPS, WAVES, RIPPLES, WRINKLES, BUMPS, DENTS };
  162.  
  163. struct Texture_Struct
  164.    {
  165.    DBL Object_Reflection;
  166.    DBL Object_Ambient;
  167.    DBL Object_Diffuse, Object_Brilliance;
  168.    DBL Object_Index_Of_Refraction;
  169.    DBL Object_Refraction;
  170.    DBL Object_Specular, Object_Roughness;
  171.    DBL Object_Phong, Object_PhongSize;
  172.    DBL Bump_Amount;
  173.    DBL Texture_Randomness;
  174.    DBL Frequency;
  175.    DBL Phase;
  176.    enum Texture_Type Texture_Number ;
  177.    enum Bump_Type Bump_Number;
  178.    TRANSFORMATION *Texture_Transformation;
  179.    COLOUR Colour1;
  180.    COLOUR Colour2;
  181.    DBL Turbulence;
  182.    VECTOR Texture_Gradient;
  183.    COLOUR_MAP *Colour_Map;
  184.    IMAGE *Image;
  185.    short Once_Flag;
  186.    };
  187.  
  188. enum Object_Type {SPHERE_TYPE, TRIANGLE_TYPE, SMOOTH_TRIANGLE_TYPE, PLANE_TYPE,
  189.                   QUADRIC_TYPE, COMPOSITE_TYPE, OBJECT_TYPE,
  190.                   CSG_UNION_TYPE, CSG_INTERSECTION_TYPE, CSG_DIFFERENCE_TYPE,
  191.                   VIEWPOINT_TYPE };
  192.  
  193. struct Object_Struct
  194.    {
  195.    METHODS *Methods;
  196.    enum Object_Type Type;
  197.    struct Object_Struct *Next_Object;
  198.    struct Object_Struct *Next_Light_Source;
  199.    SHAPE *Bounding_Shapes;
  200.    SHAPE *Shape;
  201.    char Light_Source_Flag;
  202.    char Transparency;
  203.    VECTOR  Object_Center;
  204.    COLOUR Object_Colour;
  205.    TEXTURE *Object_Texture;
  206.    };
  207.  
  208.  
  209. typedef INTERSECTION *(*INTERSECTION_METHOD)PARAMS((OBJECT *, RAY *));
  210. typedef int (*ALL_INTERSECTIONS_METHOD)PARAMS((OBJECT *, RAY *, PRIOQ *));
  211. typedef int (*INSIDE_METHOD)PARAMS((VECTOR *, OBJECT *));
  212. typedef void (*NORMAL_METHOD)PARAMS((VECTOR *, OBJECT *, VECTOR *));
  213. typedef void *(*COPY_METHOD)PARAMS((OBJECT *));
  214. typedef void (*TRANSLATE_METHOD)PARAMS((OBJECT *, VECTOR *));
  215. typedef void (*ROTATE_METHOD)PARAMS((OBJECT *, VECTOR *));
  216. typedef void (*SCALE_METHOD)PARAMS((OBJECT *, VECTOR *));
  217. typedef void (*INVERT_METHOD)PARAMS((OBJECT *));
  218.  
  219. struct Method_Struct
  220.    {
  221.    INTERSECTION_METHOD Intersection_Method;
  222.    ALL_INTERSECTIONS_METHOD All_Intersections_Method;
  223.    INSIDE_METHOD Inside_Method;
  224.    NORMAL_METHOD Normal_Method;
  225.    COPY_METHOD Copy_Method;
  226.    TRANSLATE_METHOD Translate_Method;
  227.    ROTATE_METHOD Rotate_Method;
  228.    SCALE_METHOD Scale_Method;
  229.    INVERT_METHOD Invert_Method;
  230.    };
  231.  
  232.  
  233. #define All_Intersections(x,y,z) ((*((x)->Methods->All_Intersections_Method)) (x,y,z))
  234. #define Intersection(x,y) ((*((x)->Methods->Intersection_Method)) (x,y))
  235. #define Inside(x,y) ((*((y)->Methods->Inside_Method)) (x,y))
  236. #define Normal(x,y,z) ((*((y)->Methods->Normal_Method)) (x,y,z))
  237. #define Copy(x) ((*((x)->Methods->Copy_Method)) (x))
  238. #define Translate(x,y) ((*((x)->Methods->Translate_Method)) (x,y))
  239. #define Scale(x,y) ((*((x)->Methods->Scale_Method)) (x,y))
  240. #define Rotate(x,y) ((*((x)->Methods->Rotate_Method)) (x,y))
  241. #define Invert(x) ((*((x)->Methods->Invert_Method)) (x))
  242.  
  243. struct Viewpoint_Struct
  244.    {
  245.    METHODS *Methods;
  246.    enum Object_Type Type;
  247.    VECTOR Location;
  248.    VECTOR Direction;
  249.    VECTOR Up;
  250.    VECTOR Right;
  251.    VECTOR Sky;
  252.    };
  253.  
  254.  
  255. struct Object_Shape
  256.    {
  257.    METHODS *Methods;
  258.    enum Object_Type Type;
  259.    struct Object_Shape *Next_Object;
  260.    void *Parent_Object;
  261.    };
  262.  
  263.  
  264. struct Sphere_Shape
  265.    {
  266.    METHODS *Methods;
  267.    enum Object_Type Type;
  268.    SHAPE *Next_Object;
  269.    OBJECT *Parent_Object;
  270.    VECTOR  Center;
  271.    DBL     Radius;
  272.    DBL     Radius_Squared;
  273.    DBL     Inverse_Radius;
  274.    VECTOR  VPOtoC;
  275.    DBL     VPOCSquared;
  276.    short   VPinside, VPCached, Inverted;
  277.    };
  278.  
  279.  
  280. struct Quadric_Shape
  281.    {
  282.    METHODS *Methods;
  283.    enum Object_Type Type;
  284.    SHAPE *Next_Object;
  285.    OBJECT *Parent_Object;
  286.    VECTOR  Object_2_Terms;
  287.    VECTOR  Object_Mixed_Terms;
  288.    VECTOR  Object_Terms;
  289.    DBL Object_Constant;
  290.    DBL Object_VP_Constant;
  291.    int Constant_Cached;
  292.    int Non_Zero_Square_Term;
  293.    };
  294.  
  295.  
  296. #define X_AXIS 0
  297. #define Y_AXIS 1
  298. #define Z_AXIS 2
  299.  
  300. struct Triangle_Shape
  301.    {
  302.    METHODS *Methods;
  303.    enum Object_Type Type;
  304.    SHAPE *Next_Object;
  305.    OBJECT *Parent_Object;
  306.    VECTOR  Normal_Vector;
  307.    DBL     Distance;
  308.    DBL     VPNormDotOrigin;
  309.    unsigned int  VPCached:1;
  310.    unsigned int  Dominant_Axis:2;
  311.    unsigned int  Inverted:1;
  312.    unsigned int  vAxis:2;         /* used only for smooth triangles */
  313.    VECTOR  P1, P2, P3;
  314.    };
  315.  
  316.  
  317. struct Smooth_Triangle_Shape
  318.    {
  319.    METHODS *Methods;
  320.    enum Object_Type Type;
  321.    SHAPE *Next_Object;
  322.    OBJECT *Parent_Object;
  323.    VECTOR  Normal_Vector;
  324.    DBL     Distance;
  325.    DBL     VPNormDotOrigin;
  326.    unsigned int  VPCached:1;
  327.    unsigned int  Dominant_Axis:2;
  328.    unsigned int  Inverted:1;
  329.    unsigned int  vAxis:2;         /* used only for smooth triangles */
  330.    VECTOR  P1, P2, P3;
  331.    VECTOR  N1, DN12, DN13, Perp;
  332.    DBL  BaseDelta;
  333.    };
  334.  
  335.  
  336.  
  337. struct Plane_Shape
  338.    {
  339.    METHODS *Methods;
  340.    enum Object_Type Type;
  341.    SHAPE *Next_Object;
  342.    OBJECT *Parent_Object;
  343.    VECTOR  Normal_Vector;
  344.    DBL     Distance;
  345.    DBL     VPNormDotOrigin;
  346.    int     VPCached;
  347.    };
  348.  
  349.  
  350. struct CSG_Type
  351.    {
  352.    METHODS *Methods;
  353.    enum Object_Type Type;
  354.    SHAPE *Next_Object;
  355.    OBJECT *Parent_Object;
  356.    SHAPE *Shapes;
  357.    };
  358.    
  359.  
  360. struct Composite_Object_Struct
  361.    {
  362.    METHODS *Methods;
  363.    enum Object_Type Type;
  364.    OBJECT *Next_Object;
  365.    OBJECT *Next_Light_Source;
  366.    SHAPE *Bounding_Shapes;
  367.    OBJECT *Objects;
  368.    };
  369.  
  370.  
  371. #define MAX_CONTAINING_OBJECTS 5
  372.  
  373. struct Ray_Struct
  374.    {
  375.    VECTOR Initial;               /*  Xo  Yo  Zo  */
  376.    VECTOR Direction;             /*  Xv  Yv  Zv  */
  377.    VECTOR Initial_2;             /*  Xo^2  Yo^2  Zo^2  */
  378.    VECTOR Direction_2;           /*  Xv^2  Yv^2  Zv^2  */
  379.    VECTOR Initial_Direction;     /*  XoXv  YoYv  ZoZv  */
  380.    VECTOR Mixed_Initial_Initial; /*  XoYo  XoZo  YoZo  */
  381.    VECTOR Mixed_Dir_Dir;         /*  XvYv  XvZv  YvZv  */
  382.    VECTOR Mixed_Init_Dir;        /*  XoYv+XvYo  XoZv+XvZo  YoZv+YvZo  */
  383.    int Containing_Index;
  384.    OBJECT *Containing_Objects [MAX_CONTAINING_OBJECTS];
  385.    DBL Containing_IORs [MAX_CONTAINING_OBJECTS];
  386.    int Quadric_Constants_Cached;
  387.    };
  388.  
  389.  
  390. struct Frame_Struct
  391.    {
  392.    VIEWPOINT View_Point;
  393.    int Screen_Height, Screen_Width;
  394.    OBJECT *Light_Sources;
  395.    OBJECT *Objects;
  396.    DBL Atmosphere_IOR, Antialias_Threshold;
  397.    DBL Fog_Distance;
  398.    COLOUR Fog_Colour;
  399.    };
  400.  
  401.  
  402. #define DISPLAY 1
  403. #define VERBOSE 2
  404. #define DISKWRITE 4
  405. #define PROMPTEXIT 8
  406. #define ANTIALIAS 16
  407. #define DEBUGGING 32
  408. #define RGBSEPARATE 64
  409. #define TARGA 128
  410. #define EXITENABLE 256
  411.  
  412. #define Make_Colour(c,r,g,b) { (c)->Red=(r);(c)->Green=(g);(c)->Blue=(b); (c)->Alpha=0.0; }
  413.  
  414. #define Make_Vector(v,a,b,c) { (v)->x=(a);(v)->y=(b);(v)->z=(c); }
  415.  
  416. /* Definitions for PRIOQ structure */
  417.  
  418. struct q_entry
  419.    {
  420.    DBL Depth;
  421.    OBJECT *Object;
  422.    VECTOR Point;
  423.    SHAPE *Shape;
  424.    };
  425.  
  426. struct prioq_struct
  427.    {
  428.    struct prioq_struct *next_pq;
  429.    struct q_entry *queue;
  430.    unsigned int current_entry, queue_size;
  431.    };
  432.  
  433.  
  434. /* Token Definitions for Parser */
  435.  
  436. enum Token_Type
  437.    {
  438.    AGATE_TOKEN,
  439.    ALPHA_TOKEN,
  440.    AMBIENT_TOKEN,
  441.    AMPERSAND_TOKEN,
  442.    AT_TOKEN,
  443.    BACK_QUOTE_TOKEN,
  444.    BACK_SLASH_TOKEN,
  445.    BAR_TOKEN,
  446.    BLUE_TOKEN,
  447.    BRILLIANCE_TOKEN,
  448.    BOZO_TOKEN,
  449.    BOUNDED_TOKEN,
  450.    BUMPS_TOKEN,
  451.    CHECKER_TOKEN,
  452.    COLON_TOKEN,
  453.    COLOR_TOKEN,
  454.    COLOUR_TOKEN,
  455.    COLOR_MAP_TOKEN,
  456.    COLOUR_MAP_TOKEN,
  457.    COMMA_TOKEN,
  458.    COMPOSITE_TOKEN,
  459.    DASH_TOKEN,
  460.    DECLARE_TOKEN,
  461.    DENTS_TOKEN,
  462.    DIFFERENCE_TOKEN,
  463.    DIFFUSE_TOKEN,
  464.    DIRECTION_TOKEN,
  465.    DOLLAR_TOKEN,
  466.    END_BOUNDED_TOKEN,
  467.    END_COLOR_MAP_TOKEN,
  468.    END_COLOUR_MAP_TOKEN,
  469.    END_COMPOSITE_TOKEN,
  470.    END_DIFFERENCE_TOKEN,
  471.    END_FOG_TOKEN,
  472.    END_INTERSECTION_TOKEN,
  473.    END_OBJECT_TOKEN,
  474.    END_OF_FILE_TOKEN,
  475.    END_PLANE_TOKEN,
  476.    END_POINTS_TOKEN,
  477.    END_POLYGON_TOKEN,
  478.    END_QUADRIC_TOKEN,
  479.    END_SHAPE_TOKEN,
  480.    END_SPHERE_TOKEN,
  481.    END_TEXTURE_TOKEN,
  482.    END_TRIANGLE_TOKEN,
  483.    END_UNION_TOKEN,
  484.    END_VIEW_POINT_TOKEN,
  485.    EQUALS_TOKEN,
  486.    EXCLAMATION_TOKEN,
  487.    FLOAT_TOKEN,
  488.    FOG_TOKEN,
  489.    FREQUENCY_TOKEN,
  490.    GIF_TOKEN,
  491.    GRADIENT_TOKEN,
  492.    GRANITE_TOKEN,
  493.    GREEN_TOKEN,
  494.    HASH_TOKEN,
  495.    HAT_TOKEN,
  496.    IDENTIFIER_TOKEN,
  497.    IFF_TOKEN,
  498.    IMAGEMAP_TOKEN,
  499.    INCLUDE_TOKEN,
  500.    INTERSECTION_TOKEN,
  501.    INVERSE_TOKEN,
  502.    IOR_TOKEN,
  503.    LEFT_ANGLE_TOKEN,
  504.    LEFT_BRACKET_TOKEN,
  505.    LEFT_SQUARE_TOKEN,
  506.    LIGHT_SOURCE_TOKEN,
  507.    LOCATION_TOKEN,
  508.    LOOK_AT_TOKEN,
  509.    MARBLE_TOKEN,
  510.    OBJECT_TOKEN,
  511.    ONCE_TOKEN,
  512.    PERCENT_TOKEN,
  513.    PHASE_TOKEN,
  514.    PHONG_TOKEN,
  515.    PHONGSIZE_TOKEN,
  516.    PLANE_TOKEN,
  517.    PLUS_TOKEN,
  518.    POINTS_TOKEN,
  519.    POLYGON_TOKEN,
  520.    QUADRIC_TOKEN,
  521.    QUESTION_TOKEN,
  522.    RAW_TOKEN,
  523.    RED_TOKEN,
  524.    REFLECTION_TOKEN,
  525.    REFRACTION_TOKEN,
  526.    REVOLVE_TOKEN,
  527.    RIGHT_TOKEN,
  528.    RIGHT_ANGLE_TOKEN,
  529.    RIGHT_BRACKET_TOKEN,
  530.    RIGHT_SQUARE_TOKEN,
  531.    RIPPLES_TOKEN,
  532.    ROTATE_TOKEN,
  533.    ROUGHNESS_TOKEN,
  534.    SCALE_TOKEN,
  535.    SEMI_COLON_TOKEN,
  536.    SHAPE_TOKEN,
  537.    SINGLE_QUOTE_TOKEN,
  538.    SIZE_TOKEN,
  539.    SKY_TOKEN,
  540.    SLASH_TOKEN,
  541.    SMOOTH_TRIANGLE_TOKEN,
  542.    SPECULAR_TOKEN,
  543.    SPHERE_TOKEN,
  544.    SPOTTED_TOKEN,
  545.    STAR_TOKEN,
  546.    STRING_TOKEN,
  547.    TEXTURE_TOKEN,
  548.    TILDE_TOKEN,
  549.    TRANSLATE_TOKEN,
  550.    TRIANGLE_TOKEN,
  551.    TURBULENCE_TOKEN,
  552.    UNION_TOKEN,
  553.    UP_TOKEN,
  554.    VIEW_POINT_TOKEN,
  555.    WAVES_TOKEN,
  556.    WOOD_TOKEN,
  557.    WRINKLES_TOKEN,
  558.    LAST_TOKEN };
  559.  
  560.  
  561. struct Reserved_Word_Struct
  562.    {
  563.    TOKEN Token_Number;
  564.    char *Token_Name;
  565.    };
  566.  
  567. /* Here's where you dump the information on the current token (fm. PARSE.C) */
  568.  
  569. struct Token_Struct
  570.    {
  571.    TOKEN Token_Id;
  572.    int Token_Line_No;
  573.    char Token_String[FILE_NAME_LENGTH];
  574.    DBL Token_Float;
  575.    int Identifier_Number;
  576.    int Unget_Token, End_Of_File;
  577.    };
  578.  
  579. /* Types of constants allowed in DECLARE statement (fm. PARSE.C) */
  580.  
  581. enum Constant_Type
  582.    {
  583.    OBJECT_CONSTANT,
  584.    VIEW_POINT_CONSTANT,
  585.    VECTOR_CONSTANT,
  586.    FLOAT_CONSTANT,
  587.    COLOUR_CONSTANT,
  588.    QUADRIC_CONSTANT,
  589.    SPHERE_CONSTANT,
  590.    PLANE_CONSTANT,
  591.    TRIANGLE_CONSTANT,
  592.    SMOOTH_TRIANGLE_CONSTANT,
  593.    CSG_INTERSECTION_CONSTANT,
  594.    CSG_UNION_CONSTANT,
  595.    CSG_DIFFERENCE_CONSTANT,
  596.    COMPOSITE_CONSTANT,
  597.    TEXTURE_CONSTANT
  598.    };
  599.  
  600.  
  601. struct Constant_Struct
  602.    {
  603.    int Identifier_Number;
  604.    CONSTANT Constant_Type;
  605.    char *Constant_Data;
  606.    };
  607.  
  608. /* Types for reading IFF files. */
  609. typedef struct {
  610.    unsigned short Red, Green, Blue;
  611.    } IMAGE_COLOUR;
  612.  
  613. struct Chunk_Header_Struct {
  614.    long name;
  615.    long size;
  616.    };
  617.