home *** CD-ROM | disk | FTP | other *** search
/ Stars of Shareware: Raytrace & Morphing / SOS-RAYTRACE.ISO / programm / rad386 / radiosit / src / raddecl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-04-22  |  6.7 KB  |  151 lines

  1.  
  2. #ifndef RADD_H
  3.  
  4. #define RADD_H
  5.  
  6. #include <stdio.h>
  7. #include "color.h"
  8. #include "rle.h"
  9. #include "graphicsgems.h"
  10. #include "vox.h"
  11. #include "data_str.h"
  12. #include "poly.h"
  13.  
  14. /* FOR_RADI.C 21/04/92 14.37.50 */
  15. char *tempbuffer (unsigned len);
  16. int fwritecolrs (register COLR *scanline, int len, register FILE *fp);
  17. int fwritescan (register COLOR *scanline, int len, FILE *fp);
  18. int setcolr (register COLR clr, double r, double g, double b);
  19. int fputformat (char *s, FILE *fp);
  20. /* FOR_RLE.C 21/04/92 14.37.52 */
  21. int rle_row_alloc (rle_hdr *the_hdr, rle_pixel ***scanp);
  22. void rle_row_free (rle_hdr *the_hdr, rle_pixel **scanp);
  23. void rle_putrow (register rle_pixel *rows[], int rowlen, register rle_hdr *
  24.     the_hdr);
  25. void rle_put_init (register rle_hdr *the_hdr);
  26. void rle_put_setup (register rle_hdr *the_hdr);
  27. int DefaultBlockHook (rle_hdr *the_hdr);
  28. void rle_puteof (register rle_hdr *the_hdr);
  29. int RunSetup (register rle_hdr *the_hdr);
  30. int RunSkipBlankLines (int nblank, register rle_hdr *the_hdr);
  31. int RunSetColor (int c, register rle_hdr *the_hdr);
  32. int RunSkipPixels (int nskip, int last, int wasrun, register rle_hdr *the_hdr);
  33. int RunNewScanLine (int flag, register rle_hdr *the_hdr);
  34. int Runputdata (rle_pixel *buf, int n, register rle_hdr *the_hdr);
  35. int Runputrun (int color, int n, int last, register rle_hdr *the_hdr);
  36. int RunputEof (register rle_hdr *the_hdr);
  37. char *vax_pshort (register char *msgp, register unsigned short s);
  38. /* GAUSS.C 21/04/92 14.37.46 */
  39. int gauss_iter (int n, double **a, double *x, double b[], double tolerance);
  40. int diagonally_dominant (int n, double **a);
  41. /* GGVECLIB.C 21/04/92 14.37.46 */
  42. double V2SquaredLength (Vector2 *a);
  43. double V2Length (Vector2 *a);
  44. Vector2 *V2Negate (Vector2 *v);
  45. Vector2 *V2Normalize (Vector2 *v);
  46. Vector2 *V2Scale (Vector2 *v, double newlen);
  47. Vector2 *V2Add (Vector2 *a, Vector2 *b, Vector2 *c);
  48. Vector2 *V2Sub (Vector2 *a, Vector2 *b, Vector2 *c);
  49. double V2Dot (Vector2 *a, Vector2 *b);
  50. Vector2 *V2Lerp (Vector2 *lo, Vector2 *hi, double alpha, Vector2 *result);
  51. Vector2 *V2Combine (Vector2 *a, Vector2 *b, Vector2 *result, double ascl,
  52.      double bscl);
  53. Vector2 *V2Mul (Vector2 *a, Vector2 *b, Vector2 *result);
  54. double V2DistanceBetween2Points (Point2 *a, Point2 *b);
  55. Vector2 *V2MakePerpendicular (Vector2 *a, Vector2 *ap);
  56. Vector2 *V2New (double x, double y);
  57. Vector2 *V2Duplicate (Vector2 *a);
  58. Point2 *V2MulPointByMatrix (Point2 *p, Matrix3 *m);
  59. Matrix3 *V2MatMul (Matrix3 *a, Matrix3 *b, Matrix3 *c);
  60. double V3SquaredLength (Vector3 *a);
  61. double V3Length (Vector3 *a);
  62. Vector3 *V3Negate (Vector3 *v);
  63. Vector3 *V3Normalize (Vector3 *v);
  64. Vector3 *V3Scale (Vector3 *v, double newlen);
  65. Vector3 *V3Add (Vector3 *a, Vector3 *b, Vector3 *c);
  66. Vector3 *V3Sub (Vector3 *a, Vector3 *b, Vector3 *c);
  67. double V3Dot (Vector3 *a, Vector3 *b);
  68. Vector3 *V3Lerp (Vector3 *lo, Vector3 *hi, double alpha, Vector3 *result);
  69. Vector3 *V3Combine (Vector3 *a, Vector3 *b, Vector3 *result, double ascl,
  70.      double bscl);
  71. Vector3 *V3Mul (Vector3 *a, Vector3 *b, Vector3 *result);
  72. double V3DistanceBetween2Points (Point3 *a, Point3 *b);
  73. Vector3 *V3Cross (Vector3 *a, Vector3 *b, Vector3 *c);
  74. Vector3 *V3New (double x, double y, double z);
  75. Vector3 *V3Duplicate (Vector3 *a);
  76. Point3 *V3MulPointByMatrix (Point3 *p, Matrix4 *m);
  77. Matrix4 *V3MatMul (Matrix4 *a, Matrix4 *b, Matrix4 *c);
  78. int gcd (int u, int v);
  79. int quadraticRoots (double a, double b, double c, double *roots);
  80. double RegulaFalsi (double (*f)(), double left, double right);
  81. double NewtonRaphson (double (*f)(), double (*df)(), double x);
  82. double findroot (double left, double right, double tolerance, double (*f)(),
  83.      double (*df)());
  84. /* INPUT.C 21/04/92 14.37.46 */
  85. int input (void);
  86. /* INTERSEC.C 21/04/92 14.37.46 */
  87. int get_nearest_object_in_voxel (Ray *ray, double t_entry, double t_exit, Voxel
  88.      *vox, double *min_t, double *pu, double *pv);
  89. /* MAIN.C 22/04/92 11.19.02 */
  90. int error (char *s);
  91. int show_usage (void);
  92. void init_view (void);
  93. int parse_parameters (int argc, char **argv, char **imagefl, FILE **in_intfile
  94.     , FILE **out_intfile);
  95. Vector3 transform_vector (Vector3 *v, Matrix4 *m);
  96. void align_axis_to_Z (Vector3 *v, Matrix4 *m);
  97. void align_Z_to_axis (Vector3 *v, Matrix4 *m);
  98. void mirror_reflection (Vector3 *N, Vector3 *dir, Obj *o);
  99. int bounds_overlap (Box3 *b1, Box3 *b2);
  100. Point3 get_bilinear (Quadrilateral *q, double u, double v);
  101. /* OBJECTS.C 21/04/92 14.37.48 */
  102. void translate (double dx, double dy, double dz, Matrix4 *m);
  103. void scale (double sx, double sy, double sz, Matrix4 *m);
  104. void bound_transform (Box3 *b, Matrix4 *m);
  105. /* POLY_CLI.C 21/04/92 14.37.50 */
  106. int poly_clip_to_box (register Poly *p1, register Poly_box *box);
  107. void poly_clip_to_halfspace (Poly *p, Poly *q, register int index, double sign
  108.     , double k);
  109. /* POLY_SCA.C 21/04/92 14.37.50 */
  110. void poly_scan (register Poly *p, Window *win, void (*pixelproc)());
  111. /* PREPROCE.C 21/04/92 14.37.48 */
  112. int preprocess (void);
  113. /* RADIOSIT.C 21/04/92 16.16.52 */
  114. long fullmatrix_radiosity (int diff_flag, FILE *fl);
  115. long progressive_radiosity (int maxpasses, int diff_flag, FILE *fl);
  116. /* RAY_BOX.C 21/04/92 14.37.48 */
  117. int HitBoundingBox (Point3 *minB, Point3 *maxB, Point3 *origin, Point3 *dir,
  118.      double *entrypoint, double *exitpoint);
  119. int intersect_parallel_planes (double L, double R, double O, double D, double *
  120.     tnear, double *tfar);
  121. /* RAY_CYLI.C 21/04/92 14.37.48 */
  122. double ray_cylinder (Point3 *ray_start, Vector3 *ray_direction, double R,
  123.      double H, int tubeflag, double *pu, double *pv);
  124. double ray_cone (Point3 *ray_start, Vector3 *ray_direction, double distance,
  125.      int cupflag, double *pu, double *pv);
  126. double ray_ring (Point3 *ray_start, Vector3 *ray_direction, double R0, double
  127.      R1, double *pu, double *pv);
  128. /* RAY_SPHE.C 21/04/92 14.37.48 */
  129. double sphere_intersection (Point3 *ray_start, Vector3 *ray_direction, double
  130.      sphere_radius, Point3 *sphere_center);
  131. double ray_sphere (Point3 *ray_start, Vector3 *ray_direction, double
  132.      sphere_radius, Point3 *sphere_center, int bubble_flag, double *pu,
  133.      double *pv);
  134. /* READ_N_W.C 21/04/92 14.37.48 */
  135. int write_out_intensity (FILE *fl);
  136. int read_in_intensity (FILE *fl);
  137. int dump_main_surface_illumination_values (FILE *fl);
  138. /* RENDER.C 22/04/92 11.02.18 */
  139. long render (char *flname);
  140. /* SCAN_CON.C 21/04/92 14.37.50 */
  141. int view_transform (Point3 *C, Vector3 *U, Vector3 *V, Vector3 *N, int rows,
  142.      int cols, Matrix4 *m);
  143. void null_scan_convert (int patchnum, Vector3 *N, Matrix4 *m, int rows, int
  144.      cols, double *zbuffer, char *surface_buffer, short int *raster);
  145. /* VOX.C 21/04/92 14.37.50 */
  146. Vlist *create_vlist (Point3 *ray_start, Vector3 *ray_direction, double tmin,
  147.      double tmax);
  148. int add_to_list (Vlist **vlist, int voxnum, double t1, double t2);
  149. int purge_vlist (Vlist *vlist);
  150.  
  151. #endif