Started sketching the photon mapping.
This commit is contained in:
24
rgbe.cpp
24
rgbe.cpp
@@ -1,7 +1,29 @@
|
||||
#include <cmath>
|
||||
/* THIS CODE CARRIES NO GUARANTEE OF USABILITY OR FITNESS FOR ANY PURPOSE.
|
||||
* WHILE THE AUTHORS HAVE TRIED TO ENSURE THE PROGRAM WORKS CORRECTLY,
|
||||
* IT IS STRICTLY USE AT YOUR OWN RISK. */
|
||||
|
||||
/* This file contains code to read and write four byte rgbe file format
|
||||
developed by Greg Ward. It handles the conversions between rgbe and
|
||||
pixels consisting of floats. The data is assumed to be an array of floats.
|
||||
By default there are three floats per pixel in the order red, green, blue.
|
||||
(RGBE_DATA_??? values control this.) Only the mimimal header reading and
|
||||
writing is implemented. Each routine does error checking and will return
|
||||
a status value as defined below. This code is intended as a skeleton so
|
||||
feel free to modify it to suit your needs.
|
||||
|
||||
(Place notice here if you modified the code.)
|
||||
posted to http://www.graphics.cornell.edu/~bjw/
|
||||
written by Bruce Walter (bjw@graphics.cornell.edu) 5/26/95
|
||||
based on code written by Greg Ward
|
||||
*/
|
||||
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
#include "rgbe.hpp"
|
||||
|
||||
using glm::frexp;
|
||||
using glm::ldexp;
|
||||
|
||||
/* standard conversion from float pixels to rgbe pixels */
|
||||
/* note: you can remove the "inline"s if your compiler complains about it */
|
||||
void float2rgbe(unsigned char rgbe[4], float red, float green, float blue) {
|
||||
|
Reference in New Issue
Block a user