ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/radiance/ray/src/common/bmpfile.h
(Generate patch)

Comparing ray/src/common/bmpfile.h (file contents):
Revision 2.3 by greg, Sat Mar 27 05:43:37 2004 UTC vs.
Revision 2.5 by greg, Thu Apr 12 22:13:28 2007 UTC

# Line 41 | Line 41 | typedef struct {
41          /* but the color table should be filled by writer before open call */
42          RGBquad         palette[3];     /* color palette (extends struct) */
43   } BMPHeader;
44
45                                        /* color palette length */
46 #define BMPpalLen(h)    ((h)->bpp <= 8 ? 1<<(h)->bpp : 0)
44                                  
45                                          /* access to bit field triple */
46   #define BMPbitField(h)  ((uint32 *)(h)->palette)
47  
48                                          /* info buffer access */
49 < #define BMPinfo(h)      ((char *)((h)->palette + BMPpalLen(h)))
49 > #define BMPinfo(h)      ((char *)((h)->palette + (h)->nColors))
50  
51                                          /* function return values */
52   #define BIR_OK                  0               /* all is well */
# Line 141 | Line 138 | int            stdio_fseek(uint32 pos, void *p);
138  
139                                          /* open input file */
140   #define BMPopenInputFile(fn)    BMPopenReader(&stdio_getc, &stdio_fseek, \
141 <                                        (void *)fopen(fn, "r"))
141 >                                        (void *)fopen(fn, "rb"))
142  
143                                          /* close stdio input file or stream */
144   #define BMPcloseInput(br)       ( fclose((FILE *)(br)->c_data), \
# Line 154 | Line 151 | int            stdio_fseek(uint32 pos, void *p);
151                                          /* open stdio output file */
152   #define BMPopenOutputFile(fn,hdr) \
153                          BMPopenWriter(&stdio_putc, &stdio_fseek, \
154 <                                        (void *)fopen(fn, "w"), hdr)
154 >                                        (void *)fopen(fn, "wb"), hdr)
155  
156                                          /* close stdio output file or stream */
157   #define BMPcloseOutput(bw)      ( fclose((FILE *)(bw)->c_data), \

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines