/*
 This Source Code Form is subject to the terms of the Mozilla Public
 License, v. 2.0. If a copy of the MPL was not distributed with this
 file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/


/*!
  \page grenaille_example_cxx_ssc_page Screen Space Curvature using Cuda/C++

  \section cxx_ssgl_intro_sec Introduction

  This is an example that use Grenaille to compute Screen Space Curvature in
  C++ using Cuda.

  \subsection cxx_ssgl_sec_dep_subsec Installation and usage
  This example requires the following third-party library :
   - freeimageplus

  as well as a working cuda setup (tested with 5.0 and 7.0), and the lastest version of <strong>eigen dev branch</strong> which manage nvcc compiler.

  To compile and run the example, call
  \code
  cd build && make ssgls
  cd examples/Grenaille/cpp && ./ssgls
  \endcode

  This will takes the two input pictures packed in this example (in "data" directory) and compute the curvature for
  a screenspace neighborhood 10x10 pixels.
  \image html examples/ssgls_input.png "Screen-Space Curvature typical input. Left: world coordinates. Right: remapped normal vectors"

  It will generate this picture
  \image html examples/ssgls_result1.png "Screen-Space Curvature estimation"

  \section cxx_ssgl_cuda_sec Cuda programming

  Here are the technical details related to the cuda and C++ biding for
  screen-space curvature estimation.

  \subsection cxx_ssgl_cuda_mypoint_sec Define fitting data structure
  \snippet Grenaille/cpp/ssgls.cu mypoint


  \subsection cxx_ssgl_cuda_weight_sec Define weighting functions
  \snippet Grenaille/cpp/ssgls.cu w_def

  \subsection cxx_ssgl_cuda_fit_sec Define fitting primitive
  \snippet Grenaille/cpp/ssgls.cu fit_def


  \subsection cxx_ssgl_cuda_kernel_sec Kernel
  \snippet Grenaille/cpp/ssgls.cu kernel

  \subsection cxx_ssgl_cuda_access_sec Memory access
  We format the input data, filled by dimension (in object space)
  and then by the screen-space coordinates:
  \snippet Grenaille/cpp/ssgls.cu data_acces


  \section cxx_ssgl_sec The whole code
  We use freeimageplus to format input data.

  \include Grenaille/cpp/ssgls.cu
 */
