[gegl] errors in color conversion
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gegl] errors in color conversion
- Date: Tue, 20 Mar 2012 13:53:15 +0000 (UTC)
commit f95d5b71aca1f407ba613c263771af7d8ce479b7
Author: Victor Oliveira <victormatheus gmail com>
Date: Fri Feb 17 02:47:23 2012 -0200
errors in color conversion
gegl/opencl/gegl-cl-color-kernel.h | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
---
diff --git a/gegl/opencl/gegl-cl-color-kernel.h b/gegl/opencl/gegl-cl-color-kernel.h
index 5bfa4b9..4353593 100644
--- a/gegl/opencl/gegl-cl-color-kernel.h
+++ b/gegl/opencl/gegl-cl-color-kernel.h
@@ -93,7 +93,7 @@ static const char* kernel_color_source =
" float4 out_v; \n"
" out_v = (in_v.w > BABL_ALPHA_THRESHOLD)? in_v / in_v.w : (float4)(0.0f); \n"
" out_v.w = in_v.w; \n"
-" out[gid] = convert_uchar4_sat_rte(out_v); \n"
+" out[gid] = convert_uchar4_sat_rte(255.0f * out_v); \n"
"} \n"
/* -- R'G'B'A float -- */
@@ -164,10 +164,9 @@ static const char* kernel_color_source =
" float4 in_v = in[gid]; \n"
" float4 out_v; \n"
" \n"
-" float4 rgb = (float4)(linear_to_gamma_2_2(in_v.x), \n"
+" float3 rgb = (float3)(linear_to_gamma_2_2(in_v.x), \n"
" linear_to_gamma_2_2(in_v.y), \n"
-" linear_to_gamma_2_2(in_v.z), \n"
-" 0.0f); \n"
+" linear_to_gamma_2_2(in_v.z)); \n"
" \n"
" out_v = (float4)( 0.299f * rgb.x + 0.587f * rgb.y + 0.114f * rgb.z, \n"
" -0.168736f * rgb.x - 0.331264f * rgb.y + 0.5f * rgb.z, \n"
@@ -229,9 +228,9 @@ static const char* kernel_color_source =
" 1.0f * in_v.x + 1.772f * in_v.y + 0.0f * in_v.z, \n"
" 0.0f); \n"
" \n"
-" out_v = (float4)(linear_to_gamma_2_2(rgb.x), \n"
-" linear_to_gamma_2_2(rgb.y), \n"
-" linear_to_gamma_2_2(rgb.z), \n"
+" out_v = (float4)(gamma_2_2_to_linear(rgb.x), \n"
+" gamma_2_2_to_linear(rgb.y), \n"
+" gamma_2_2_to_linear(rgb.z), \n"
" in_v.w); \n"
" out[gid] = convert_uchar4_sat_rte(255.0f * out_v); \n"
"} \n"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]