home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <math.h>
- #include "MyMath.h"
- #include "rtd.h"
- #include "extern.h"
- #include "macros.h"
-
- FFP big, little;
-
-
- g_bod (f)/* credit for this goes to rich stewart, who wanted to
- do susie in the first place */
- FILE * f;
- {
- int x, y;
- char k;
- char buf[512];
-
-
- big = SPFlt(0);
- little = ieee_to_ffp(HUGE);
-
- for (ysue = 0; ysue<300; ysue++) {
- if (fgets (buf, 512, f) == NULL)
- break;
-
- /*get rid of EOL that leaves nasty black dots*/
- xsue = strlen (buf) - 1;
-
- for (x = 0; x < xsue; x++) {
-
- k = buf[x];
-
- suzie[x][ysue] = k;
-
- if (SPFix(big) < k)
- big = SPFlt(k);
-
- if (SPFix(little) > k)
- little = SPFlt(k);
- }
- }
-
- /* expand dynamic range to maximum:0.0-1.0*/
- /*
- big = big - little;
-
- for (y = 0; y < ysue; y++) {
- for (x = 0; x < xsue; x++) {
- temp = ( (float)(suzie[x][y]) - little) / big ;
- suzie[x][y] = (char) ( temp * 255.0 );
- }
- printf("%f ==> %ud, %f\n", temp, (k=suzie[x][y]), (k/255.0) );
- }
- */
- }
-