Panda3D
Functions
convert_srgb.I File Reference

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University. More...

Go to the source code of this file.

Functions

float decode_sRGB_float (unsigned char val)
 Decodes the sRGB-encoded unsigned char value to a linearized float in the range 0-1. More...
 
float decode_sRGB_float (float val)
 Decodes the sRGB-encoded floating-point value in the range 0-1 to a linearized float in the range 0-1. More...
 
unsigned char decode_sRGB_uchar (unsigned char val)
 Decodes the sRGB-encoded unsigned char value to a linearized unsigned char value. More...
 
unsigned char decode_sRGB_uchar (float val)
 Decodes the sRGB-encoded floating-point value in the range 0-1 to a linearized unsigned char value. More...
 
float encode_sRGB_float (unsigned char val)
 Encodes the linearized unsigned char value to an sRGB-encoded floating- point value in ther range 0-1. More...
 
float encode_sRGB_float (float val)
 Encodes the linearized floating-point value in the range 0-1 to an sRGB- encoded float in the range 0-1. More...
 
unsigned char encode_sRGB_uchar (unsigned char val)
 Encodes the linearized unsigned char value to an sRGB-encoded unsigned char value. More...
 
unsigned char encode_sRGB_uchar (float val)
 Encodes the linearized floating-point value in the range 0-1 to an sRGB- encoded unsigned char value. More...
 
void encode_sRGB_uchar (const LColorf &color, xel &into)
 Encodes the linearized floating-point color value an sRGB-encoded xel in the range 0-255. More...
 
void encode_sRGB_uchar (const LColorf &color, xel &into, xelval &into_alpha)
 Encodes the linearized floating-point color value an sRGB-encoded xel and alpha in the range 0-255. More...
 
void encode_sRGB_uchar (const LColord &color, xel &into)
 Double-precision versions of the above. More...
 
void encode_sRGB_uchar (const LColord &color, xel &into, xelval &into_alpha)
 

Detailed Description

PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.

All rights reserved.

All use of this software is subject to the terms of the revised BSD license. You should have received a copy of this license along with this source code in a file named "LICENSE."

Author
rdb
Date
2014-10-29

Definition in file convert_srgb.I.

Function Documentation

◆ decode_sRGB_float() [1/2]

float decode_sRGB_float ( unsigned char  val)
inline

Decodes the sRGB-encoded unsigned char value to a linearized float in the range 0-1.

Definition at line 18 of file convert_srgb.I.

Referenced by PNMImage::from_val().

◆ decode_sRGB_float() [2/2]

float decode_sRGB_float ( float  val)
inline

Decodes the sRGB-encoded floating-point value in the range 0-1 to a linearized float in the range 0-1.

Inputs outside this range produce invalid results.

Definition at line 27 of file convert_srgb.I.

◆ decode_sRGB_uchar() [1/2]

unsigned char decode_sRGB_uchar ( unsigned char  val)
inline

Decodes the sRGB-encoded unsigned char value to a linearized unsigned char value.

Definition at line 37 of file convert_srgb.I.

◆ decode_sRGB_uchar() [2/2]

unsigned char decode_sRGB_uchar ( float  val)
inline

Decodes the sRGB-encoded floating-point value in the range 0-1 to a linearized unsigned char value.

Inputs outside this range are clamped.

Definition at line 45 of file convert_srgb.I.

◆ encode_sRGB_float() [1/2]

float encode_sRGB_float ( unsigned char  val)
inline

Encodes the linearized unsigned char value to an sRGB-encoded floating- point value in ther range 0-1.

Definition at line 56 of file convert_srgb.I.

Referenced by PNMImage::to_val().

◆ encode_sRGB_float() [2/2]

float encode_sRGB_float ( float  val)
inline

Encodes the linearized floating-point value in the range 0-1 to an sRGB- encoded float in the range 0-1.

Inputs outside this range produce invalid results.

Definition at line 69 of file convert_srgb.I.

◆ encode_sRGB_uchar() [1/5]

unsigned char encode_sRGB_uchar ( unsigned char  val)
inline

Encodes the linearized unsigned char value to an sRGB-encoded unsigned char value.

Definition at line 80 of file convert_srgb.I.

Referenced by encode_sRGB_uchar(), and PNMImage::to_val().

◆ encode_sRGB_uchar() [2/5]

unsigned char encode_sRGB_uchar ( float  val)
inline

Encodes the linearized floating-point value in the range 0-1 to an sRGB- encoded unsigned char value.

Inputs outside this range are clamped.

When SSE2 support is known at compile time, this automatically uses an optimized version. Otherwise, it does not attempt runtime CPU detection. If you know that SSE2 is supported (ie. if the function has_sse2_sRGB_encode() returns true) you should call encode_sRGB_uchar_sse2 instead.

Definition at line 95 of file convert_srgb.I.

◆ encode_sRGB_uchar() [3/5]

void encode_sRGB_uchar ( const LColorf &  color,
xel into 
)
inline

Encodes the linearized floating-point color value an sRGB-encoded xel in the range 0-255.

When SSE2 support is known at compile time, this automatically uses an optimized version. Otherwise, it does not attempt runtime CPU detection. If you know that SSE2 is supported (ie. if the function has_sse2_sRGB_encode() returns true) you should call encode_sRGB_uchar_sse2 instead.

Definition at line 118 of file convert_srgb.I.

◆ encode_sRGB_uchar() [4/5]

void encode_sRGB_uchar ( const LColorf &  color,
xel into,
xelval &  into_alpha 
)
inline

Encodes the linearized floating-point color value an sRGB-encoded xel and alpha in the range 0-255.

The alpha value is not sRGB-encoded.

When SSE2 support is known at compile time, this automatically uses an optimized version. Otherwise, it does not attempt runtime CPU detection. If you know that SSE2 is supported (ie. if the function has_sse2_sRGB_encode() returns true) you should call encode_sRGB_uchar_sse2 instead.

Definition at line 142 of file convert_srgb.I.

◆ encode_sRGB_uchar() [5/5]

void encode_sRGB_uchar ( const LColord &  color,
xel into 
)
inline

Double-precision versions of the above.

Definition at line 162 of file convert_srgb.I.

References encode_sRGB_uchar().