summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 18:00:40 +0200
committerBenjamin Franzke <benjaminfranzke@googlemail.com>2012-03-31 18:00:40 +0200
commitc7599df4084d717087b3aee36e2ffb632c242d96 (patch)
tree21bf879e4caece5c522cda493836e637675b6832
parent750012943aaf86c529bcf93b39dbbd7523e80d55 (diff)
downloadcv-c7599df4084d717087b3aee36e2ffb632c242d96.tar.gz
cv-c7599df4084d717087b3aee36e2ffb632c242d96.tar.bz2
cv-c7599df4084d717087b3aee36e2ffb632c242d96.zip
roi: Rename input to image
And modified_input to marked_image
-rw-r--r--roi.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/roi.c b/roi.c
index 1c69240..213abc4 100644
--- a/roi.c
+++ b/roi.c
@@ -14,7 +14,7 @@ struct roi {
GtkWidget *window;
GtkWidget *drawing_area;
- GdkPixbuf *input, *modified_input;
+ GdkPixbuf *image, *marked_image;
gboolean doing_rubberband;
struct {
@@ -115,15 +115,15 @@ do_roi(struct roi *roi)
if (width < 1 || height < 1)
return FALSE;
- match = gdk_pixbuf_new_subpixbuf(roi->input, x, y, width, height);
+ match = gdk_pixbuf_new_subpixbuf(roi->image, x, y, width, height);
calc_roi_interval(roi, match);
g_object_unref(match);
- if (roi->modified_input)
- g_object_unref(roi->modified_input);
- roi->modified_input = gdk_pixbuf_copy(roi->input);
+ if (roi->marked_image)
+ g_object_unref(roi->marked_image);
+ roi->marked_image = gdk_pixbuf_copy(roi->image);
- mark_matching_pixels(roi, roi->modified_input);
+ mark_matching_pixels(roi, roi->marked_image);
return TRUE;
}
@@ -186,9 +186,9 @@ key_event(GtkWidget *widget, GdkEventKey *event, gpointer userdata)
switch (event->keyval) {
case GDK_KEY_d:
case GDK_KEY_D:
- if (roi->modified_input) {
- g_object_unref(roi->modified_input);
- roi->modified_input = NULL;
+ if (roi->marked_image) {
+ g_object_unref(roi->marked_image);
+ roi->marked_image = NULL;
gtk_widget_queue_draw(roi->drawing_area);
}
break;
@@ -225,8 +225,8 @@ draw_cb(GtkWidget *widget, cairo_t *cr, gpointer userdata)
{
struct roi *roi = userdata;
- gdk_cairo_set_source_pixbuf(cr, roi->modified_input ?
- roi->modified_input : roi->input, 0, 0);
+ gdk_cairo_set_source_pixbuf(cr, roi->marked_image ?
+ roi->marked_image : roi->image, 0, 0);
cairo_paint(cr);
if (roi->doing_rubberband)
@@ -246,15 +246,15 @@ main(int argc, char *argv[])
if (argc < 2)
exit(EXIT_FAILURE);
- roi.input = gdk_pixbuf_new_from_file(argv[1], NULL);
- if (!roi.input)
+ roi.image = gdk_pixbuf_new_from_file(argv[1], NULL);
+ if (!roi.image)
exit(EXIT_FAILURE);
roi.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
roi.drawing_area = gtk_drawing_area_new();
gtk_widget_set_size_request(roi.drawing_area,
- gdk_pixbuf_get_width(roi.input),
- gdk_pixbuf_get_height(roi.input));
+ gdk_pixbuf_get_width(roi.image),
+ gdk_pixbuf_get_height(roi.image));
gtk_container_add(GTK_CONTAINER(roi.window), roi.drawing_area);
@@ -277,9 +277,9 @@ main(int argc, char *argv[])
gtk_widget_show_all(roi.window);
gtk_main();
- g_object_unref(roi.input);
- if (roi.modified_input)
- g_object_unref(roi.modified_input);
+ g_object_unref(roi.image);
+ if (roi.marked_image)
+ g_object_unref(roi.marked_image);
return 0;
}