/*
 * File: main.c
 *
 * MATLAB Coder version            : 3.4
 * C/C++ source code generated on  : 18-Feb-2019 15:40:18
 */

/*************************************************************************/
/* This automatically generated example C main file shows how to call    */
/* entry-point functions that MATLAB Coder generated. You must customize */
/* this file for your application. Do not modify this file directly.     */
/* Instead, make a copy of this file, modify it, and integrate it into   */
/* your development environment.                                         */
/*                                                                       */
/* This file initializes entry-point function arguments to a default     */
/* size and value before calling the entry-point functions. It does      */
/* not store or use any values returned from the entry-point functions.  */
/* If necessary, it does pre-allocate memory for returned values.        */
/* You can use this file as a starting point for a main function that    */
/* you can deploy in your application.                                   */
/*                                                                       */
/* After you copy the file, and before you deploy it, you must make the  */
/* following changes:                                                    */
/* * For variable-size function arguments, change the example sizes to   */
/* the sizes that your application requires.                             */
/* * Change the example values of function arguments to the values that  */
/* your application requires.                                            */
/* * If the entry-point functions return values, store these values or   */
/* otherwise use them as required by your application.                   */
/*                                                                       */
/*************************************************************************/
/* Include Files */
#include "rt_nonfinite.h"
#include "MLS_applyDeform.h"
#include "main.h"
#include "MLS_applyDeform_terminate.h"
#include "MLS_applyDeform_initialize.h"

/* Function Declarations */
static void argInit_154x2_real_T(double result[308]);
static void argInit_1x2_real_T(double result[2]);
static void argInit_480x640x2_real_T(double result[614400]);
static void argInit_480x640x3_uint8_T(unsigned char result[921600]);
static double argInit_real_T(void);
static unsigned char argInit_uint8_T(void);
static void main_MLS_applyDeform(void);

/* Function Definitions */

/*
 * Arguments    : double result[308]
 * Return Type  : void
 */
static void argInit_154x2_real_T(double result[308])
{
  int idx0;
  int idx1;

  /* Loop over the array to initialize each element. */
  for (idx0 = 0; idx0 < 154; idx0++) {
    for (idx1 = 0; idx1 < 2; idx1++) {
      /* Set the value of the array element.
         Change this value to the value that the application requires. */
      result[idx0 + 154 * idx1] = argInit_real_T();
    }
  }
}

/*
 * Arguments    : double result[2]
 * Return Type  : void
 */
static void argInit_1x2_real_T(double result[2])
{
  int idx1;

  /* Loop over the array to initialize each element. */
  for (idx1 = 0; idx1 < 2; idx1++) {
    /* Set the value of the array element.
       Change this value to the value that the application requires. */
    result[idx1] = argInit_real_T();
  }
}

/*
 * Arguments    : double result[614400]
 * Return Type  : void
 */
static void argInit_480x640x2_real_T(double result[614400])
{
  int idx0;
  int idx1;
  int idx2;

  /* Loop over the array to initialize each element. */
  for (idx0 = 0; idx0 < 480; idx0++) {
    for (idx1 = 0; idx1 < 640; idx1++) {
      for (idx2 = 0; idx2 < 2; idx2++) {
        /* Set the value of the array element.
           Change this value to the value that the application requires. */
        result[(idx0 + 480 * idx1) + 307200 * idx2] = argInit_real_T();
      }
    }
  }
}

/*
 * Arguments    : unsigned char result[921600]
 * Return Type  : void
 */
static void argInit_480x640x3_uint8_T(unsigned char result[921600])
{
  int idx0;
  int idx1;
  int idx2;

  /* Loop over the array to initialize each element. */
  for (idx0 = 0; idx0 < 480; idx0++) {
    for (idx1 = 0; idx1 < 640; idx1++) {
      for (idx2 = 0; idx2 < 3; idx2++) {
        /* Set the value of the array element.
           Change this value to the value that the application requires. */
        result[(idx0 + 480 * idx1) + 307200 * idx2] = argInit_uint8_T();
      }
    }
  }
}

/*
 * Arguments    : void
 * Return Type  : double
 */
static double argInit_real_T(void)
{
  return 0.0;
}

/*
 * Arguments    : void
 * Return Type  : unsigned char
 */
static unsigned char argInit_uint8_T(void)
{
  return 0;
}

/*
 * Arguments    : void
 * Return Type  : void
 */
static void main_MLS_applyDeform(void)
{
  static unsigned char uv0[921600];
  static double f[614400];
  double dv0[308];
  double dv1[2];
  static unsigned char newImg[921600];

  /* Initialize function 'MLS_applyDeform' input arguments. */
  /* Initialize function input argument 'oldImg'. */
  /* Initialize function input argument 'f'. */
  /* Initialize function input argument 'v'. */
  /* Initialize function input argument 'grid_size'. */
  /* Call the entry-point 'MLS_applyDeform'. */
  argInit_480x640x3_uint8_T(uv0);
  argInit_480x640x2_real_T(f);
  argInit_154x2_real_T(dv0);
  argInit_1x2_real_T(dv1);
  MLS_applyDeform(uv0, f, dv0, dv1, newImg);
}

/*
 * Arguments    : int argc
 *                const char * const argv[]
 * Return Type  : int
 */
int main(int argc, const char * const argv[])
{
  (void)argc;
  (void)argv;

  /* Initialize the application.
     You do not need to do this more than one time. */
  MLS_applyDeform_initialize();

  /* Invoke the entry-point functions.
     You can call entry-point functions multiple times. */
  main_MLS_applyDeform();

  /* Terminate the application.
     You do not need to do this more than one time. */
  MLS_applyDeform_terminate();
  return 0;
}

/*
 * File trailer for main.c
 *
 * [EOF]
 */
