diff -u display/display2d.h b/display//display2d.h
--- a/display/display2d.h	2019-01-05 22:15:50.735581543 +0000
+++ b/display//display2d.h	2017-12-28 00:08:47.408049514 +0000
@@ -37,7 +37,7 @@
 #define DISPLAY2D_H
 
 
-#include <error.h>
+#include <libvdError.h>
 
 
 namespace libvdDisplay
diff -u display/display3d.h b/display//display3d.h
--- a/display/display3d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display//display3d.h	2017-12-28 00:15:33.026028462 +0000
@@ -35,7 +35,7 @@
 #endif
 
 #include <limits>
-#include <error.h>
+#include <libvd/libvdError.h>
 
 
 namespace libvdDisplay
@@ -264,7 +264,7 @@
 		//typedef typename DataType TextureType;
 
 		/* check inputs */
-		if(!data || !width || !height || !depth) throw LOCATE(Error("wrong inputs"));
+		if(!data || !width || !height || !depth) return;
 
 		/* if this is the first function call, create shaders */
 		if(!m_gpu_program) initShader();
@@ -283,8 +283,8 @@
 		for(unsigned int i=0; i<3; ++i) m_texture_scale[i] = (float)data_size[i] / texture_size[i];
 
 		/* Create and send 3D texture */
-		if(!glIsTexture(m_data_texture)) glGenTextures(1, &m_data_texture); glCheckError();
-		glBindTexture(GL_TEXTURE_3D, m_data_texture); glCheckError();
+		if(!glIsTexture(m_data_texture)) glGenTextures(1, &m_data_texture); 
+		glBindTexture(GL_TEXTURE_3D, m_data_texture); 
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER);
@@ -300,11 +300,10 @@
 				 GL_LUMINANCE,
 				 OpenGLArgs<TextureType>::type,
 				 buffer);
-		glCheckError();
 
 		/* Check if memory has been allocated on graphic card */
 		glEnable(GL_TEXTURE_3D);
-		glBindTexture(GL_TEXTURE_3D, m_data_texture); glCheckError();
+		glBindTexture(GL_TEXTURE_3D, m_data_texture); 
 		glDisable(GL_TEXTURE_3D);
 
 		/* delete texture buffer, it is now transfered to the graphic card */
@@ -355,7 +354,7 @@
 
 		/* Create 1D texture for lookup table */
 		if(!glIsTexture(m_lut_texture)) glGenTextures(1, &m_lut_texture);
-		glBindTexture(GL_TEXTURE_2D, m_lut_texture); glCheckError();
+		glBindTexture(GL_TEXTURE_2D, m_lut_texture); 
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -369,7 +368,6 @@
 		             GL_RGBA, // color lookup table
 		             GL_FLOAT,
 		             m_internal_lut);
-		glCheckError();
 
 		/* NB: instead of freeing this unused memory, keep it there
 			   so when updating it the next time, no time will be lost in memory allocation/deallocation */
diff -u display/display4d.h b/display//display4d.h
--- a/display/display4d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display//display4d.h	2017-12-28 00:08:47.408049514 +0000
@@ -35,7 +35,7 @@
 #endif
 
 #include <limits>
-#include <error.h>
+#include <libvdError.h>
 
 
 namespace libvdDisplay
Nur in b/display//: glprintf.h.
Nur in b/display//: image.h.
diff -u display/isosurface.h b/display//isosurface.h
--- a/display/isosurface.h	2019-01-05 22:15:50.735581543 +0000
+++ b/display//isosurface.h	2017-12-28 00:08:47.412049458 +0000
@@ -34,7 +34,7 @@
 #include <GL/gl.h>
 #endif
 #include <cmath>
-#include <error.h>
+#include <libvdError.h>
 
 
 namespace libvdDisplay
Nur in b/display//: libvdError.h.
diff -u display/mask3d.h b/display//mask3d.h
--- a/display/mask3d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display/mask3d.h	2017-12-28 00:08:47.412049458 +0000
@@ -27,7 +27,7 @@
 #ifndef MASK3D_H
 #define MASK3D_H
 
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -u display/mask4d.h b/display//mask4d.h
--- a/display/mask4d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display/mask4d.h	2017-12-28 00:08:47.412049458 +0000
@@ -27,7 +27,7 @@
 #ifndef MASK4D_H
 #define MASK4D_H
 
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -u display/point3d.h b/display//point3d.h
--- a/display/point3d.h	2019-01-05 22:15:50.735581543 +0000
+++ b/display/point3d.h	2017-12-28 00:08:47.416049402 +0000
@@ -27,7 +27,7 @@
 #ifndef POINT3D_H
 #define POINT3D_H
 
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -u display/smoothmask3d.h b/display//smoothmask3d.h
--- a/display/smoothmask3d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display/smoothmask3d.h	2017-12-28 00:08:47.416049402 +0000
@@ -35,7 +35,7 @@
 #endif
 #include <queue>
 #include <cmath>
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -u display/smoothmask4d.h b/display//smoothmask4d.h
--- a/display/smoothmask4d.h	2019-01-05 22:15:50.731581613 +0000
+++ b/display/smoothmask4d.h	2017-12-28 00:08:47.416049402 +0000
@@ -15,7 +15,7 @@
 #endif
 #include <queue>
 #include <cmath>
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 src/pick.cpp
--- a/src/pick.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/pick.cpp	Thu Apr 04 14:02:32 2019 +0100
@@ -37,7 +37,7 @@
 #endif
 
 #include <tools/pick.h>
