Fix #314: Remote commands for thumbnail maintenance
[geeqie.git] / src / renderer-tiles.c
index 72ea055..6a034e1 100644 (file)
@@ -1,14 +1,22 @@
 /*
- * Geeqie
- * (C) 2006 John Ellis
- * Copyright (C) 2008 - 2012 The Geeqie Team
+ * Copyright (C) 2006 John Ellis
+ * Copyright (C) 2008 - 2016 The Geeqie Team
  *
  * Author: John Ellis
- * Author: Vladimir Nadvornik
  *
- * This software is released under the GNU General Public License (GNU GPL).
- * Please read the included file COPYING for more information.
- * This software comes with no warranty of any kind, use at your own risk!
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  */
 
 #include <stdio.h>
@@ -211,12 +219,12 @@ static void rt_border_draw(RendererTiles *rt, gint x, gint y, gint w, gint h)
                                   pr->viewport_width, pr->viewport_height,
                                   &rx, &ry, &rw, &rh))
                        {
-                       cairo_set_source_rgb(cr, 0, 0, 0);
+                       cairo_set_source_rgb(cr, (double)pr->color.red/65535, (double)pr->color.green/65535, (double)pr->color.blue/65535);
                        cairo_rectangle(cr, rx + rt->stereo_off_x, ry + rt->stereo_off_y, rw, rh);
                        cairo_fill(cr);
-                       cairo_destroy(cr);
                        rt_overlay_draw(rt, rx, ry, rw, rh, NULL);
                        }
+               cairo_destroy(cr);
                return;
                }
 
@@ -228,7 +236,7 @@ static void rt_border_draw(RendererTiles *rt, gint x, gint y, gint w, gint h)
                                   pr->x_offset, pr->viewport_height,
                                   &rx, &ry, &rw, &rh))
                        {
-                       cairo_set_source_rgb(cr, 0, 0, 0);
+                       cairo_set_source_rgb(cr, (double)pr->color.red/65535, (double)pr->color.green/65535, (double)pr->color.blue/65535);
                        cairo_rectangle(cr, rx + rt->stereo_off_x, ry + rt->stereo_off_y, rw, rh);
                        cairo_fill(cr);
                        rt_overlay_draw(rt, rx, ry, rw, rh, NULL);
@@ -239,7 +247,7 @@ static void rt_border_draw(RendererTiles *rt, gint x, gint y, gint w, gint h)
                                   pr->viewport_width - pr->vis_width - pr->x_offset, pr->viewport_height,
                                   &rx, &ry, &rw, &rh))
                        {
-                       cairo_set_source_rgb(cr, 0, 0, 0);
+                       cairo_set_source_rgb(cr, (double)pr->color.red/65535, (double)pr->color.green/65535, (double)pr->color.blue/65535);
                        cairo_rectangle(cr, rx + rt->stereo_off_x, ry + rt->stereo_off_y, rw, rh);
                        cairo_fill(cr);
                        rt_overlay_draw(rt, rx, ry, rw, rh, NULL);
@@ -253,7 +261,7 @@ static void rt_border_draw(RendererTiles *rt, gint x, gint y, gint w, gint h)
                                   pr->vis_width, pr->y_offset,
                                   &rx, &ry, &rw, &rh))
                        {
-                       cairo_set_source_rgb(cr, 0, 0, 0);
+                       cairo_set_source_rgb(cr, (double)pr->color.red/65535, (double)pr->color.green/65535, (double)pr->color.blue/65535);
                        cairo_rectangle(cr, rx + rt->stereo_off_x, ry + rt->stereo_off_y, rw, rh);
                        cairo_fill(cr);
                        rt_overlay_draw(rt, rx, ry, rw, rh, NULL);
@@ -264,7 +272,7 @@ static void rt_border_draw(RendererTiles *rt, gint x, gint y, gint w, gint h)
                                   pr->vis_width, pr->viewport_height - pr->vis_height - pr->y_offset,
                                   &rx, &ry, &rw, &rh))
                        {
-                       cairo_set_source_rgb(cr, 0, 0, 0);
+                       cairo_set_source_rgb(cr, (double)pr->color.red/65535, (double)pr->color.green/65535, (double)pr->color.blue/65535);
                        cairo_rectangle(cr, rx + rt->stereo_off_x, ry + rt->stereo_off_y, rw, rh);
                        cairo_fill(cr);
                        rt_overlay_draw(rt, rx, ry, rw, rh, NULL);
@@ -1264,7 +1272,13 @@ static void rt_tile_get_region(gboolean has_alpha,
                                         scale_x, scale_y,
                                         interp_type,
                                         255, check_x, check_y,
-                                        PR_ALPHA_CHECK_SIZE, PR_ALPHA_CHECK1, PR_ALPHA_CHECK2);
+                                        PR_ALPHA_CHECK_SIZE,
+                                        ((options->image.alpha_color_1.red << 8 & 0x00FF0000) +
+                                        (options->image.alpha_color_1.green & 0x00FF00) +
+                                        (options->image.alpha_color_1.blue >> 8 & 0x00FF)),
+                                        ((options->image.alpha_color_2.red << 8 & 0x00FF0000) +
+                                        (options->image.alpha_color_2.green & 0x00FF00) +
+                                        (options->image.alpha_color_2.blue >> 8 & 0x00FF)));
                }
 }