HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_GammaTable.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG_GammaTable.h ( IMG Library, C++)
7  *
8  * COMMENTS: Gamma table computer
9  */
10 
11 #ifndef __IMG_GammaTable__
12 #define __IMG_GammaTable__
13 
14 #include <SYS/SYS_Types.h>
15 #include "IMG_API.h"
16 
18 {
19 public:
21 
22  // Convert 8 bit value to 0-255 range with color space conversion
23  float sRGBtoLinear(uint8 v) const { return myRGBtoLinear256[v]; }
24  float linearTosRGB(uint8 v) const { return myLinearToRGB256[v]; }
25 
26  // Convert 8 bit value to 0-1 range with color space conversion
27  float sRGBtoLinear01(uint8 v) const { return myRGBtoLinear1[v]; }
28  float linearToRGB01(uint8 v) const { return myRGBtoLinear1[v]; }
29  // Convert 8-bit to float value
30  float linear01(uint8 v) const { return myLinear01[v]; }
31 
32  // Approximate gamma conversion from standard 8bit files.
33  // 256 entries, mapping to 0..255 range.
34  const float *get8bitsRGBtoLinear() const { return myRGBtoLinear256; }
35  const float *get8bitLinearTosRGB() const { return myLinearToRGB256; }
36 
37 private:
38  float myRGBtoLinear256[256]; // 0-255
39  float myLinearToRGB256[256]; // 0-255
40  float myRGBtoLinear1[256]; // 0-1
41  float myLinearToRGB1[256]; // 0-1
42  float myLinear01[256]; // 0-1
43 };
44 
46 
47 #endif
const GLdouble * v
Definition: glcorearb.h:836
float linearToRGB01(uint8 v) const
#define IMG_API
Definition: IMG_API.h:10
float sRGBtoLinear(uint8 v) const
unsigned char uint8
Definition: SYS_Types.h:32
IMG_API IMG_GammaTable IMGgammaTable
float sRGBtoLinear01(uint8 v) const
float linear01(uint8 v) const
const float * get8bitLinearTosRGB() const
float linearTosRGB(uint8 v) const
const float * get8bitsRGBtoLinear() const