-#include <error.h>
+#include <libvdError.h>
 
 namespace Tools
 {
diff -r 029d02120f84 display/display2d.h
--- a/display/display2d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/display2d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -37,7 +37,7 @@
 #define DISPLAY2D_H
 
 
-#include <error.h>
+#include <libvdError.h>
 
 
 namespace libvdDisplay
diff -r 029d02120f84 display/display3d.h
--- a/display/display3d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/display3d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -35,7 +35,7 @@
 #endif
 
 #include <limits>
-#include <error.h>
+#include <libvd/libvdError.h>
 
 
 namespace libvdDisplay
@@ -264,7 +264,7 @@
 		//typedef typename DataType TextureType;
 
 		/* check inputs */
-		if(!data || !width || !height || !depth) throw LOCATE(Error("wrong inputs"));
+		if(!data || !width || !height || !depth) return;
 
 		/* if this is the first function call, create shaders */
 		if(!m_gpu_program) initShader();
@@ -283,8 +283,8 @@
 		for(unsigned int i=0; i<3; ++i) m_texture_scale[i] = (float)data_size[i] / texture_size[i];
 
 		/* Create and send 3D texture */
-		if(!glIsTexture(m_data_texture)) glGenTextures(1, &m_data_texture); glCheckError();
-		glBindTexture(GL_TEXTURE_3D, m_data_texture); glCheckError();
+		if(!glIsTexture(m_data_texture)) glGenTextures(1, &m_data_texture); 
+		glBindTexture(GL_TEXTURE_3D, m_data_texture); 
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_3D, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_BORDER);
@@ -300,11 +300,10 @@
 				 GL_LUMINANCE,
 				 OpenGLArgs<TextureType>::type,
 				 buffer);
-		glCheckError();
 
 		/* Check if memory has been allocated on graphic card */
 		glEnable(GL_TEXTURE_3D);
-		glBindTexture(GL_TEXTURE_3D, m_data_texture); glCheckError();
+		glBindTexture(GL_TEXTURE_3D, m_data_texture); 
 		glDisable(GL_TEXTURE_3D);
 
 		/* delete texture buffer, it is now transfered to the graphic card */
@@ -355,7 +354,7 @@
 
 		/* Create 1D texture for lookup table */
 		if(!glIsTexture(m_lut_texture)) glGenTextures(1, &m_lut_texture);
-		glBindTexture(GL_TEXTURE_2D, m_lut_texture); glCheckError();
+		glBindTexture(GL_TEXTURE_2D, m_lut_texture); 
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
@@ -369,7 +368,6 @@
 		             GL_RGBA, // color lookup table
 		             GL_FLOAT,
 		             m_internal_lut);
-		glCheckError();
 
 		/* NB: instead of freeing this unused memory, keep it there
 			   so when updating it the next time, no time will be lost in memory allocation/deallocation */
diff -r 029d02120f84 display/display4d.h
--- a/display/display4d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/display4d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -35,7 +35,7 @@
 #endif
 
 #include <limits>
-#include <error.h>
+#include <libvd/libvdError.h>
 
 
 namespace libvdDisplay
diff -r 029d02120f84 display/isosurface.h
--- a/display/isosurface.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/isosurface.h	Thu Apr 04 14:36:57 2019 +0100
@@ -34,7 +34,7 @@
 #include <GL/gl.h>
 #endif
 #include <cmath>
-#include <error.h>
+#include <libvdError.h>
 
 
 namespace libvdDisplay
diff -r 029d02120f84 display/mask3d.h
--- a/display/mask3d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/mask3d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -27,7 +27,7 @@
 #ifndef MASK3D_H
 #define MASK3D_H
 
-#include <error.h>
+#include <libvd/libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 display/mask4d.h
--- a/display/mask4d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/mask4d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -27,7 +27,7 @@
 #ifndef MASK4D_H
 #define MASK4D_H
 
-#include <error.h>
+#include <libvd/libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 display/point3d.h
--- a/display/point3d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/point3d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -27,7 +27,7 @@
 #ifndef POINT3D_H
 #define POINT3D_H
 
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 display/smoothmask3d.h
--- a/display/smoothmask3d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/smoothmask3d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -35,7 +35,7 @@
 #endif
 #include <queue>
 #include <cmath>
