Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-28 17:29:33 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-12-28 17:29:33 +0400
commitb9ff5840a617ec836f2d09bb0f04d60e5c3b8f67 (patch)
tree8a196777f4ee32e3ee089c12b667caa2c82dec75 /source/blender/blenlib/BLI_math_color.h
parent1f02209957fc8afde957b48f1be41fc399a725b0 (diff)
Code refactoring: add unified image buffer functions for doing float => byte,
byte => float, float => float, byte => byte conversions with profile, dither and predivide. Previously code for this was spread out too much. There should be no functional changes, this is so the predivide/table/dither patches can work correctly.
Diffstat (limited to 'source/blender/blenlib/BLI_math_color.h')
-rw-r--r--source/blender/blenlib/BLI_math_color.h29
1 files changed, 18 insertions, 11 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h
index 0e33ee2be3f..7fbb4680b6d 100644
--- a/source/blender/blenlib/BLI_math_color.h
+++ b/source/blender/blenlib/BLI_math_color.h
@@ -34,6 +34,8 @@
extern "C" {
#endif
+#include "BLI_math_inline.h"
+
/* primaries */
#define BLI_XYZ_SMPTE 0
#define BLI_XYZ_REC709_SRGB 1
@@ -48,7 +50,7 @@ extern "C" {
#define BLI_YCC_ITU_BT601 0
#define BLI_YCC_ITU_BT709 1
#define BLI_YCC_JFIF_0_255 2
-
+
/******************* Conversion to RGB ********************/
void hsv_to_rgb(float h, float s, float v, float *r, float *g, float *b);
@@ -70,22 +72,23 @@ unsigned int hsv_to_cpack(float h, float s, float v);
float rgb_to_grayscale(float rgb[3]);
unsigned char rgb_to_grayscale_byte(unsigned char rgb[3]);
-/***************** Profile Transformations ********************/
+/**************** Profile Transformations *****************/
void gamma_correct(float *c, float gamma);
float rec709_to_linearrgb(float c);
float linearrgb_to_rec709(float c);
float srgb_to_linearrgb(float c);
float linearrgb_to_srgb(float c);
-void srgb_to_linearrgb_v3_v3(float *col_to, float *col_from);
-void linearrgb_to_srgb_v3_v3(float *col_to, float *col_from);
-
-/* rgba buffer convenience functions */
-void srgb_to_linearrgb_rgba_buf(float *col, int tot);
-void linearrgb_to_srgb_rgba_buf(float *col, int tot);
-void srgb_to_linearrgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
-void linearrgb_to_srgb_rgba_rgba_buf(float *col_to, float *col_from, int tot);
-
+
+MINLINE void srgb_to_linearrgb_v3_v3(float linear[3], const float srgb[3]);
+MINLINE void linearrgb_to_srgb_v3_v3(float srgb[3], const float linear[3]);
+
+MINLINE void srgb_to_linearrgb_v4(float linear[4], const float srgb[4]);
+MINLINE void linearrgb_to_srgb_v4(float srgb[4], const float linear[4]);
+
+MINLINE void srgb_to_linearrgb_predivide_v4(float linear[4], const float srgb[4]);
+MINLINE void linearrgb_to_srgb_predivide_v4(float srgb[4], const float linear[4]);
+
/************************** Other *************************/
int constrain_rgb(float *r, float *g, float *b);
@@ -101,6 +104,10 @@ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *o
void rgb_byte_to_float(const unsigned char *in, float *out);
void rgb_float_to_byte(const float *in, unsigned char *out);
+#ifdef BLI_MATH_INLINE_H
+#include "intern/math_color_inline.c"
+#endif
+
#ifdef __cplusplus
}
#endif