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:
authorGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>2010-12-31 23:01:38 +0300
committerGuillermo S. Romero <gsr.b3d@infernal-iceberg.com>2010-12-31 23:01:38 +0300
commitc169ccc711edc182d4983f59c1124aee91e7acd5 (patch)
tree7bcba51b81366d24dc67d5c90533b74c6d8ecf0e /source/blender/blenlib/intern/math_color.c
parent91f0e13686a6f394bc85a7025dab5435a134d2f6 (diff)
Silence more compiler warnings.
Diffstat (limited to 'source/blender/blenlib/intern/math_color.c')
-rw-r--r--source/blender/blenlib/intern/math_color.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source/blender/blenlib/intern/math_color.c b/source/blender/blenlib/intern/math_color.c
index cf7a122e1bf..9d93168590f 100644
--- a/source/blender/blenlib/intern/math_color.c
+++ b/source/blender/blenlib/intern/math_color.c
@@ -112,7 +112,7 @@ void yuv_to_rgb(float y, float u, float v, float *lr, float *lg, float *lb)
void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, int colorspace)
{
float sr,sg, sb;
- float y, cr, cb;
+ float y = 128.f, cr = 128.f, cb = 128.f;
sr=255.0f*r;
sg=255.0f*g;
@@ -144,11 +144,12 @@ void rgb_to_ycc(float r, float g, float b, float *ly, float *lcb, float *lcr, in
}
-/* YCC input have a range of 16-235 and 16-240 exepect with JFIF_0_255 where the range is 0-255 */
+/* YCC input have a range of 16-235 and 16-240 except with JFIF_0_255 where the range is 0-255 */
/* RGB outputs are in the range 0 - 1.0f */
+/* FIXME comment above must be wrong because BLI_YCC_ITU_BT601 y 16.0 cr 16.0 -> r -0.7009 */
void ycc_to_rgb(float y, float cb, float cr, float *lr, float *lg, float *lb, int colorspace)
{
- float r,g,b;
+ float r = 128.f, g = 128.f, b = 128.f;
switch (colorspace) {
case BLI_YCC_ITU_BT601 :
@@ -182,7 +183,7 @@ void hex_to_rgb(char *hexcol, float *r, float *g, float *b)
if (sscanf(hexcol, "%02x%02x%02x", &ri, &gi, &bi)==3) {
*r = ri / 255.0f;
- *g = gi / 255.0f;
+ *g = gi / 255.0f;
*b = bi / 255.0f;
CLAMP(*r, 0.0f, 1.0f);
CLAMP(*g, 0.0f, 1.0f);