-#include <error.h>
+#include <libvd/libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 display/smoothmask4d.h
--- a/display/smoothmask4d.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/display/smoothmask4d.h	Thu Apr 04 14:36:57 2019 +0100
@@ -15,7 +15,7 @@
 #endif
 #include <queue>
 #include <cmath>
-#include <error.h>
+#include <libvdError.h>
 
 namespace libvdDisplay
 {
diff -r 029d02120f84 io/ioavi.h
--- a/io/ioavi.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/io/ioavi.h	Thu Apr 04 14:36:57 2019 +0100
@@ -66,28 +66,28 @@
 		~AVI();
 
 		/** open an avi file */
-		void open(const char* filename);
+		bool open(const char* filename);
 
 		/** close file */
-		void close();
+		bool close();
 	
 		/** returns the number of frames in the movie */
 		unsigned int getNbFrames();
 
 		/** returns the image size */
-		void getFrameSize(unsigned int &width, unsigned int &height);
+		bool getFrameSize(unsigned int &width, unsigned int &height);
 
 		/** read a single frame in a 2D image */
-		void read(color<unsigned char>* &image, unsigned int frame);
+		bool read(color<unsigned char>* &image, unsigned int frame);
 
 		/** read the whole movie in a 3D image */
-		void read(color<unsigned char>* &image);
+		bool read(color<unsigned char>* &image);
 
 		/** read part of the movie in a 3D image (including start & end frames) */
-		void read(color<unsigned char>* &image, unsigned int start, unsigned int end);
+		bool read(color<unsigned char>* &image, unsigned int start, unsigned int end);
 	
 	private:
-		void readHeader();
+		bool readHeader();
 	
 		struct header { ///< AVI header
 			unsigned int time_delay;            // time delay between frames in microseconds
diff -r 029d02120f84 io/iobmp.h
--- a/io/iobmp.h	Thu Apr 04 13:59:59 2019 +0100
+++ b/io/iobmp.h	Thu Apr 04 14:36:57 2019 +0100
@@ -37,18 +37,18 @@
 namespace IO
 {
 	/** Read a 2D image from a BMP file */
-	void readBMP(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height);
+	bool readBMP(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height);
 		
 	
 	/** Write a 2D image in a BMP file */
-	void writeBMP(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height);
+	bool writeBMP(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height);
 	
 	
 	/** BMP reader */
 	class BMP { // implements IO for 2D color image
 	public:
-		static void read(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height); ///< read a 2D BMP image
-		static void write(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height); ///< write a 2D BMP image
+		static bool read(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height); ///< read a 2D BMP image
+		static bool write(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height); ///< write a 2D BMP image
 	};
 
 
diff -r 029d02120f84 src/Makefile
--- a/src/Makefile	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/Makefile	Thu Apr 04 14:36:57 2019 +0100
@@ -7,10 +7,10 @@
 MAJOR_VERSION=1
 MINOR_VERSION=1.0
 
-MULTIARCH=`gcc -print-multiarch`
+MULTIARCH=`x86_64-w64-mingw32-gcc -print-multiarch`
 
 ifeq ($(SHARED),1)
-EXEC    = ../lib/libvd.so.$(MAJOR_VERSION).$(MINOR_VERSION)
+EXEC    = ../lib/libvd.dll
 else
 EXEC    = ../lib/libvd.a
 endif
@@ -22,12 +22,12 @@
 
 ### ARGUMENTS #
 
-CC        = g++
+CC        = x86_64-w64-mingw32-g++
 FLAGS	  = $(CFLAGS) $(CPPFLAGS) -fPIC
 LIBSLINUX = -lglut -lGL
 LIBSAPPLE = -framework OpenGL -framework GLUT
 LIBS      = `if [ -f /mach_kernel ]; then echo ${LIBSAPPLE}; else echo ${LIBSLINUX}; fi`
-INCLUDES  = -I../
+INCLUDES  = -I../ -I/home/pcuser/mingw64/include/
 
 #Used in SONAME for shared library
 LIBVD_VERSION=$(MAJOR_VERSION).$(MINOR_VERSION)
@@ -58,7 +58,7 @@
 $(EXEC) : $(OBJECTS)
 ifeq ($(SHARED),1)
 	#Build shared library
-	gcc -fPIC --shared -o $@ $+ $(LDFLAGS) -Wl,-soname,libvd.so.$(MAJOR_VERSION)
+	x86_64-w64-mingw32-gcc -fPIC --shared -o $@ $+ $(LDFLAGS) -L/home/pcuser/mingw64/lib/ -lglu32 -lopengl32 -lstdc++  -lglew32
 else
 	#build static library
 	ar -r $@ $+
diff -r 029d02120f84 src/clip.cpp
--- a/src/clip.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/clip.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -60,7 +60,7 @@
 				return (GL_CLIP_PLANE0+i);
 			}
 		}
-		throw LOCATE(Error("cannot find a new clip plane"));
+		return 0;
 	}
 
 
