Added proper testing of the end of quicktime video files.

CvCaptureFile::grabFrame() always returns 1 regardless, which causes
dead loop when relying on the return value of VideoCapture::read().
Removed trailing whitespace in cap_qtkit.mm.
Fix the build of OpenCV with XIMEA on Windows 64 bits:
  - crosses initializations in "cap_ximea.cpp" (which also contained some awfull "goto" instructions)
  - the "CMAKE_CL_64" variable is not initialized when using mingw

PR#1039 modified to be able to merge on branch 2.4
Trailing whitespace removal.
Using four spaces for indentation.
minX1 should be max(-maxD,0) not max(maxD,0), avoid black band at left
Reworked documentation building to work with extra modules.

The main problem with extra modules is that they're located outside
of the OpenCV root, while Sphinx requires that all documents are
within the documentation root. To circumvent this, we create a
"fake root" and copy all documentation (as well as all files that
it depends on) there. It's a bit messy, but what can you do.

As a bonus, this eliminates the need to generate modules/refman.rst
inside the source tree.
added RGBA <-> mRGBA
Fix building with FFmpeg 0.8.

avformat_find_stream_info was introduced in Libav avformat 53.3,
but it was only merged to FFmpeg in avformat 53.6.

In Libav avformat 53.3-53.5 av_find_stream_info is not removed
(only deprecated), so this shouldn't break building with that.
Made the generated file templates' naming more consistent.

The general convention is <output file name> + ".in".
Merge pull request #1799 from SpecLad:avformat-53-6
Merge pull request #1803 from ilya-lavrenov:ocl_cvtColor
Merge pull request #1802 from SpecLad:cmake-templates
generalized ocl::resize for all data types (INTER_NEAREST mode)
ocl: fix cvtColor XYZ: variables on stack
compilation for VS2008
fixed some warnings
Applied all fixes related to translating C to C++ code
Also fixed some typos and code alignment
Also adapted tutorial CPP samples
Fixed some identation problems
Merge pull request #1808 from alalek:ocl_fix_cvtcolor_xyz
fixing bugs for Intel platform CPU device