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:
authorCampbell Barton <ideasman42@gmail.com>2012-01-14 21:14:23 +0400
committerCampbell Barton <ideasman42@gmail.com>2012-01-14 21:14:23 +0400
commit0d5595befb71303926d03e40dc5791e55f7f7ad9 (patch)
treed4c3f976df9ea92c546d35ed99215e4710a3db51 /source/blender/editors/space_image/image_ops.c
parent6e72a7c1138169eb23ff3628e5e0a27349e7015a (diff)
add utility function to BLI_math_color - rgb_to_luma, rgb_to_luma_byte, also use rgb_to_grayscale in more places.
Diffstat (limited to 'source/blender/editors/space_image/image_ops.c')
-rw-r--r--source/blender/editors/space_image/image_ops.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 999a25f57b5..06674513868 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -2016,14 +2016,14 @@ static int image_sample_line_exec(bContext *C, wmOperator *op)
hist->data_r[i] = rgb[0];
hist->data_g[i] = rgb[1];
hist->data_b[i] = rgb[2];
- hist->data_luma[i] = (0.299f*rgb[0] + 0.587f*rgb[1] + 0.114f*rgb[2]);
+ hist->data_luma[i] = rgb_to_luma(rgb);
}
else if (ibuf->rect) {
cp= (unsigned char *)(ibuf->rect + y*ibuf->x + x);
hist->data_r[i] = (float)cp[0]/255.0f;
hist->data_g[i] = (float)cp[1]/255.0f;
hist->data_b[i] = (float)cp[2]/255.0f;
- hist->data_luma[i] = (0.299f*cp[0] + 0.587f*cp[1] + 0.114f*cp[2])/255;
+ hist->data_luma[i] = (float)rgb_to_luma_byte(cp)/255.0f;
}
}
}