@@ -70,7 +70,7 @@
 		if(index>=0 && index<NBPLANES)
 			m_planes[index] = true;
 		else
-			throw LOCATE(Error("Plane %d is not defined by OpenGL", plane));
+			return;
 	}
 
 
diff -r 029d02120f84 src/display3d.cpp
--- a/src/display3d.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/display3d.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -26,7 +26,7 @@
 
 #ifdef WIN32
 #include <windows.h>
-#include "msvc/GLee.h"
+#include <GL/glew.h>
 #include <GL/gl.h>
 #elif __APPLE__
 #include <OpenGL/gl.h>
diff -r 029d02120f84 src/display4d.cpp
--- a/src/display4d.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/display4d.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -26,7 +26,7 @@
 
 #ifdef WIN32
 #include <windows.h>
-#include "msvc/GLee.h"
+#include <GL/glew.h>
 #include <GL/gl.h>
 #elif __APPLE__
 #include <OpenGL/gl.h>
diff -r 029d02120f84 src/displayhistogram.cpp
--- a/src/displayhistogram.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/displayhistogram.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -26,7 +26,7 @@
 
 #ifdef WIN32
 #include <windows.h>
-#include "msvc/GLee.h"
+#include <GL/glew.h>
 #include <GL/gl.h>
 #elif __APPLE__
 #include <OpenGL/gl.h>
@@ -101,11 +101,11 @@
 		{
 			/* what bin */
 			unsigned int bin = static_cast<int>((m_nbBins-1)*i/width);
-			CHECKRANGE("bin index", bin, 0, m_nbBins);
+//			CHECKRANGE("bin index", bin, 0, m_nbBins);
 
 			/* whats the bin height */
 			unsigned int max = static_cast<int>((height-1)*m_histogram[bin]/m_maxheight);
-			CHECKRANGE("bin height", max, 0, height);
+//			CHECKRANGE("bin height", max, 0, height);
 
 			/* fill bin */
 			for(unsigned int j=0; j<max; ++j)
@@ -116,7 +116,7 @@
 		}
 
 		/* send texture to graphic card */
-		glBindTexture(GL_TEXTURE_2D, m_textureName); glCheckError();
+		glBindTexture(GL_TEXTURE_2D, m_textureName); 
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_BORDER);
 		glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
@@ -130,7 +130,6 @@
 				 GL_RGBA,
 				 GL_FLOAT,
 				 texture);
-		glCheckError();
 
 		/* free texture now (it is now on graphic card) */
 		delete [] texture;
@@ -150,7 +149,7 @@
 			glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
 	
 			glEnable(GL_TEXTURE_2D);
-			glBindTexture(GL_TEXTURE_2D, m_textureName); glCheckError();
+			glBindTexture(GL_TEXTURE_2D, m_textureName); 
 	
 			glColor3f(1,1,1);
 	
diff -r 029d02120f84 src/editor.cpp
--- a/src/editor.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/editor.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -33,290 +33,4 @@
 #include <GL/gl.h>
 #endif
 
-#include <tools/transferfunction/editor.h>
 
