Commit b3453aa7 authored by Arnaud Blanchard's avatar Arnaud Blanchard
Browse files

Merge branch 'master' of

parents 4bfec925 b36c5952
Provides a graphical user interface.
For now, it displays images.
You can zoom, get the value of the pixel under the mouse, diplaying a histogram.
You can use fake colors for black and white images (usefull to improve the details of the variation of intensity).
- Mac OSX: installing gtk
- Ubuntu: sudo apt-get install libgtk-3-dev
` | o_gtk_image` Open a windows and display the image from the camera.
Note: some format of images are not yet managed.
You can display in fullscreen `-F`( return in the terminal to quit).
You can rescaling the intesisty of the pixel with `--min` and `--max` .
......@@ -8,7 +8,6 @@ project(o_gtk_image)
find_package(blc_channel REQUIRED)
find_package(blc_image REQUIRED)
find_package(blc_program REQUIRED)
find_package(blgtk REQUIRED)
find_package(PkgConfig REQUIRED)
pkg_check_modules(GTK3 REQUIRED gtk+-3.0)
......@@ -19,7 +19,7 @@ extern uint32_t g_colors[256];
extern uint32_t b_colors[256];
extern uint32_t *color_map;
extern GtkWidget *paned;
extern GtkWidget *window, *paned;
extern GdkDevice *pointer_device;
extern blc_channel mouse_channel;
#include "common.h"
#include "blgtk.h"
#include <fcntl.h> // O_RDONLY ...
#include <stdio.h>
#include <gtk/gtk.h>
#include "common.h"
#include "blgtk.h"
#include <fcntl.h> // O_RDONLY ...
#include <stdio.h>
......@@ -51,6 +50,30 @@ static int g_source_continue=G_SOURCE_CONTINUE;
#define SWAP_RGBA_TO_CAIRO_ARGB32(x) ((((x) & 0x000000FF) << 16) | (((x) & 0x00FF0000) >> 16) | ((x) & 0xFF00FF00) )
static GtkToggleToolButton *blgtk_add_toggle_tool_button(GtkWidget *toolbar, char const *label, char const *icon_name, GCallback callback, void *user_data)
GtkToggleToolButton *toggle_tool_button;
gtk_tool_button_set_icon_name(GTK_TOOL_BUTTON(toggle_tool_button), icon_name);
gtk_tool_button_set_label(GTK_TOOL_BUTTON(toggle_tool_button), label);
gtk_container_add(GTK_CONTAINER(toolbar), GTK_WIDGET(toggle_tool_button));
if (callback) g_signal_connect(G_OBJECT(toggle_tool_button), "clicked", callback, user_data);
return toggle_tool_button;
static GtkWidget *blgtk_add_tool_button(GtkWidget *toolbar, gchar const *label, gchar const *icon_name, GCallback callback, gpointer user_data)
GtkWidget *tool_button;
tool_button=GTK_WIDGET(gtk_tool_button_new(gtk_image_new_from_icon_name(icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR), label));
gtk_container_add(GTK_CONTAINER(toolbar), tool_button);
if (callback) g_signal_connect(G_OBJECT(tool_button), "clicked", callback, user_data);
return tool_button;
static void toggle_fullscreen(GtkWidget *widget, GdkEventWindowState *event, gpointer user_data){
if (event->new_window_state & GDK_WINDOW_STATE_FULLSCREEN ){
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment