rgbe.cpp File Reference

Utilities for reading and writing Ward's rgbe image format. More...

#include "rgbe.h"
#include <math.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

Go to the source code of this file.

Defines

#define INLINE
#define RGBE_DATA_RED   0
#define RGBE_DATA_GREEN   1
#define RGBE_DATA_BLUE   2
#define RGBE_DATA_SIZE   3
#define MINRUNLENGTH   4

Enumerations

enum  rgbe_error_codes { rgbe_read_error, rgbe_write_error, rgbe_format_error, rgbe_memory_error }

Functions

int RGBE_WriteHeader (FILE *fp, int width, int height, rgbe_header_info *info)
 writes headers
int RGBE_ReadHeader (FILE *fp, int *width, int *height, rgbe_header_info *info)
 reads headers
int RGBE_WritePixels (FILE *fp, const float *data, int numpixels)
 writes pixels
int RGBE_ReadPixels (FILE *fp, float *data, int numpixels)
 reads pixels
int RGBE_WritePixels_RLE (FILE *fp, float *data, int scanline_width, int num_scanlines)
 writes run length encoded files
int RGBE_ReadPixels_RLE (FILE *fp, float *data, int scanline_width, int num_scanlines)
 reads run length encoded files


Detailed Description

Utilities for reading and writing Ward's rgbe image format.

Author:
Bruce Walter (http://www.graphics.cornell.edu/~bjw/)

Travis Fischer (fisch0920@gmail.com)

Date:
January 2009
Note:
This code is from http://www.graphics.cornell.edu/~bjw/rgbe/
also http://www.graphics.cornell.edu/online/formats/rgbe/

Definition in file rgbe.cpp.


Define Documentation

#define INLINE

Definition at line 45 of file rgbe.cpp.

#define MINRUNLENGTH   4

#define RGBE_DATA_BLUE   2

Definition at line 51 of file rgbe.cpp.

#define RGBE_DATA_GREEN   1

Definition at line 50 of file rgbe.cpp.

#define RGBE_DATA_RED   0

Definition at line 49 of file rgbe.cpp.

#define RGBE_DATA_SIZE   3

Definition at line 53 of file rgbe.cpp.


Enumeration Type Documentation

Enumerator:
rgbe_read_error 
rgbe_write_error 
rgbe_format_error 
rgbe_memory_error 

Definition at line 55 of file rgbe.cpp.


Function Documentation

int RGBE_ReadHeader ( FILE *  fp,
int *  width,
int *  height,
rgbe_header_info info 
)

reads headers

Note:
you may set rgbe_header_info to null if you want to

Definition at line 149 of file rgbe.cpp.

int RGBE_ReadPixels ( FILE *  fp,
float *  data,
int  numpixels 
)

reads pixels

Note:
can read pixels in chunks of any size including single pixels

Definition at line 232 of file rgbe.cpp.

int RGBE_ReadPixels_RLE ( FILE *  fp,
float *  data,
int  scanline_width,
int  num_scanlines 
)

reads run length encoded files

Note:
must be called to read whole scanlines

Definition at line 349 of file rgbe.cpp.

int RGBE_WriteHeader ( FILE *  fp,
int  width,
int  height,
rgbe_header_info info 
)

writes headers

Note:
you may set rgbe_header_info to null if you want to

Definition at line 124 of file rgbe.cpp.

int RGBE_WritePixels ( FILE *  fp,
const float *  data,
int  numpixels 
)

writes pixels

Note:
can write pixels in chunks of any size including single pixels

Definition at line 217 of file rgbe.cpp.

int RGBE_WritePixels_RLE ( FILE *  fp,
float *  data,
int  scanline_width,
int  num_scanlines 
)

writes run length encoded files

Note:
must be called to write whole scanlines

Definition at line 303 of file rgbe.cpp.


Generated on 28 Feb 2009 for Milton by doxygen 1.5.6