Merge commit '6c5f42416f065d2e7e0c4c8a8481f2219e212631' into library-updates

This commit is contained in:
Leon Styhre 2023-01-06 11:47:13 +01:00
commit 0856fd9244
26 changed files with 5925 additions and 3591 deletions

View file

@ -0,0 +1,37 @@
name: Build then test
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build-on-ubuntu:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
sudo apt-get install -y gcc g++ clang libpng-dev libjpeg-dev libmagick++-dev
sudo apt-get install -y libgraphicsmagick++-dev libfftw3-dev zlib1g-dev libheif-dev
- name: build
run: |
pushd examples
make clean
make mlinux
popd
build-on-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Install dependencies
run: |
brew install libheif libpng fftw libjpeg gcc zlib imagemagick automake openexr llvm
- name: build
run: |
pushd examples
make clean
make mmacos
popd

8654
external/CImg/CImg.h vendored

File diff suppressed because it is too large Load diff

View file

@ -1,9 +1,10 @@
<a href="http://cimg.eu">![Logo](http://cimg.eu/img/CImgLogo2.jpg)</a>
<a href="http://cimg.eu">![Logo](http://cimg.eu/img/logo_header.jpg)</a>
##### http://cimg.eu
------------------
The **CImg Library** is a **small** and **open-source** **C++ toolkit** for **image processing**, designed with these properties in mind:
![Build](https://github.com/GreycLab/CImg/workflows/Build%20then%20test/badge.svg)
------------------
The **CImg Library** is a **small** and **open-source** **C++ library** for **image processing**, designed with these properties in mind:
![Usefulness](http://cimg.eu/img/item_usefulness.jpg) **CImg** defines *classes* and *methods* to manage images in your own C++ code. You can use **CImg** to load/save various file formats, access pixel values, display/transform/filter images, draw primitives (text, faces, curves, 3d objects, ...), compute statistics, manage user interactions on images, and so on...
@ -11,7 +12,7 @@ The **CImg Library** is a **small** and **open-source** **C++ toolkit** for **im
![Portability](http://cimg.eu/img/item_portability.jpg) **CImg** is *self-contained*, *thread-safe* and *highly portable*. It fully works on *different operating systems* (`Unix,Windows,MacOS X,*BSD,...`) and is compatible with *various C++ compilers* (`Visual C++,g++,clang++,icc,...`).
![Simplicity](http://cimg.eu/img/item_simplicity.jpg) **CImg** is *lightweight*. It is made of a single header file [`CImg.h`](https://github.com/dtschump/CImg/raw/master/CImg.h) that must be included in your C++ source. It defines only *four* different classes, encapsulated in the namespace `cimg_library`. It can be compiled using a minimal set of standard C++ and system libraries only. *No need for exotic or complex dependencies*.
![Simplicity](http://cimg.eu/img/item_simplicity.jpg) **CImg** is *lightweight*. It is made of a single header file [`CImg.h`](https://github.com/GreycLab/CImg/raw/master/CImg.h) that must be included in your C++ source. It defines only *four* different classes, encapsulated in the namespace `cimg_library`. It can be compiled using a minimal set of standard C++ and system libraries only. *No need for exotic or complex dependencies*.
![Extensibility](http://cimg.eu/img/item_extensibility.jpg) Although not mandatory, **CImg** can use functionalities of external tools/libraries such as [Board](http://libboard.sourceforge.net/), [FFMPEG](http://ffmpeg.mplayerhq.hu/), [FFTW3](http://www.fftw.org/), [GraphicsMagick](http://www.graphicsmagick.org/), [ImageMagick](http://www.imagemagick.org/), [Lapack](http://www.netlib.org/lapack/), [libcurl](http://curl.haxx.se/libcurl/), [libjpeg](http://www.ijg.org/), [libpng](http://www.libpng.org/pub/png/libpng.html), [libtiff](http://www.libtiff.org/), [Magick++](http://www.imagemagick.org/Magick++/), [OpenEXR](http://www.openexr.com/), [OpenCV](http://http://opencv.willowgarage.com/wiki/), [OpenMP](http://www.openmp.org/) or [XMedCon](http://xmedcon.sourceforge.net/). Moreover, a simple *plug-in* mechanism allows any user to directly enhance the library capabilities according to their needs.

View file

@ -106,6 +106,9 @@ SET(CIMG_MAGICK_CCFLAGS -Dcimg_use_magick)
# ( http://www.fftw.org/ )
SET(CIMG_FFTW3_CCFLAGS -Dcimg_use_fftw3)
# Flags to enable native support for HEIC image files, using libheif.
# ( https://github.com/strukturag/libheif )
SET(CIMG_HEIC_CCFLAGS -Dcimg_use_heic)
@ -118,6 +121,22 @@ FIND_PACKAGE(ZLIB)
FIND_PACKAGE(LAPACK)
FIND_PACKAGE(BLAS)
if(PKG_CONFIG_FOUND)
pkg_check_modules(PC_HEIF libheif QUIET)
endif()
find_path(HEIF_INCLUDE_DIR NAMES libheif/heif_cxx.h
PATHS ${PC_HEIF_INCLUDEDIR})
find_library(HEIF_LIBRARY NAMES heif libheif
PATHS ${PC_HEIF_LIBDIR})
set(HEIF_VERSION ${PC_HEIF_VERSION})
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HEIF
REQUIRED_VARS HEIF_LIBRARY HEIF_INCLUDE_DIR
VERSION_VAR HEIF_VERSION)
PKG_CHECK_MODULES(FFTW3 fftw3)
PKG_CHECK_MODULES(OPENEXR OpenEXR)
PKG_CHECK_MODULES(MAGICK Magick++)
@ -200,7 +219,13 @@ if(MAGICK_FOUND)
SET( SYSTEM_LIBS ${SYSTEM_LIBS} ${MAGICK_LIBRARIES} )
endif()
if(HEIF_FOUND)
get_filename_component(HEIF_LIB_DIRS ${HEIF_LIBRARY} PATH)
SET(CIMG_CFLAGS "${CIMG_CFLAGS} ${CIMG_HEIC_CCFLAGS}")
link_directories( ${HEIF_LIB_DIRS} )
include_directories( ${HEIF_INCLUDE_DIRS} )
SET( SYSTEM_LIBS ${SYSTEM_LIBS} ${HEIF_LIBRARY} )
endif()
if( LIBAVCODEC_FOUND AND LIBAVFORMAT_FOUND AND LIBSWSCALE_FOUND AND LIBAVUTIL_FOUND )

View file

@ -153,7 +153,11 @@ VT100_CFLAGS = -Dcimg_use_vt100
# Flags to enable code optimization by the compiler.
OPT_CFLAGS = -Ofast
ifdef IS_GCC
OPT_CFLAGS = -Ofast -mtune=generic
# Add -mtune=generic for GCC if supported.
NO_MTUNE_GENERIC = $(shell $(CXX) -mtune=generic -E - < /dev/null > /dev/null 2>&1; echo $$?)
ifeq ($(NO_MTUNE_GENERIC),0)
OPT_CFLAGS += -mtune=generic
endif
endif
ifdef IS_ICPC
OPT_CFLAGS = -fast

View file

@ -99,6 +99,7 @@ int main(int argc, char **argv) {
CImg<unsigned char> board, previous_board, selected_board, shape, img(background);
CImgDisplay disp(img.width(),img.height(),"Jawbreaker",0);
bool redraw = true, gameover = false, title = true;
for (float opac = 0.0f; !disp.is_closed(); ) {
// Init board
@ -113,10 +114,12 @@ int main(int argc, char **argv) {
if (redraw) {
(img=background).draw_text(2,2,"Score : %u",yellow,0,0.7f,24,score).
draw_text(Wi - 90,2,"Best : %u",orange,0,0.9f,17,best_score);
if (selected_board) {
cimg_forXY(selected_board,x,y) if (selected_board(x,y))
img.draw_image(x<<5,y<<5,balls[selected_board(x,y)],mask);
} else cimg_forXY(board,x,y) if (board(x,y)) img.draw_image(x<<5,y<<5,balls[board(x,y)],mask);
if (title) {
CImg<unsigned char> text1, text2;
text1.draw_text(0,0,"- Jawbreaker -",white,0,1,48).resize(-100,-100,1,3);

View file

@ -136,7 +136,7 @@
The CImg library is a very light and user-friendly library : only standard system libraries are used.
It avoids handling complex dependencies and problems with library compatibility.
The only thing you need is a (quite modern) C++ compiler :
The only thing you need is a C++ compiler :
- <b>Microsoft Visual Studio.NET and Visual Express Edition</b> : Use the project files and solution files provided in the
%CImg Library package (directory 'compilation/') to see how it works.
@ -163,7 +163,7 @@
- <b>Dev-Cpp</b> : Use the project file provided in the CImg library package to see how it works.
If you are using other compilers and encounter problems, please
<a href="https://github.com/dtschump/CImg/issues">write me</a> since maintaining compatibility is one
<a href="https://github.com/GreycLab/CImg/issues">write me</a> since maintaining compatibility is one
of the priorities of the %CImg Library. Nevertheless, old compilers that do not respect the C++ standard will not
support the %CImg Library.
@ -208,10 +208,10 @@
\subsection ssf11 1.1. What is the CImg Library ?
The CImg Library is an <i>open-source C++ toolkit for image processing</i>.\n
The CImg Library is an <i>open-source C++ library for image processing</i>.\n
It mainly consists in a (big) single header file
<a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a>
<a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a>
providing a set of C++ classes and functions that can be used in your own sources,
to load/save, manage/process and display generic images.
It's actually a very simple and pleasant toolkit for coding image processing stuff in C++ :
@ -237,10 +237,10 @@
The package is distributed under the <a href="http://www.cecill.info">CeCILL license</a>.
This package contains :
- The main library file <a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a> (C++ header file).
- Several C++ source code showing <a href="https://github.com/dtschump/CImg/tree/master/examples">examples of using CImg</a>.
- The main library file <a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a> (C++ header file).
- Several C++ source code showing <a href="https://github.com/GreycLab/CImg/tree/master/examples">examples of using CImg</a>.
- A complete library documentation, in <a href="../CImg_reference.pdf">PDF</a> format.
- Additional <a href="https://github.com/dtschump/CImg/tree/master/plugins">library plug-ins</a> that can be used to extend
- Additional <a href="https://github.com/GreycLab/CImg/tree/master/plugins">library plug-ins</a> that can be used to extend
library capabilities for specific uses.
The CImg Library is a quite lightweight library which is easy to maintain (due to its particular structure), and thus
@ -266,10 +266,10 @@
corresponding to different constraints on the source files :
- The <a href="http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html">CeCILL-C</a> license is the most permissive one, close to
the <i>GNU LGPL license</i>, and <i>applies <b>only</b> on the main library file
<a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a></i>.
Basically, this license allows to use <a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a>
<a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a></i>.
Basically, this license allows to use <a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a>
in a closed-source product without forcing you to redistribute the entire software source code. Anyway,
if one modifies the <a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a> source file, one has to redistribute
if one modifies the <a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a> source file, one has to redistribute
the modified version of the file that must be governed by the same <a href="http://www.cecill.info/licences/Licence_CeCILL-C_V1-en.html">CeCILL-C</a> license.
- The <a href="http://www.cecill.info/licences/Licence_CeCILL_V2-en.html">CeCILL</a> license applies to all other files
@ -314,7 +314,7 @@
\subsection ssf23 2.3 Why is CImg entirely contained in a single header file ?
People are often surprised to see that the complete code of the library is contained in a single (big) C++ header file
<a href="https://github.com/dtschump/CImg/raw/master/CImg.h">CImg.h</a>.
<a href="https://github.com/GreycLab/CImg/raw/master/CImg.h">CImg.h</a>.
There are good practical and technical reasons to do that. Some arguments are listed below to justify this approach,
so (I hope) you won't think this is a awkwardly C++ design of the CImg library :\n

View file

@ -40,7 +40,7 @@
It contains all the required files, as well as various examples (which must be compiled),
illustrating the use of the library functions and classes.<br/>
</td></tr>
<tr><td><a href="https://github.com/dtschump/CImg">
<tr><td><a href="https://github.com/GreycLab/CImg">
<img src="img/item_sources.jpg" alt="Sources Repository"
onmouseover="this.src='img/item_sources2.jpg';"
onmouseout="this.src='img/item_sources.jpg';" /></a></td>
@ -50,7 +50,7 @@
updates as well. To do this, just
type the command :
<div class="gmd_code">
<a href="https://github.com/dtschump/CImg">git clone --depth=1 https://github.com/dtschump/CImg.git</a>
<a href="https://github.com/GreycLab/CImg">git clone --depth=1 https://github.com/GreycLab/CImg.git</a>
</div>
in your favorite console. Nevertheless, you have to know that some code in the source repository
is under development and may be experimental, so always test the latest stable archive before complaining !

View file

@ -23,7 +23,7 @@
<div class="header">
<a href="index.html"><img alt="Logo" src="img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_2.9.6.zip">2.9.6</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">2.9.7</a></b>
Latest stable version: <b><a href="http://cimg.eu/files/CImg_3.1.6.zip">3.1.6</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.2.0</a></b>
</h2>
<hr/>
@ -49,7 +49,7 @@
<li><a href='reference/'><span>
<img alt="Documentation" src='img/menu_reference.png' />&nbsp;&nbsp;
Documentation</span></a></li>
<li><a href='https://github.com/dtschump/CImg/issues'><span>
<li><a href='https://github.com/GreycLab/CImg/issues'><span>
<img alt="Report Issue" src='img/menu_issue.png' />&nbsp;&nbsp;
Report Issue</span></a>
<li><a href='links.html'><span>

View file

@ -26,7 +26,7 @@
<div class="header">
<a href="../index.html"><img alt="Logo" src="../img/logo_header.jpg" class="center_image" style="margin-top:1em;"/></a>
<h2 style="padding-bottom: 1em">
Latest stable version: <b><a href="http://cimg.eu/files/CImg_2.9.6.zip">2.9.6</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">2.9.7</a></b>
Latest stable version: <b><a href="http://cimg.eu/files/CImg_3.1.6.zip">3.1.6</a></b> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Current pre-release: <b><a href="http://cimg.eu/files/CImg_latest.zip">3.2.0</a></b>
</h2>
<hr/>
@ -52,7 +52,7 @@
<li><a href='../reference/'><span>
<img alt="Documentation" src='../img/menu_reference.png' />&nbsp;&nbsp;
Documentation</span></a></li>
<li><a href='https://github.com/dtschump/CImg/issues'><span>
<li><a href='https://github.com/GreycLab/CImg/issues'><span>
<img alt="Report Issue" src='../img/menu_issue.png' />&nbsp;&nbsp;
Report Issue</span></a>
<li><a href='../links.html'><span>

BIN
external/CImg/html/img/logoCImg0.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

After

Width:  |  Height:  |  Size: 44 KiB

BIN
external/CImg/html/img/logo_header.xcf vendored Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

BIN
external/CImg/html/img/postcard75.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 KiB

BIN
external/CImg/html/img/postcard76.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 213 KiB

BIN
external/CImg/html/img/postcard77.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

BIN
external/CImg/html/img/postcard78.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 80 KiB

BIN
external/CImg/html/img/postcard79.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

BIN
external/CImg/html/img/postcard80.jpg vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

View file

@ -4,7 +4,7 @@
<meta charset="utf-8">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="highslide/highslide.css"/>
<title>The CImg Library - C++ Template Image Processing Toolkit</title>
<title>The CImg Library - C++ Template Image Processing Library</title>
<script src="jquery-3.5.1.min.js"></script>
<script>var jQuery_3_5_1 = $.noConflict(true);</script>
<script>jQuery_3_5_1(function(){ jQuery_3_5_1("#include_header").load("header.html"); });</script>
@ -30,7 +30,7 @@
<p>
The <span class="gmd_cimg"></span> Library is a <b>small</b> and <b>open-source</b>
<b>C++ toolkit</b> for <b>image processing</b>,
<b>C++ library</b> for <b>image processing</b>,
designed with these properties in mind :
</p>
@ -59,7 +59,7 @@
<tr><td><img src="img/item_simplicity.jpg" alt="Simplicity"/></td>
<td><hr/>
<span class="gmd_cimg"></span> is <i>lightweight</i>. It is made of a single header file
<a href="https://github.com/dtschump/CImg/raw/master/CImg.h"><span class="gmd_monobold">CImg.h</span></a>
<a href="https://github.com/GreycLab/CImg/raw/master/CImg.h"><span class="gmd_monobold">CImg.h</span></a>
that must be included in your C++ source. It defines only <i>four</i> different classes, encapsulated
in the namespace <span class="gmd_mono">cimg_library</span>.
It can be compiled using a minimal set of standard C++ and system libraries only.<br/>
@ -291,7 +291,7 @@
<a href="CImg_flyer.pdf">CImg Flyer</a> at work, in your lab or school
(available in <a href="CImg_flyer.pdf">.PDF</a> or <a href="img/CImg_flyer.jpg">.JPEG</a> formats).</li>
<li>You can report bugs, propose patches or new functionalities, using the <span class="gmd_cimg"></span>
<a href="https://github.com/dtschump/CImg/issues">forum</a>.</li>
<a href="https://github.com/GreycLab/CImg/issues">forum</a>.</li>
<li>You can write
<a href="reference/group__cimg__tutorial.html">tutorials</a>
or parts of the <a href="reference/index.html">documentation</a>.</li>
@ -437,13 +437,28 @@
<li><a href="img/postcard69.jpg" class="highslide" onclick="return hs.expand(this)">
Pregonda / Menorca, from Josep Febrer.</a></li>
<li><a href="img/postcard70.jpg" class="highslide" onclick="return hs.expand(this)">
USA, from Patrick Wanters.</a></li>
USA, from Patrick Wauters.</a></li>
<li><a href="img/postcard71.jpg" class="highslide" onclick="return hs.expand(this)">
Toulon/France, from Cyril Prissette.</a></li>
<li><a href="img/postcard72.jpg" class="highslide" onclick="return hs.expand(this)">
Bochum/Germany, from Andreas Weissenburger.</a></li>
<li><a href="img/postcard73.jpg" class="highslide" onclick="return hs.expand(this)">
Portsmouth/USA, from Benjamin Russell.</a></li>
<li><a href="img/postcard74.jpg" class="highslide" onclick="return hs.expand(this)">
Angers/France, from Bruno Bianchi.</a></li>
<li><a href="img/postcard75.jpg" class="highslide" onclick="return hs.expand(this)">
Makuhari/Japan, from Hiroyuki Hayashi.</a></li>
<li><a href="img/postcard76.jpg" class="highslide" onclick="return hs.expand(this)">
Tristan Da Cunha, from Richard Lockwood.</a></li>
<li><a href="img/postcard77.jpg" class="highslide" onclick="return hs.expand(this)">
Tyrol/Austria, from Marcel.</a></li>
<li><a href="img/postcard78.jpg" class="highslide" onclick="return hs.expand(this)">
Heidelberg/Germany, from Markus.</a></li>
<li><a href="img/postcard79.jpg" class="highslide" onclick="return hs.expand(this)">
Jokulsarlon Lagoonl/Iceland, from Patrick Wauters.</a></li>
<li><a href="img/postcard80.jpg" class="highslide" onclick="return hs.expand(this)">
Argentina, from Amyspark.</a></li>
</ul></li>
</ul>

View file

@ -50,7 +50,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>The main demo sample of the <span class="gmd_cimg"></span> package</b> (1433 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
Contains 26 different real-time animations, as well as a nice selection menu.
</p>
@ -70,7 +70,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A 2d bump-mapping effect</b> (30 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>You can move the light source using the mouse.
This sample shows how to handle mouse motion and create an animation in a window.
It demonstrates also that the <span class="gmd_cimg"></span> Library is quite fast !
@ -92,7 +92,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>Computation of the Hough Transform</b> (95 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/hough_transform2d.cpp"><span class="gmd_monobold">hough_transform.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/hough_transform2d.cpp"><span class="gmd_monobold">hough_transform.cpp</span></a>
<p>
Illustrate the computation of the Hough transform to detect lines in 2D images. Provide also simple user
interface to select and display lines.
@ -108,7 +108,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>Do a fading between two images</b> (35 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/fade_images.cpp"><span class="gmd_monobold">fade_images.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/fade_images.cpp"><span class="gmd_monobold">fade_images.cpp</span></a>
<p>
Very small code to perform a funny effect. Also demonstrate how to easily deal with command line arguments.
</p>
@ -123,7 +123,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A functional Mandelbrot fractal explorer</b> (51 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
Show how to use the predefined feature selection function present in the <span class="gmd_cimg"></span> Library.
</p>
@ -141,7 +141,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A simple shoot-em-up game, featuring the people of the Robotvis/Odyssee Lab</b> (180 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/odykill.cpp"><span class="gmd_monobold">odykill.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/odykill.cpp"><span class="gmd_monobold">odykill.cpp</span></a>
<p>
Another demonstration of handling mouse and creating animation for pedagogic purposes.
</p>
@ -157,7 +157,7 @@
<b>An implementation of an image registration algorithm, with
multiscale capability</b> (201 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/image_registration.cpp"><span class="gmd_monobold">image_registration.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/image_registration.cpp"><span class="gmd_monobold">image_registration.cpp</span></a>
<p>
Compute a motion map between two images, and warp one into the another through a smooth animation.
</p>
@ -172,7 +172,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A mini-painting program</b> (30 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
This is not a replacement to Photoshop, but it already includes a filling algorithm
as well as a color selection tool.
@ -191,7 +191,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A classical demomaking-effect, called 'rotozoom'</b> (20 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
Smell the old school parfume of the atari/amiga demos.
</p>
@ -206,7 +206,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>An animation featuring triangles that are rotating</b> (50 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
Could be a replacement to your classical screen saver.
</p>
@ -221,7 +221,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A demo of image filtering in the Fourier Domain</b> (30 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=op0XoVMEdpE" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -237,7 +237,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>An example of real-time 3D rendering</b>.<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
No use of OpenGL or VTK in this example, only pure <span class="gmd_cimg"></span> software functions are used !
</p>
@ -255,7 +255,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>An example of the ellipse drawing function, used to bounce an elastic bubble</b> (25 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=oXK6Wc4vsbE" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -271,7 +271,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A real-time 3D virtual landscape</b> (40 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<p>
The altitude map is based on a 'fractal plasma' generator.
</p>
@ -289,7 +289,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A nice plasma effect with a sinus scroller</b> (70 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=na8hcayKbFo" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -305,7 +305,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>An implementation of the well known Tetris game</b> (130 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/tetris.cpp"><span class="gmd_monobold">tetris.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/tetris.cpp"><span class="gmd_monobold">tetris.cpp</span></a>
<p>
Very small code for a complete version of the Tetris game.
</p>
@ -323,7 +323,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>The implementation of the Tschumperlé-Deriche algorithm for image restoration and inpainting</b> (170 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/pde_TschumperleDeriche2d.cpp"><span class="gmd_monobold">pde_TschumperleDeriche2d.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/pde_TschumperleDeriche2d.cpp"><span class="gmd_monobold">pde_TschumperleDeriche2d.cpp</span></a>
<p>
See <a href="ftp://ftp-sop.inria.fr/odyssee/Publications/2003/tschumperle-deriche:03.pdf">the corresponding publication</a>
for more detail on the algorithm.
@ -339,7 +339,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A very smart and classical demo effect called 'Shade bobs'</b> (60 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=q91cyn6x8LY" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -355,7 +355,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A nice Blob Editor in only few lines</b> (90 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=wOCdcFfz7Z4" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -371,7 +371,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>3d Metaballs animation</b> (23 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=-S_r76OxzyY" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -387,7 +387,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A tool to visualize images as surfaces in 3d</b> (100 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/image_surface.cpp"><span class="gmd_monobold">image_surface.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/image_surface.cpp"><span class="gmd_monobold">image_surface.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=OlBXh-gkv3U" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -403,7 +403,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A 3d viewer for Diffusion tensor imaging datasets</b> (526 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/dtmri_view.cpp"><span class="gmd_monobold">dtmri_view.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/dtmri_view.cpp"><span class="gmd_monobold">dtmri_view.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=ip2itUXhcls" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -419,7 +419,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>Applying the wave equation on an 3d image-mapped surface</b> (55 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=KNe-rXJldDM" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -435,7 +435,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A simple 2d curve editor using spline interpolation</b> (300 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/curve_editor.cpp"><span class="gmd_monobold">curve_editor.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/curve_editor.cpp"><span class="gmd_monobold">curve_editor.cpp</span></a>
</td>
</tr></table>
@ -447,7 +447,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A complete and funny game featuring colored balls</b> (121 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/jawbreaker.cpp"><span class="gmd_monobold">jawbreaker.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/jawbreaker.cpp"><span class="gmd_monobold">jawbreaker.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=3z4jdb-wafs" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -463,7 +463,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A cool 3d reflection effect, using some <span class="gmd_cimg"></span> 3d object rendering tricks</b> (130 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<br/>
<a href="https://www.youtube.com/watch?v=5wQgkEjdrcw" target="_blank">
<img src="img/item_clickvideo.jpg" alt="Click here to see the video" onmouseover="this.src='img/item_clickvideo2.jpg';" onmouseout="this.src='img/item_clickvideo.jpg';"/></a>
@ -479,7 +479,7 @@
<img alt="" src="img/item_description.jpg"/> :
<b>A simple word puzzle game</b> (100 lines of code).<br/>
<img alt="" src="img/item_file.jpg"/> :
<a href="https://github.com/dtschump/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
<a href="https://github.com/GreycLab/CImg/blob/master/examples/CImg_demo.cpp"><span class="gmd_monobold">CImg_demo.cpp</span></a>
</td>
</tr></table>

View file

@ -7,23 +7,16 @@
# conversions for generic image types
# ( IPL = Intel Performance Library )
# This file is a part of the CImg Library project.
# ( http://cimg.eu )
# ( http://cimg.sourceforge.net )
#
# Copyright : Alberto Albiol
# alalbiol@iteam.upv.es
#
# How to use : In the main program include:
# OPENCV 2.4.x
# #include "cv.h"
# #include "highgui.h"
# #define cimg_plugin1 "cvMat.h"
# #include "CImg.h"
#
# OPENCV 3.x.x
# #include <opencv2/core.hpp>
# #define cimg_plugin1 "cvMat.h"
# #include "CImg.h"
*/
#ifndef cimg_plugin_cvMat
#define cimg_plugin_cvMat
@ -37,14 +30,14 @@ CImg(const cv::Mat& src):_width(0),_height(0),_depth(0),_spectrum(0),_is_shared(
CImg<T>& assign(const cv::Mat & src) {
if (src.isContinuous()) {
switch (src.depth()) {
// case CV_1U: { // 1-bit int
// case CV_1U: { // 1-bit int.
// IplImage *src1 = cvCreateImage(cvGetSize(src),CV_8U,1);
// cvConvert(src,src1);
// CImg<ucharT>((unsigned char*)src1->imageData,src1->nChannels,src1.cols,src1.rows,1,true).
// get_permute_axes("yzcx").move_to(*this);
// cvReleaseImage(&src1);
// } break;
case CV_8U: // 8-bit unsigned int
case CV_8U: // 8-bit unsigned int.
if (src.channels()==1) {
CImg<ucharT>((unsigned char*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -61,7 +54,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_8S: // 8-bit signed int
case CV_8S: // 8-bit signed int.
if (src.channels()==1) {
CImg<charT>((char*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -78,7 +71,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_16U: // 16-bit unsigned int
case CV_16U: // 16-bit unsigned int.
if (src.channels()==1) {
CImg<ushortT>((unsigned short*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -95,7 +88,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_16S: // 16-bit signed int
case CV_16S: // 16-bit signed int.
if (src.channels()==1) {
CImg<shortT>((short*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -112,7 +105,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_32S: // 32-bit signed int
case CV_32S: // 32-bit signed int.
if (src.channels()==1) {
CImg<intT>((int*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -129,7 +122,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_32F: // 32-bit float
case CV_32F: // 32-bit float.
if (src.channels()==1) {
CImg<floatT>((float*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -146,7 +139,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_64F: // 64-bit double
case CV_64F: // 64-bit double.
if (src.channels()==1) {
CImg<doubleT>((double*)src.ptr(),src.cols,src.rows,true).move_to(*this);
} else {
@ -172,7 +165,7 @@ CImg<T>& assign(const cv::Mat & src) {
} else {
cv::Size size = src.size();
switch (src.depth()) {
case CV_8U: // 8-bit unsigned int
case CV_8U: // 8-bit unsigned int.
if (src.channels()==1) {
CImg<ucharT> tmp(src.cols,src.rows);
for (int i = 0; i<size.height; ++i) {
@ -186,7 +179,7 @@ CImg<T>& assign(const cv::Mat & src) {
std::vector<cv::Mat> channels;
cv::split(src,channels);
for (int c = 0; c<src.channels(); ++c) {
CImg<ucharT> plane = tmp.get_shared_channel(src.channels() - 1 - c);
CImg<ucharT> plane = tmp.get_shared_channel(src.channels()-1-c);
for (int i = 0; i<size.height; ++i) {
const unsigned char* row_i = channels[c].ptr<unsigned char>(i);
unsigned char *row_o = plane.data(0,i);
@ -196,7 +189,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_8S: // 8-bit int
case CV_8S: // 8-bit int.
if (src.channels()==1) {
CImg<charT> tmp(src.cols,src.rows);
for (int i = 0; i<size.height; ++i) {
@ -210,7 +203,7 @@ CImg<T>& assign(const cv::Mat & src) {
std::vector<cv::Mat> channels;
cv::split(src,channels);
for (int c = 0; c<src.channels(); ++c) {
CImg<charT> plane = tmp.get_shared_channel(src.channels() - 1 - c);
CImg<charT> plane = tmp.get_shared_channel(src.channels()-1-c);
for (int i = 0; i<size.height; ++i) {
const char* row_i = channels[c].ptr<char>(i);
char *row_o = plane.data(0,i);
@ -220,7 +213,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_16S: // 16-bit int
case CV_16S: // 16-bit int.
if (src.channels()==1) {
CImg<shortT> tmp(src.cols,src.rows);
for (int i = 0; i<size.height; ++i) {
@ -234,7 +227,7 @@ CImg<T>& assign(const cv::Mat & src) {
std::vector<cv::Mat> channels;
cv::split(src,channels);
for (int c = 0; c<src.channels(); ++c) {
CImg<shortT> plane = tmp.get_shared_channel(src.channels() - 1 - c);
CImg<shortT> plane = tmp.get_shared_channel(src.channels()-1-c);
for (int i = 0; i<size.height; ++i) {
const short* row_i = channels[c].ptr<short>(i);
short *row_o = plane.data(0,i);
@ -244,7 +237,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_32F: // 32-bit float
case CV_32F: // 32-bit float.float
if (src.channels()==1) {
CImg<floatT> tmp(src.cols,src.rows);
for (int i = 0; i<size.height; ++i) {
@ -258,7 +251,7 @@ CImg<T>& assign(const cv::Mat & src) {
std::vector<cv::Mat> channels;
cv::split(src,channels);
for (int c = 0; c<src.channels(); ++c) {
CImg<floatT> plane = tmp.get_shared_channel(src.channels() - 1 - c);
CImg<floatT> plane = tmp.get_shared_channel(src.channels()-1-c);
for (int i = 0; i<size.height; ++i) {
const float* row_i = channels[c].ptr<float>(i);
float *row_o = plane.data(0,i);
@ -268,7 +261,7 @@ CImg<T>& assign(const cv::Mat & src) {
tmp.move_to(*this);
}
break;
case CV_64F: // 64-bit double
case CV_64F: // 64-bit double.
if (src.channels()==1) {
CImg<doubleT> tmp(src.cols,src.rows);
for (int i = 0; i<size.height; ++i) {
@ -282,7 +275,7 @@ CImg<T>& assign(const cv::Mat & src) {
std::vector<cv::Mat> channels;
cv::split(src,channels);
for (int c = 0; c<src.channels(); ++c) {
CImg<doubleT> plane = tmp.get_shared_channel(src.channels() - 1 - c);
CImg<doubleT> plane = tmp.get_shared_channel(src.channels()-1-c);
for (int i = 0; i<size.height; ++i) {
const double* row_i = channels[c].ptr<double>(i);
double *row_o = plane.data(0,i);
@ -326,12 +319,19 @@ cv::Mat get_MAT(const unsigned int z=0) const {
matType=-1;
if (!cimg::strcasecmp(buf.pixel_type(),"unsigned char")) matType = CV_8UC1;
if (!cimg::strcasecmp(buf.pixel_type(),"uint8")) matType = CV_8UC1;
if (!cimg::strcasecmp(buf.pixel_type(),"char")) matType = CV_8SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"int8")) matType = CV_8SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"unsigned short")) matType = CV_16UC1;
if (!cimg::strcasecmp(buf.pixel_type(),"uint16")) matType = CV_16UC1;
if (!cimg::strcasecmp(buf.pixel_type(),"short")) matType = CV_16SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"int16")) matType = CV_16SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"int")) matType = CV_32SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"int32")) matType = CV_32SC1;
if (!cimg::strcasecmp(buf.pixel_type(),"float")) matType = CV_32FC1;
if (!cimg::strcasecmp(buf.pixel_type(),"float32")) matType = CV_32FC1;
if (!cimg::strcasecmp(buf.pixel_type(),"double")) matType = CV_64FC1;
if (!cimg::strcasecmp(buf.pixel_type(),"float64")) matType = CV_64FC1;
if (matType<0)
throw CImgInstanceException(_cimg_instance
"get_MAT() : pixel type '%s' is not supported.",
@ -340,7 +340,7 @@ cv::Mat get_MAT(const unsigned int z=0) const {
std::vector<cv::Mat> channels(nchannels);
if (nchannels>1) {
for (int c = 0; c<nchannels; ++c) {
channels[c] = cv::Mat(rows,cols,matType,const_cast<T*>(buf.data() + rows*cols*(nchannels - 1 - c)));
channels[c] = cv::Mat(rows,cols,matType,const_cast<T*>(buf.data()+rows*cols*(nchannels-1-c)));
} // for channels
cv::merge(channels,out);
} else out = cv::Mat(rows,cols,matType,const_cast<T*>(buf.data())).clone();

View file

@ -159,7 +159,7 @@ CImg<T>& load_tiff(std::istream* tiffInStream,
TIFFSetDirectory(tif,0);
CImg<T> frame;
for (unsigned int l = nfirst_frame; l<=nlast_frame; l+=nstep_frame) {
frame._load_tiff(tif,l,0,0);
frame._load_tiff(tif,l,0,0,0);
if (l==nfirst_frame)
assign(frame._width,frame._height,1 + (nlast_frame - nfirst_frame)/nstep_frame,frame._spectrum);
if (frame._width>_width || frame._height>_height || frame._spectrum>_spectrum)

View file

@ -141,7 +141,7 @@ echo -e "\n** Log generated by 'doxygen' **\n\n">>$LOG_FILE
echo " - Build reference documentation in PDF format."
cd $SRC_DIR/html/latex
gmic it structcimg__library_1_1CImg.tex replace_str \"operator%\",\"operator\\\\%\" ot structcimg__library_1_1CImg.tex
# gmic it structcimg__library_1_1CImg.tex replace_str \"operator%\",\"operator\\\\%\" ot structcimg__library_1_1CImg.tex
echo -e "\n** Log generated by 'latex' **\n\n">>$LOG_FILE
make>>$LOG_FILE 2>&1
cp -f refman.pdf ../CImg_reference.pdf
@ -152,6 +152,8 @@ rm -rf ../latex
echo " - Commit on GIT repository."
cd $SRC_DIR
if [ "$1" == "final" ]; then
git push --delete origin v.$SVERSION
git pull
git tag -d v.$SVERSION
git tag v.$SVERSION
git commit -m "Final release "${SVERSION} >>$LOG_FILE 2>&1
@ -175,12 +177,12 @@ mv $ZIP_FILE $BASE_DIR
# Copy files to CImg server.
cd $BASE_DIR
if [ "$1" == "final" ]; then
lftp ftp://$GMIC_LOGIN:$GMIC_PASSWD@$GMIC_FTP -e "put -O /www/CImg/files/ ${ZIP_FILE}; quit";
lftp sftp://$GMIC_LOGIN:@ovh -e "put -O /home/"$GMIC_LOGIN"/www/CImg/files/ ${ZIP_FILE}; quit";
fi
lftp ftp://$GMIC_LOGIN:$GMIC_PASSWD@$GMIC_FTP -e "put -O /www/CImg/files/ ${ZIP_FILE} -o CImg_latest.zip; quit"
lftp sftp://$GMIC_LOGIN:@ovh -e "put -O /home/"$GMIC_LOGIN"/www/CImg/files/ ${ZIP_FILE} -o CImg_latest.zip; quit"
cd $SRC_DIR/html/
lftp ftp://$GMIC_LOGIN:$GMIC_PASSWD@$GMIC_FTP -e "mirror -RL . /www/CImg/ ; quit"
lftp sftp://$GMIC_LOGIN:@ovh -e "mirror -RL . /home/"$GMIC_LOGIN"/www/CImg/ ; quit"
# End of build script
echo -e " - All done, you should look at the LOG file '$LOG_FILE'.\n"

View file

@ -1,4 +1,4 @@
#!/usr/bin/gmic
#!/usr/bin/env gmic
skip "${1=}"
@ -19,21 +19,22 @@ pwd={`"
# Upload file or directory.
if "s = ['$1']; "$is_pwd" && (s==0 || s=='.')" # Synchronize current directory
e[] "Synchronize current directory '"${pwd}"' with 'SERVER"${pwd}"'.\n"
com="lftp ftp://"$GMIC_LOGIN":"$GMIC_PASSWD"@"$GMIC_FTP" -e \"mirror -RL . /www/CImg"${pwd}" ; quit\""
com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL . /home/"$GMIC_LOGIN"/www/CImg"${pwd}" ; quit\""
x $com
elif $is_pwd" && isdir(['"$1"'])" # Synchronize specified directory
e[] "Synchronize directory '$1' with 'SERVER"${pwd}"$1'.\n"
com="lftp ftp://"$GMIC_LOGIN":"$GMIC_PASSWD"@"$GMIC_FTP" -e \"mirror -RL \\\"$1\\\" \\\"/www/CImg"${pwd}"$1\\\" ; quit\""
com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"mirror -RL \\\"$1\\\" \\\"/home/"$GMIC_LOGIN"/www/CImg"${pwd}"$1\\\" ; quit\""
x $com
elif isfile(['"$1"']) # Upload single file
if !$is_pwd pwd="/" fi
e[] "Upload file '$1' to 'SERVER"${pwd}"'.\n"
com="lftp ftp://"$GMIC_LOGIN":"$GMIC_PASSWD"@"$GMIC_FTP" -e \"put -O \\\"/www/CImg"${pwd}"\\\" \\\"$1\\\"; quit\""
com="lftp sftp://"$GMIC_LOGIN":@ovh -e \"put -O \\\"/home/"$GMIC_LOGIN"/www/CImg"${pwd}"\\\" \\\"$1\\\"; quit\""
x $com
fi
rm
# Local Variables:
# mode: sh