Permalink
Browse files

Pristine Unix sources for OpenCV 2.3.1

  • Loading branch information...
0 parents commit 48005303be34c9ee8a4c9f9c4dfdc4b38d8dc597 @hungc hungc committed Apr 2, 2012
Showing 2,455 changed files with 1,360,168 additions and 0 deletions.
@@ -0,0 +1,18 @@
+if(NOT ZLIB_FOUND)
+ add_subdirectory(zlib)
+endif()
+if(WITH_JASPER AND NOT JASPER_FOUND)
+ add_subdirectory(libjasper)
+endif()
+if(WITH_JPEG AND NOT JPEG_FOUND)
+ add_subdirectory(libjpeg)
+endif()
+if(WITH_PNG AND NOT PNG_FOUND)
+ add_subdirectory(libpng)
+endif()
+if(WITH_TIFF AND NOT TIFF_FOUND)
+ add_subdirectory(libtiff)
+endif()
+if(WIN32)
+ add_subdirectory(ffmpeg)
+endif()
@@ -0,0 +1,20 @@
+project(opencv_ffmpeg)
+
+if(MSVC64 OR MINGW64)
+ set(FFMPEG_SUFFIX _64)
+endif()
+
+set(module_bare_name "opencv_ffmpeg${FFMPEG_SUFFIX}.dll")
+set(module_name "${CMAKE_CURRENT_SOURCE_DIR}/${module_bare_name}")
+
+get_target_property(bin_dir opencv_traincascade LOCATION)
+get_filename_component(bin_dir ${bin_dir} PATH)
+
+message(STATUS "ffmpeg output dir: ${bin_dir}")
+
+add_custom_target(opencv_ffmpeg ALL
+ COMMAND ${CMAKE_COMMAND} -E copy
+ ${module_name} ${bin_dir}/${module_bare_name}
+ COMMENT "Copying ${module_name} to the output directory")
+
+install(FILES ${module_name} DESTINATION bin COMPONENT main)
@@ -0,0 +1 @@
+#include "cap_ffmpeg_impl.hpp"
@@ -0,0 +1,2 @@
+set path=c:\dev\msys32\bin;%path% & gcc -Wall -shared -o opencv_ffmpeg.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat -lavcodec -lavdevice -lswscale -lavutil -lwsock32
+set path=c:\dev\msys64\bin;%path% & gcc -m64 -Wall -shared -o opencv_ffmpeg_64.dll -O2 -x c++ -I../include -I../include/ffmpeg_ -I../../modules/highgui/src ffopencv.c -L../lib -lavformat64 -lavcodec64 -lavdevice64 -lswscale64 -lavutil64 -lavcore64 -lwsock32 -lws2_32
@@ -0,0 +1,44 @@
+The build script is to be fixed.
+Right now it assumes that 32-bit MinGW is in the system path and
+64-bit mingw is installed to c:\Apps\MinGW64.
+
+It is important that gcc is used, not g++!
+Otherwise the produced DLL will likely be dependent on libgcc_s_dw2-1.dll or similar DLL.
+While we want to make the DLLs with minimum dependencies: Win32 libraries + msvcrt.dll.
+
+ffopencv.c is really a C++ source, hence -x c++ is used.
+
+How to update opencv_ffmpeg.dll and opencv_ffmpeg_64.dll when a new version of FFMPEG is release?
+
+1. Install 32-bit MinGW + MSYS from
+ http://sourceforge.net/projects/mingw/files/Automated%20MinGW%20Installer/mingw-get-inst/
+ Let's assume, it's installed in C:\MSYS32.
+2. Install 64-bit MinGW. http://mingw-w64.sourceforge.net/
+ Let's assume, it's installed in C:\MSYS64
+3. Copy C:\MSYS32\msys to C:\MSYS64\msys. Edit C:\MSYS64\msys\etc\fstab, change C:\MSYS32 to C:\MSYS64.
+
+4. Now you have working MSYS32 and MSYS64 environments.
+ Launch, one by one, C:\MSYS32\msys\msys.bat and C:\MSYS64\msys\msys.bat to create your home directories.
+
+4. Download ffmpeg-x.y.z.tar.gz (where x.y.z denotes the actual ffmpeg version).
+ Copy it to C:\MSYS{32|64}\msys\home\<loginname> directory.
+
+5. To build 32-bit ffmpeg libraries, run C:\MSYS32\msys\msys.bat and type the following commands:
+
+ 5.1. tar -xzf ffmpeg-x.y.z.tar.gz
+ 5.2. mkdir build
+ 5.3. cd build
+ 5.4. ../ffmpeg-x.y.z/configure --enable-w32threads
+ 5.5. make
+ 5.6. make install
+ 5.7. cd /local/lib
+ 5.8. strip -g *.a
+
+6. Then repeat the same for 64-bit case. The output libs: libavcodec.a etc. need to be renamed to libavcodec64.a etc.
+
+7. Then, copy all those libs to <opencv>\3rdparty\lib\, copy the headers to <opencv>\3rdparty\include\ffmpeg_.
+
+8. Then, go to <opencv>\3rdparty\ffmpeg, edit make.bat
+ (change paths to the actual paths to your msys32 and msys64 distributions) and then run make.bat
+
+
@@ -0,0 +1,34 @@
+Copyright (c) 2004, Industrial Light & Magic, a division of Lucasfilm
+Entertainment Company Ltd. Portions contributed and copyright held by
+others as indicated. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+ * Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided with
+ the distribution.
+
+ * Neither the name of Industrial Light & Magic nor the names of
+ any other contributors to this software may be used to endorse or
+ promote products derived from this software without specific prior
+ written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
+IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
@@ -0,0 +1,123 @@
+ABOUT THE OPENEXR LIBRARIES
+----------------------------
+
+Half is a class that encapsulates our 16-bit floating-point format.
+
+IlmThread is a thread abstraction library for use with IlmImf. It
+currently supports pthreads and Windows threads.
+
+IlmImf is our "EXR" file format for storing 16-bit FP images.
+
+Imath is a math library. IlmImf only uses a subset of it,
+but we're releasing the full library because it's easier for us to
+maintain, and we think it'll be useful to others.
+
+Iex is an exception-handling library.
+
+See the IlmImfExamples directory for some code that demonstrates how
+to use the IlmImf library to read and write OpenEXR files. The doc
+directory contains some high-level documentation and history about the
+OpenEXR format.
+
+If you have questions about using the OpenEXR libraries, you may want
+to join our developer mailing list. See http://www.openexr.com for
+details.
+
+
+LICENSE
+-------
+
+The OpenEXR source code distribution is free software. See the file
+named COPYING (included in this distribution) for details.
+
+
+WHAT'S INCLUDED
+---------------
+
+Besides the core OpenEXR libraries, the release includes several
+utilities for reading, writing, viewing, and manipulating OpenEXR
+images. These include:
+
+ * exrdisplay, an image viewer.
+ * exrheader, a utility for dumping header information.
+ * exrstdattr, a utility for modifying OpenEXR standard attributes.
+ * exrmaketiled, for generating tiled and rip/mipmapped images.
+ * exrenvmap, for creating OpenEXR environment maps.
+ * exrmakepreview, for creating preview images for OpenEXR files.
+
+exrdisplay requires FLTK 1.1 or greater and OpenGL. exrdisplay
+supports fragment shaders if you have the Nvidia Cg SDK and a graphics
+card capable of running fp30 profile fragment shaders. See
+exrdisplay/README for details.
+
+We have also released an OpenEXR display driver for Renderman, a file
+I/O plugin for Shake, and a file I/O plugin for Adobe Photoshop (on
+both Windows and MacOS). These are packaged separately. Go to
+http://www.openexr.com to download them. NOTE: the most recent
+versions of these applications now have native support for OpenEXR, so
+you should only use our open-source versions of the plugins if you
+have an older version of the application.
+
+
+BUILDING OPENEXR
+----------------
+
+Building OpenEXR requires the zlib library. If you want to build the
+'exrdisplay' image viewer, you'll also need FLTK 1.1, but this program
+is not required to use OpenEXR's libraries in your application.
+exrdisplay can also accelerate the display of OpenEXR images if you
+have the NVIDIA Cg SDK.
+
+Your OS distribution may already include these libraries, or supply
+packages for them. That is the preferred way to obtain them for use
+with OpenEXR. If not, you can obtain the source code for zlib and
+FLTK from:
+
+ http://www.zlib.net
+ http://www.fltk.org
+
+and you can download the NVIDIA Cg SDK from
+http://developer.nvidia.com.
+
+If you're building OpenEXR on a Windows platform, see README.win32 for
+instructions on how to build OpenEXR. The remainder of this file
+applies only to GNU/Linux or other UNIX-like systems.
+
+After installing the required libraries, to build OpenEXR on
+GNU/Linux or other UNIX-like systems, do this:
+
+./configure
+make
+make install
+
+unless you obtained OpenEXR directly from CVS, in which case you
+should first read README.CVS.
+
+If you have the Nvidia Cg SDK and you want to build support for
+fragment shaders into exrdisplay, specify the path to the SDK using
+the "--with-cg-prefix" flag. There are some additional compile-time
+configuration options available; type `./configure --help` for more
+information.
+
+See README.OSX for details on building OpenEXR in MacOS X.
+
+Do `make check` to run the OpenEXR confidence tests. They should all
+pass; if you find a test that does not pass on your system, please let
+us know.
+
+Other UNIX variants haven't been tested, but should be easy to build.
+Let us know if you're having problems porting OpenEXR to a particular
+platform.
+
+All include files needed to use the OpenEXR libraries are installed in the
+OpenEXR subdirectory of the install prefix, e.g. /usr/local/include/OpenEXR.
+
+
+USING OPENEXR IN YOUR APPLICATIONS
+----------------------------------
+
+On systems with support for pkg-config, use `pkg-config --cflags
+OpenEXR` for the C++ flags required to compile against OpenEXR
+headers; and `pkg-config --libs OpenEXR` for the linker flags required
+to link against OpenEXR libraries.
+
@@ -0,0 +1,110 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
+ */
+
+#if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS)
+#define NONAMELESSUNION 1
+#endif
+#if defined(NONAMELESSSTRUCT) && \
+ !defined(NONAMELESSUNION)
+#define NONAMELESSUNION 1
+#endif
+#if defined(NONAMELESSUNION) && \
+ !defined(NONAMELESSSTRUCT)
+#define NONAMELESSSTRUCT 1
+#endif
+
+#ifndef __ANONYMOUS_DEFINED
+#define __ANONYMOUS_DEFINED
+#if defined(__GNUC__) || defined(__GNUG__)
+#define _ANONYMOUS_UNION __extension__
+#define _ANONYMOUS_STRUCT __extension__
+#else
+#define _ANONYMOUS_UNION
+#define _ANONYMOUS_STRUCT
+#endif
+#ifndef NONAMELESSUNION
+#define _UNION_NAME(x)
+#define _STRUCT_NAME(x)
+#else /* NONAMELESSUNION */
+#define _UNION_NAME(x) x
+#define _STRUCT_NAME(x) x
+#endif
+#endif /* __ANONYMOUS_DEFINED */
+
+#ifndef DUMMYUNIONNAME
+# ifdef NONAMELESSUNION
+# define DUMMYUNIONNAME u
+# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
+# define DUMMYUNIONNAME2 u2
+# define DUMMYUNIONNAME3 u3
+# define DUMMYUNIONNAME4 u4
+# define DUMMYUNIONNAME5 u5
+# define DUMMYUNIONNAME6 u6
+# define DUMMYUNIONNAME7 u7
+# define DUMMYUNIONNAME8 u8
+# define DUMMYUNIONNAME9 u9
+# else /* NONAMELESSUNION */
+# define DUMMYUNIONNAME
+# define DUMMYUNIONNAME1 /* Wine uses this variant */
+# define DUMMYUNIONNAME2
+# define DUMMYUNIONNAME3
+# define DUMMYUNIONNAME4
+# define DUMMYUNIONNAME5
+# define DUMMYUNIONNAME6
+# define DUMMYUNIONNAME7
+# define DUMMYUNIONNAME8
+# define DUMMYUNIONNAME9
+# endif
+#endif /* DUMMYUNIONNAME */
+
+#if !defined(DUMMYUNIONNAME1) /* MinGW does not define this one */
+# ifdef NONAMELESSUNION
+# define DUMMYUNIONNAME1 u1 /* Wine uses this variant */
+# else
+# define DUMMYUNIONNAME1 /* Wine uses this variant */
+# endif
+#endif /* DUMMYUNIONNAME1 */
+
+#ifndef DUMMYSTRUCTNAME
+# ifdef NONAMELESSUNION
+# define DUMMYSTRUCTNAME s
+# define DUMMYSTRUCTNAME1 s1 /* Wine uses this variant */
+# define DUMMYSTRUCTNAME2 s2
+# define DUMMYSTRUCTNAME3 s3
+# define DUMMYSTRUCTNAME4 s4
+# define DUMMYSTRUCTNAME5 s5
+# else
+# define DUMMYSTRUCTNAME
+# define DUMMYSTRUCTNAME1 /* Wine uses this variant */
+# define DUMMYSTRUCTNAME2
+# define DUMMYSTRUCTNAME3
+# define DUMMYSTRUCTNAME4
+# define DUMMYSTRUCTNAME5
+# endif
+#endif /* DUMMYSTRUCTNAME */
+
+/* These are for compatibility with the Wine source tree */
+
+#ifndef WINELIB_NAME_AW
+# ifdef __MINGW_NAME_AW
+# define WINELIB_NAME_AW __MINGW_NAME_AW
+# else
+# ifdef UNICODE
+# define WINELIB_NAME_AW(func) func##W
+# else
+# define WINELIB_NAME_AW(func) func##A
+# endif
+# endif
+#endif /* WINELIB_NAME_AW */
+
+#ifndef DECL_WINELIB_TYPE_AW
+# ifdef __MINGW_TYPEDEF_AW
+# define DECL_WINELIB_TYPE_AW __MINGW_TYPEDEF_AW
+# else
+# define DECL_WINELIB_TYPE_AW(type) typedef WINELIB_NAME_AW(type) type;
+# endif
+#endif /* DECL_WINELIB_TYPE_AW */
+
@@ -0,0 +1,33 @@
+/**
+ * This file has no copyright assigned and is placed in the Public Domain.
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER.PD within this package.
+ */
+
+#if !defined(_INC_CRT_UNICODE_MACROS)
+/* _INC_CRT_UNICODE_MACROS defined based on UNICODE flag */
+
+#if defined(UNICODE)
+# define _INC_CRT_UNICODE_MACROS 1
+# define __MINGW_NAME_AW(func) func##W
+# define __MINGW_NAME_AW_EXT(func,ext) func##W##ext
+# define __MINGW_NAME_UAW(func) func##_W
+# define __MINGW_NAME_UAW_EXT(func,ext) func##_W_##ext
+# define __MINGW_STRING_AW(str) L##str /* same as TEXT() from winnt.h */
+# define __MINGW_PROCNAMEEXT_AW "W"
+#else
+# define _INC_CRT_UNICODE_MACROS 2
+# define __MINGW_NAME_AW(func) func##A
+# define __MINGW_NAME_AW_EXT(func,ext) func##A##ext
+# define __MINGW_NAME_UAW(func) func##_A
+# define __MINGW_NAME_UAW_EXT(func,ext) func##_A_##ext
+# define __MINGW_STRING_AW(str) str /* same as TEXT() from winnt.h */
+# define __MINGW_PROCNAMEEXT_AW "A"
+#endif
+
+#define __MINGW_TYPEDEF_AW(type) \
+ typedef __MINGW_NAME_AW(type) type;
+#define __MINGW_TYPEDEF_UAW(type) \
+ typedef __MINGW_NAME_UAW(type) type;
+
+#endif /* !defined(_INC_CRT_UNICODE_MACROS) */
Oops, something went wrong. Retry.

0 comments on commit 4800530

Please sign in to comment.