diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-12-05 20:46:27 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-12-05 20:57:17 +0400 |
commit | 07ceb99213166b678f0a0bac9c35e9897f22e827 (patch) | |
tree | 70fc2e2639fe00ccb9f6ce94815245067b34454d /source/blender/blenlib/BLI_math_color.h | |
parent | fac8e84632f3ce1b2a8d63fa083ca0aaa61c3267 (diff) |
Code Cleanup: use strict flags for math lib, add inline declarations
Diffstat (limited to 'source/blender/blenlib/BLI_math_color.h')
-rw-r--r-- | source/blender/blenlib/BLI_math_color.h | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/source/blender/blenlib/BLI_math_color.h b/source/blender/blenlib/BLI_math_color.h index 6f432761a55..7167aad9551 100644 --- a/source/blender/blenlib/BLI_math_color.h +++ b/source/blender/blenlib/BLI_math_color.h @@ -76,7 +76,12 @@ void rgb_to_xyz(float r, float g, float b, float *x, float *y, float *z); unsigned int rgb_to_cpack(float r, float g, float b); unsigned int hsv_to_cpack(float h, float s, float v); -/* rgb_to_grayscale & rgb_to_luma functions moved to math_color_inline.c */ +MINLINE float rgb_to_bw(const float rgb[3]); +MINLINE float rgb_to_grayscale(const float rgb[3]); +MINLINE unsigned char rgb_to_grayscale_byte(const unsigned char rgb[3]); +MINLINE float rgb_to_luma(const float rgb[3]); +MINLINE unsigned char rgb_to_luma_byte(const unsigned char rgb[3]); +MINLINE float rgb_to_luma_y(const float rgb[3]); /**************** Profile Transformations *****************/ @@ -95,6 +100,11 @@ 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]); +MINLINE unsigned short to_srgb_table_lookup(const float f); +MINLINE void linearrgb_to_srgb_ushort4(unsigned short srgb[4], const float linear[4]); +MINLINE void srgb_to_linearrgb_uchar4(float linear[4], const unsigned char srgb[4]); +MINLINE void srgb_to_linearrgb_uchar4_predivide(float linear[4], const unsigned char srgb[4]); + MINLINE void linearrgb_to_srgb_uchar3(unsigned char srgb[3], const float linear[3]); MINLINE void linearrgb_to_srgb_uchar4(unsigned char srgb[4], const float linear[4]); @@ -126,6 +136,13 @@ void xyz_to_lab(float x, float y, float z, float *l, float *a, float *b); MINLINE int compare_rgb_uchar(const unsigned char a[3], const unsigned char b[3], const int limit); +#define rgba_char_args_set_fl(col, r, g, b, a) \ + rgba_char_args_set(col, (r) * 255, (g) * 255, (b) * 255, (a) * 255) + +MINLINE void rgba_char_args_set(char col[4], const char r, const char g, const char b, const char a); +MINLINE void rgba_char_args_test_set(char col[4], const char r, const char g, const char b, const char a); +MINLINE void cpack_cpy_3ub(unsigned char r_col[3], const unsigned int pack); + /********* lift/gamma/gain / ASC-CDL conversion ***********/ void lift_gamma_gain_to_asc_cdl(float *lift, float *gamma, float *gain, float *offset, float *slope, float *power); |