#include <stdio.h>
#include "rle.h"
#include <math.h>
Go to the source code of this file.
void float_to_exp |
( |
int |
count, |
|
|
float * |
floats, |
|
|
rle_pixel * |
pixels |
|
) |
| |
Definition at line 42 of file float_to_exp.c.
48 int expon, max_exp = -2000;
49 float * fptr = floats;
59 for (i = 0; i < count; i++)
61 frexp( *fptr++, &expon );
62 max_exp = (expon > max_exp) ? expon : max_exp;
66 if (max_exp > 128) max_exp = 128;
68 if (max_exp < -127) max_exp = -127;
70 f_exp = ldexp( 256.0, -max_exp );
73 for( i = 0; i < count; i++ )