Changeset 13041 for OpenSceneGraph/trunk/src/osgPlugins/hdr/hdrwriter.cpp
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgPlugins/hdr/hdrwriter.cpp
r12912 r13041 1 /* 1 /* 2 2 The following code was based on code from the following location: 3 3 http://www.graphics.cornell.edu/online/formats/rgbe/ … … 9 9 pixels consisting of floats. The data is assumed to be an array of floats. 10 10 By default there are three floats per pixel in the order red, green, blue. 11 (RGBE_DATA_??? values control this.) Only the mimimal header reading and 11 (RGBE_DATA_??? values control this.) Only the mimimal header reading and 12 12 writing is implemented. Each routine does error checking and will return 13 13 a status value as defined below. This code is intended as a skeleton so … … 23 23 For the moment, we don't output most of the header fields 24 24 25 25 26 26 */ 27 27 … … 143 143 old_run_count = run_count; 144 144 run_count = 1; 145 while((data[beg_run] == data[beg_run + run_count]) 145 while((data[beg_run] == data[beg_run + run_count]) 146 146 && (beg_run + run_count < numbytes) 147 147 && (run_count < 127)) … … 198 198 199 199 buffer = (unsigned char *)malloc(sizeof(unsigned char)*4*scanline_width); 200 if (buffer == NULL) 200 if (buffer == NULL) 201 201 // no buffer space so write flat 202 202 return writeNoRLE(fout,img); … … 205 205 { 206 206 float* data = (float*) img->data(0, row); 207 207 208 208 rgbe[0] = 2; 209 209 rgbe[1] = 2;
