[shotwell] Fill pixel cache from lookup table
- From: Jens Georg <jensgeorg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [shotwell] Fill pixel cache from lookup table
- Date: Thu, 9 Nov 2017 13:02:21 +0000 (UTC)
commit 08408e7068ef2d91f00cc58604de2902ebfceb09
Author: Jens Georg <mail jensge org>
Date: Sun Nov 5 19:06:55 2017 +0100
Fill pixel cache from lookup table
src/editing_tools/EditingTools.vala | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/src/editing_tools/EditingTools.vala b/src/editing_tools/EditingTools.vala
index 0fc0b7e..873bb57 100644
--- a/src/editing_tools/EditingTools.vala
+++ b/src/editing_tools/EditingTools.vala
@@ -2949,15 +2949,14 @@ public class AdjustTool : EditingTool {
fp_pixel_cache = new float[3 * source_width * source_height];
int cache_pixel_index = 0;
- float INV_255 = 1.0f / 255.0f;
for (int j = 0; j < source_height; j++) {
int row_start_index = j * source_rowstride;
int row_end_index = row_start_index + (source_width * source_num_channels);
for (int i = row_start_index; i < row_end_index; i += source_num_channels) {
- fp_pixel_cache[cache_pixel_index++] = ((float) source_pixels[i]) * INV_255;
- fp_pixel_cache[cache_pixel_index++] = ((float) source_pixels[i + 1]) * INV_255;
- fp_pixel_cache[cache_pixel_index++] = ((float) source_pixels[i + 2]) * INV_255;
+ fp_pixel_cache[cache_pixel_index++] = rgb_lookup_table[source_pixels[i]];
+ fp_pixel_cache[cache_pixel_index++] = rgb_lookup_table[source_pixels[i + 1]];
+ fp_pixel_cache[cache_pixel_index++] = rgb_lookup_table[source_pixels[i + 2]];
}
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]