Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Diff of /rgbe.h [3af83f] .. [15dc8a] Maximize Restore

  Switch to unified view

a/rgbe.h b/rgbe.h
1
#ifndef _H_RGBE
2
#define _H_RGBE
3
/* THIS CODE CARRIES NO GUARANTEE OF USABILITY OR FITNESS FOR ANY PURPOSE.
1
/* THIS CODE CARRIES NO GUARANTEE OF USABILITY OR FITNESS FOR ANY PURPOSE.
4
 * WHILE THE AUTHORS HAVE TRIED TO ENSURE THE PROGRAM WORKS CORRECTLY,
2
 * WHILE THE AUTHORS HAVE TRIED TO ENSURE THE PROGRAM WORKS CORRECTLY,
5
 * IT IS STRICTLY USE AT YOUR OWN RISK.  */
3
 * IT IS STRICTLY USE AT YOUR OWN RISK.  */
6
4
7
/* Copyright (c) 1995 Bruce Walter <bjw@graphics.cornell.edu>
5
/* Copyright (c) 1995 Bruce Walter <bjw@graphics.cornell.edu>
...
...
10
8
11
/* utility for reading and writing Ward's rgbe image format.
9
/* utility for reading and writing Ward's rgbe image format.
12
   See rgbe.txt file for more details.
10
   See rgbe.txt file for more details.
13
*/
11
*/
14
12
13
#ifndef _H_RGBE
14
#define _H_RGBE
15
15
#include <stdio.h>
16
#include <stdio.h>
17
#include "panotypes.h"
18
16
19
17
typedef struct {
20
typedef struct {
18
  int valid;            /* indicate which fields are valid */
21
  int valid;            /* indicate which fields are valid */
19
  char programtype[16]; /* listed at beginning of file to identify it 
22
  char programtype[16]; /* listed at beginning of file to identify it 
20
                         * after "#?".  defaults to "RGBE" */ 
23
                         * after "#?".  defaults to "RGBE" */ 
...
...
37
#ifdef __cplusplus
40
#ifdef __cplusplus
38
extern "C" {
41
extern "C" {
39
#endif
42
#endif
40
/* read or write headers */
43
/* read or write headers */
41
/* you may set rgbe_header_info to null if you want to */
44
/* you may set rgbe_header_info to null if you want to */
45
42
int RGBE_WriteHeader(FILE *fp, int width, int height, rgbe_header_info *info);
46
int RGBE_WriteHeader(FILE *fp, uint32_t width, uint32_t height, rgbe_header_info *info);
43
int RGBE_ReadHeader(FILE *fp, int *width, int *height, rgbe_header_info *info);
47
int RGBE_ReadHeader(FILE *fp, uint32_t* width, uint32_t* height, rgbe_header_info *info);
44
48
45
/* read or write pixels */
49
/* read or write pixels */
46
/* can read or write pixels in chunks of any size including single pixels*/
50
/* can read or write pixels in chunks of any size including single pixels*/
47
int RGBE_WritePixels(FILE *fp, float *data, int numpixels);
51
int RGBE_WritePixels(FILE *fp, float *data, int numpixels);
48
int RGBE_ReadPixels(FILE *fp, float *data, int numpixels);
52
int RGBE_ReadPixels(FILE *fp, float *data, int numpixels);
...
...
55
            int num_scanlines);
59
            int num_scanlines);
56
60
57
int RGBE_ReadPixels_Raw_RLE(FILE *fp, unsigned char *data, int scanline_width,
61
int RGBE_ReadPixels_Raw_RLE(FILE *fp, unsigned char *data, int scanline_width,
58
            size_t num_scanlines);
62
            size_t num_scanlines);
59
63
60
#ifdef _CPLUSPLUS
61
/* define if your compiler understands inline commands */
62
#define INLINE inline
63
#else
64
#define INLINE
65
#endif
66
64
67
INLINE void float2rgbe(unsigned char rgbe[4], float red, float green, float blue);
65
INLINE void float2rgbe(unsigned char rgbe[4], float red, float green, float blue);
68
INLINE void rgbe2float(float *red, float *green, float *blue, unsigned char rgbe[4]);
66
INLINE void rgbe2float(float *red, float *green, float *blue, unsigned char rgbe[4]);
69
67
70
#ifdef __cplusplus
68
#ifdef __cplusplus