-namespace Tools { namespace TransferFunction
-{
-	Editor::Editor()
-	:	m_min(0),
-		m_max(0),
-		m_left(0),
-		m_right(0),
-		m_posx(0),
-		m_posy(0),
-		m_width(0),
-		m_height(0),
-		m_win_width(0),
-		m_win_height(0),
-		m_lutchanged(false),
-		m_contrast(1.0),
-		m_brightness(0.0),
-		m_colorMode(false),
-		m_colorSize(0),
-		m_hide(false)
-	{}
-
-
-	Editor::~Editor()
-	{
-		for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-		{
-			(*it)->destroy();
-			delete (*it);
-		}
-	}
-
-
-	void Editor::clamp(float left, float right)
-	{
-		m_histogram.clamp(left, right);
-		for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-			(*it)->clamp(left, right);
-	}
-
-
-	void Editor::place(int x, int y, int w, int h, int ww, int wh) 
-	{
-		m_posx = x,
-		m_posy = y,
-		m_width = w,
-		m_height = h,
-		m_win_width = ww,
-		m_win_height = wh;
-		m_colorSize = m_height*0.8f; // color selector is one heighth of the histogram height
-
-		// update object shapes
-		for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-			(*it)->reshape(w, h);
-	}
-
-
-	void Editor::clear()
-	{
-		m_manips.clear();
-	}
-
-
-	bool Editor::mouse(int x, int y)
-	{
-		// if hidden, do nothing with the mouse
-		if(m_hide) return false;
-
-		// check if we are in the color mode, leave it if necessary
-		if(m_colorMode)
-		{
-			// assume lut does not change
-			m_lutchanged = false;
-
-			// is mouse inside the color selector
-			float l0 = m_posx + (m_height-m_colorSize)/2; // low corner x
-			float l1 = m_posy + (m_height-m_colorSize)/2; // low corner y
-			float h0 = m_posx + (m_height-m_colorSize)/2 + m_colorSize; // high corner x
-			float h1 = m_posy + (m_height-m_colorSize)/2 + m_colorSize; // high corner y
-
-			if(x>=l0 && x<=h1 && y>=l1 && y<=h1) // inside selector
-			{
-				// what is the selected color
-				float xx = (x-l0)/(h0-l0);
-				float yy = (y-l1)/(h1-l1);
-				float r=0,g=0,b=0;
-				m_color.getRGB(xx,yy, r,g,b);
-				m_color.mark(r,g,b);
-		
-				// propagate color to transfer function manipulators
-				for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-					(*it)->setColor(r,g,b);
-
-				// lut has changed
-				m_lutchanged = true;
-		
-				// stop mouse handling here
-				return true;
-			}
-			else
-			{
-				// mouse is outside selector, leave color mode
-				m_colorMode = false;
-			}
-		}
-
-		// normalize mouse position with transfer function size
-		float xx = (float)(x-m_posx) / m_width;
-		float yy = (float)(y-m_posy) / m_height;
-
-		// give mouse event to all objects until one catch it
-		for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-			if((*it)->mouse(xx,yy)) return true; // if an object caught event stop event propagation
-
-		// if none has caught it, play with histogram
-		return m_histogram.mouse(xx,yy);
-	}
-
-
-	bool Editor::motion(int x, int y)
-	{
-		// if hidden, do nothing with the mouse
-		if(m_hide) return false;
-
-		// check if we are in the color mode, leave it if necessary
-		if(m_colorMode)
-		{
-			// assume lut does not change
-			m_lutchanged = false;
-
-			// is mouse inside the color selector
-			float l0 = m_posx + (m_height-m_colorSize)/2; // low corner x
-			float l1 = m_posy + (m_height-m_colorSize)/2; // low corner y
-			float h0 = l0 + m_colorSize; // high corner x
-			float h1 = l1 + m_colorSize; // high corner y
-
-			if(x>=l0 && x<=h0 && y>=l1 && y<=h1) // inside selector
-			{
-				// what is the selected color
-				float xx = (x-l0)/(h0-l0);
-				float yy = (y-l1)/(h1-l1);
-				float r=0,g=0,b=0;
-				m_color.getRGB(xx,yy, r,g,b);
-				m_color.mark(r,g,b);
-		
-				// propagate color to transfer function manipulators
-				for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-					(*it)->setColor(r,g,b);
-
-				// lut has changed
-				m_lutchanged = true;
-			}
-			
-			// stop mouse handling here
-			return true;
-		}
-
-		// normalize mouse position with transfer function size
-		float xx = (float)(x-m_posx) / m_width;
-		float yy = (float)(y-m_posy) / m_height;
-
-		// assume lut has not changed
-		m_lutchanged = false;
-
-		// propagate mouse event to all TFE object
-		for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-		{
-			// if an object caught event stop event propagation
-			if((*it)->motion(xx,yy))
-			{
-				m_lutchanged = true; // object modified lut
-				return true;
-			}
-		}
-
-		// if none has caught it, play with histogram
-		if(m_histogram.motion(xx,yy))
-		{
-			// update other objects visible area
-			for(std::list<TFEobject*>::iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-				(*it)->clamp(m_histogram.getLeft(),m_histogram.getRight());
-
-			// histogram setup has changed
-			return true;
-		}
-		else
-			return false;
-	}
-
-
-	void Editor::colorMode()
-	{
-		m_colorMode = true;
-	}
-
-
-	void Editor::display() const
-	{
-		if(!m_hide)
-		{
-			/* overlay on screen */
-			glMatrixMode(GL_PROJECTION);
-			glPushMatrix();
-			glLoadIdentity();
-			glOrtho(-0.5,+0.5,-0.5,+0.5,-1,+1);
-		
-			glMatrixMode(GL_MODELVIEW);
-			glPushMatrix();
-			glLoadIdentity();
-		
-			/* place TFE on screen with (0,0) beeing the lowest left corner */
-			glScalef(1.0f/m_win_width, 1.0f/m_win_height, 1);
-			glTranslatef((float)(m_posx-m_win_width/2+m_width/2), (float)(m_posy-m_win_height/2+m_height/2), 0);
-			glScalef((float)m_width, (float)m_height, 1);
-		
-			/* draw a border */
-			glColor3f(1,1,1);
-			glBegin(GL_LINE_LOOP);
-				glVertex3f(-0.5,-0.5,0);
-				glVertex3f(+0.5,-0.5,0);
-				glVertex3f(+0.5,+0.5,0);
-				glVertex3f(-0.5,+0.5,0);
-			glEnd();
-
-			/* draw histogram */
-			m_histogram.display();
-		
-			/* draw TFE objects (ramp trapezoids) */
-			for(std::list<TFEobject*>::const_iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-				(*it)->display();
-
-			/* draw the color selector is in color mode */
-			if(m_colorMode)
-			{
-				float colorSize = m_height*0.8f;
-				float colorOffset = m_height*0.1f;
-				glLoadIdentity();
-				glScalef(1.0f/m_win_width, 1.0f/m_win_height, 1);
-				glTranslatef((float)(m_posx+colorOffset-m_win_width/2+colorSize/2), (float)(m_posy+colorOffset-m_win_height/2+colorSize/2), 0);
-				glScalef(colorSize, colorSize, 1);
-				
-				m_color.display();
-			}
-
-			/* pop some matrices */
-			glMatrixMode(GL_PROJECTION);
-			glPopMatrix();
-		
-			glMatrixMode(GL_MODELVIEW);
-			glPopMatrix();
-		}
-	}
-
-
-	void Editor::get(float i, float &r, float &g, float &b, float &a) const
-	{
-		/* final rgba is the rgba returned by the object with the highest opacity (a) */
-		float max_a = 0;
-
-		for(std::list<TFEobject*>::const_iterator it=m_manips.begin(); it!=m_manips.end(); ++it)
-		{
-			/* get rgba of current manip */
-			float rr,gg,bb,aa;
-			(*it)->get(i, rr,gg,bb,aa);
-
-			/* check if this object will update final rgba */
-			if(aa >= max_a)
-				r = rr,
-				g = gg,
-				b = bb,
-				a = aa,
-				max_a = aa;
-		}
-
-		/* change contrast, scale color */
-		r = r * m_contrast; if(r<0) r=0; else if(r>1) r=1;
-		g = g * m_contrast; if(g<0) g=0; else if(g>1) g=1;
-		b = b * m_contrast; if(b<0) b=0; else if(b>1) b=1;
-
-		/* change brithness, offset color */
-		r = r + m_brightness; if(r<0) r=0; else if(r>1) r=1;
-		g = g + m_brightness; if(g<0) g=0; else if(g>1) g=1;
-		b = b + m_brightness; if(b<0) b=0; else if(b>1) b=1;
-	}
-
-}} // namespace
diff -r 029d02120f84 src/ioavi.cpp
--- a/src/ioavi.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/ioavi.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -88,39 +88,44 @@
 	}
 
 
-	void AVI::getFrameSize(unsigned int &width, unsigned int &height)
+	bool AVI::getFrameSize(unsigned int &width, unsigned int &height)
 	{
 		// Check if file is opened
-		if(!m_fd) throw LOCATE(Error("file not opened"));
+		if(!m_fd) return false;
 
 		width  = m_header.width;
 		height = m_header.height;
+		return true;
 	}
 
 
-	void AVI::open(const char* filename)
+	bool AVI::open(const char* filename)
 	{
-		if(!filename) throw LOCATE(Error("no filename"));
+		if(!filename) return false;
 
 		// Open file
 		m_fd = fopen(filename, "rb");
-		if(!m_fd) throw LOCATE(Error("open"));
+		if(!m_fd) return false;
 
 		// Read header
 		readHeader();
+
+		return true;
 	}
 
 
-	void AVI::close()
+	bool AVI::close()
 	{
-		if(!m_fd) throw LOCATE(Error("nothing to close"));
+		if(!m_fd) return false;
 
 		// Close file
 		fclose(m_fd);
+
+		return true;
 	}
 
 
-	void AVI::readHeader()
+	bool AVI::readHeader()
 	{
 		size_t bread; /* read bytes */
 		char ident[4];
@@ -129,7 +134,7 @@
 		bool loop = true;
 
 		// Check if a file is opened
-		if(!m_fd) throw LOCATE(Error("nothing to read"));
+		if(!m_fd) return false;
 
 		/*******************
 		 * Read file header
@@ -137,44 +142,44 @@
 
 		/* (RIFF) (filesize) (AVI ) */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"RIFF",4)) throw LOCATE(Error("not a RIFF file (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"RIFF",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 		
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"AVI ",4)) throw LOCATE(Error("not an AVI file (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"AVI ",4)) return false;
 
 		/* (LIST) (header size) (hdrl) : header list */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"LIST",4)) throw LOCATE(Error("LIST expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"LIST",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);
 
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"hdrl",4)) throw LOCATE(Error("hdrl expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"hdrl",4)) return false;
 
 		/* (avih) (avi header size) (data) : avi header */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"avih",4)) throw LOCATE(Error("avih expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"avih",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
-		if(size != 56) throw LOCATE(Error("wrong header file"));
+		if(size != 56) return false;
 
 		/* avi header */
 		bread = fread(&m_header, size, 1, m_fd);
 
 		/* (LIST) (stream headers size) (strl) : list of stream headers */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"LIST",4)) throw LOCATE(Error("LIST expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"LIST",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"strl",4)) throw LOCATE(Error("strl expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"strl",4)) return false;
 
 		/* (strh) (stream header size) (data) : stream header */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"strh",4)) throw LOCATE(Error("strh expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"strh",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 
@@ -185,7 +190,7 @@
 
 		/* (strf) (stream format size) (data) : stream format */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"strf",4)) throw LOCATE(Error("strf expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"strf",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 
@@ -215,11 +220,11 @@
 			}
 			else if(!strncmp(ident,"indx",4) ||
 					!strncmp(ident,"idxl",4))
-				return; // need to read chunk index, but it is not necessary
+				return true; // need to read chunk index, but it is not necessary
 			else if(!strncmp(ident,"JUNK",4))
 				loop = false; // stop loop, read JUNK padding
 			else
-				throw LOCATE(Error("strn or strd expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+				return false;
 		}
 
 		// optional stream name or stream header read
@@ -228,28 +233,30 @@
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 
 		bread = fseek(m_fd, size, SEEK_CUR); /* jump padding */
-		if(bread) throw LOCATE(Error("jump padding"));
+		if(bread) return false;
 
 		/* (LIST) (data size) (movie) : list of chunks */
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"LIST",4)) throw LOCATE(Error("LIST expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"LIST",4)) return false;
 
 		bread = fread(&size, 4, 1, m_fd);	INTCPU(size);
 
 		bread = fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"movi",4)) throw LOCATE(Error("movi expected while reading (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+		if(strncmp(ident,"movi",4)) return false;
+
+		return true;
 	}
 
 
 	unsigned int AVI::getNbFrames()
 	{
-		if(!m_fd) throw LOCATE(Error("file not opened"));
+		if(!m_fd) return false;
 
 		return m_header.number_frames;
 	}
 
 
-	void AVI::read(color<unsigned char>* &image, unsigned int frame)
+	bool AVI::read(color<unsigned char>* &image, unsigned int frame)
 	{
 		char ident[4];
 		unsigned int size;
@@ -259,10 +266,10 @@
 		 *******************/
 		
 		// Check if file is opened
-		if(!m_fd) throw LOCATE(Error("file not opened"));
+		if(!m_fd) return false;
 		
 		// Check if the frame requested exist in file
-		if(frame<0 || frame>=m_header.number_frames) throw LOCATE(Error("frame out of bound")); // out of movie
+		if(frame<0 || frame>=m_header.number_frames) return false;
 		
 		// Go to the actual frame
 		unsigned long offset = 2048 + frame*(m_header.width*m_header.height*3+8);
@@ -270,39 +277,41 @@
 		
 		/* (00db) (frame size) */
 		fread(ident, 1, 4, m_fd);
-		if(strncmp(ident,"00db",4)) throw LOCATE(Error("wrong format"));
+		if(strncmp(ident,"00db",4)) return false;
 		
 		/* read frame size */
 		fread(&size, 4, 1, m_fd);	INTCPU(size);
 		
 		/* check if frame size is the same as image size */
-		if(size != m_header.width*m_header.height*3) throw LOCATE(Error("wrong frame size"));
+		if(size != m_header.width*m_header.height*3) return false;
 		
 		/* allocate memory for the image */
 		image = new color<unsigned char> [m_header.width * m_header.height];
 		
 		/* read this frame */
 		unsigned int n = (unsigned int)fread(image, 3, m_header.width*m_header.height, m_fd);
-		if(n != m_header.width*m_header.height) throw LOCATE(Error("EOF reached while reading"));
+		if(n != m_header.width*m_header.height) return false;
+
+		return true;
 	}
 
-	void AVI::read(color<unsigned char>* &image) // read whole movie
+	bool AVI::read(color<unsigned char>* &image) // read whole movie
 	{
-		read(image, 0, m_header.number_frames-1);
+		return read(image, 0, m_header.number_frames-1);
 	}
 
-	void AVI::read(color<unsigned char>* &image, unsigned int start, unsigned int end) // read part of the movie
+	bool AVI::read(color<unsigned char>* &image, unsigned int start, unsigned int end) // read part of the movie
 	{
 		char ident[4];
 		unsigned int size;
 		
 		// Check if file is opened
-		if(!m_fd) throw LOCATE(Error("file not opened"));
+		if(!m_fd) return false;
 		
 		// Check if the frame requested exist in file
-		if(start<0 || start>=m_header.number_frames) throw LOCATE(Error("start position out of bound")); // out of movie
-		if(end<0   || end>=m_header.number_frames)   throw LOCATE(Error("end position out of bound")); // out of movie
-		if(start>end) throw LOCATE(Error("start position is after end position")); // this may become a reverse reading
+		if(start<0 || start>=m_header.number_frames) return false;
+		if(end<0   || end>=m_header.number_frames)   return false;
+		if(start>end) return false;
 		
 		// Go to the actual frame
 		unsigned long offset = 2048 + start*(m_header.width*m_header.height*3+8);
@@ -322,18 +331,20 @@
 		{
 			/* (00db) (frame size) */
 			fread(ident, 1, 4, m_fd);
-			if(strncmp(ident,"00db",4)) throw LOCATE(Error("wrong format (%c%c%c%c)",ident[0],ident[1],ident[2],ident[3]));
+			if(strncmp(ident,"00db",4)) return false;
 			
 			/* read frame size */
 			fread(&size, 4, 1, m_fd);	INTCPU(size);
 			
 			/* check if frame size is the same as image size */
-			if(size != m_header.width*m_header.height*3) throw LOCATE(Error("wrong frame size"));
+			if(size != m_header.width*m_header.height*3) return false;
 			
 			/* read this frame */
 			unsigned int n = (unsigned int)fread(&image[t*m_header.width*m_header.height], 3, m_header.width*m_header.height, m_fd);
-			if(n != m_header.width*m_header.height) throw LOCATE(Error("EOF reached while reading"));
+			if(n != m_header.width*m_header.height) return false;
 		}
+
+		return true;
 	}
 
 
diff -r 029d02120f84 src/iobmp.cpp
--- a/src/iobmp.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/iobmp.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -50,35 +50,35 @@
 
 namespace IO
 {	
-	void readBMP(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height)
+	bool readBMP(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height)
 	{
-		BMP::read(filename, image, width, height);
+		return BMP::read(filename, image, width, height);
 	}
 		
 	
-	void writeBMP(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height)
+	bool writeBMP(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height)
 	{
-		BMP::write(filename, image, width, height);
+		return BMP::write(filename, image, width, height);
 	}
 	
 
 	// 2D Color read
-	void BMP::read(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height)
+	bool BMP::read(const char* filename, color<unsigned char>* &image, unsigned int &width, unsigned int &height)
 	{
 		FILE *fd;
 		unsigned int w, h;
 
 		/* open BMP file */
 		fd = fopen(filename, "rb");
-		if(!fd) throw LOCATE(Error("open"));
+		if(!fd) return false;
 
 		/* read header */
 		unsigned short signature = 0;
 		fread(&signature, 2, 1, fd);
 	#if APPLE
-		if(signature != 0x424d) throw LOCATE(Error("format"));
+		if(signature != 0x424d) return false;
 	#else
-		if(signature != 0x4d42) throw LOCATE(Error("format"));
+		if(signature != 0x4d42) return false;
 	#endif
 		fseek(fd, 18, SEEK_SET);
 		fread(&w, 4, 1, fd);		INTCPU(w);
@@ -98,7 +98,7 @@
 		for(unsigned int j=0; j<h; ++j)
 		{
 			unsigned int n = (unsigned int)fread((char*)&image[j*width], 3, width, fd);
-			if(n != width) throw LOCATE(Error("EOF reached while reading"));
+			if(n != width) return false;
 
 			if(padding != 0)
 			{
@@ -109,11 +109,13 @@
 
 		/* close BMP file */
 		fclose(fd);
+
+		return true;
 	}
 
 
 	// 2D color write
-	void BMP::write(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height)
+	bool BMP::write(const char* filename, const color<unsigned char>* image, unsigned int width, unsigned int height)
 	{
 		FILE *fd;
 		int header = 0;
@@ -121,7 +123,7 @@
 
 		/* open/create BMP file */
 		fd = fopen(filename, "wb");
-		if(!fd) throw LOCATE(Error("open"));
+		if(!fd) return false;
 
 		/* Write BMP header */
 		header = 0x84364d42;     INTCPU(header);
@@ -177,6 +179,8 @@
 
 		/* close BMP file */
 		fclose(fd);
+
+		return true;
 	}
 
 
diff -r 029d02120f84 src/pick.cpp
--- a/src/pick.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/pick.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -37,7 +37,7 @@
 #endif
 
 #include <tools/pick.h>
-#include <error.h>
+#include <libvdError.h>
 
 namespace Tools
 {
diff -r 029d02120f84 src/stereo.cpp
--- a/src/stereo.cpp	Thu Apr 04 13:59:59 2019 +0100
+++ b/src/stereo.cpp	Thu Apr 04 14:36:57 2019 +0100
@@ -82,7 +82,6 @@
 			 * to generate the stereo view */
 			glNewList(m_id, GL_COMPILE_AND_EXECUTE);
 			m_listcreated = true;
-			glCheckError();
 		}
 
 		/* render right eye */
@@ -98,7 +97,6 @@
 		glPopMatrix();
 		if(m_listcreated)
 			glEndList();
-		glCheckError();
 
 		/* render left eye on the red canal */
 		glColorMask(1,0,0,1);
