From 956d02af88db8d76262a30274bb4fecf47645c5f Mon Sep 17 00:00:00 2001
From: scuri
Each external format or processing usually needs a <im_xx.h> file and a "im_xx.lib/libim_xx.a/libim_xx.so" file.
-Even if your applicattion is only in C, you must link with a C++ capable linker. Using Tecmake set "LINKER := g++" +
Even if your application is only in C, you must link with a C++ capable linker. Using Tecmake set "LINKER := g++" in your "config.mak" when compiling with gcc (UNIX and Windows).
The download files list includes the Tecgraf/PUC-Rio Library Download Tips document, with a description of all the available binaries.
@@ -203,7 +203,7 @@ IM_FLOAT = GL_FLOATimConvertPacking(image->data[0], gl_data, image->width, image->height, image->depth, image->data_type, 0); glPixelStorei(GL_UNPACK_ALIGNMENT, 1); /* data alignment must be 1 */ -glDrawPixels(image->width, image->height, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)gl_data);+glDrawPixels(image->width, image->height, GL_RGB, GL_UNSIGNED_BYTE, gl_data);
When loading color image data you can use the function imConvertMapToRGB to convert in-place IM_MAP image data into IM_RGB after loading it from file. For example:
@@ -221,15 +221,25 @@ glDrawPixels(image->width, image->height, GL_RGB, GL_UNSIGNED_BYTE, (GLvoiIf you just want to save your OpenGL buffer then you can use:
glPixelStorei(GL_PACK_ALIGNMENT, 1); /* data alignment must be 1 */ -glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, (GLvoid*)gl_data); +glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, gl_data); ifile = imFileNew(filename, format, &error); error = imFileWriteImageInfo(ifile, width, height, IM_RGB|IM_PACKED, IM_BYTE); error = imFileWriteImageData(ifile, gl_data); imFileClose(ifile);-
You can also put glReadPixels and imFileWriteImageInfo/imFileWriteImageData - inside a loop to create an animation.
+And when using the imImage structure then you can + instead use the function imImageCreateFromOpenGLData. For + instance:
+ +glPixelStorei(GL_PACK_ALIGNMENT, 1); /* data alignment must be 1 */ +glReadPixels(x, y, width, height, GL_RGB, GL_UNSIGNED_BYTE, gl_data); + +imImage* image = imImageCreateFromOpenGLData(width, height, GL_RGB, gl_data); +error = imFileImageSave(filename, format, image);+ +
You can also do this + inside a loop to create an animation.
IM_GRAY usually means luma (nonlinear Luminance), but it can represent any other intensity value that is not necessarily related to color.
IM_BINARY is a subset of the IM_GRAY color space, and it has only 2 colors black and - white. Each value can be 0 or 1. But for pratical reasons we use one byte to store it.
+ white. Each value can be 0 or 1. But for practical reasons we use one byte to store it.The other color spaces are standard CIE color spaces, except CMYK that does not have a clear definition without other parameters to complement it.
@@ -117,7 +117,7 @@RGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGBRGB - for packed components 0 1 2 3-
In bold we visualy marked some lines of data.
+In bold we visually marked some lines of data.
This application uses IUP and OpenGL to create a window with two canvases and draw a video capture image into one canvas. A processed image can be displayed in the second canvas. It can also process frames from a video file. It is - very usefull for Computer Vision courses..
+ very useful for Computer Vision courses..You can download the source code and projects for Visual C++, Borland C++ Builder X and Dev-Cpp, here: iupglcap.zip You will need to download IUP, CD and IM libraries for the compiler you use
-- cgit v1.2.3