#### File: main.c
        1   /*
        2    * File: main.c
        3    *
        4    * MATLAB Coder version            : 3.4
        5    * C/C++ source code generated on  : 18-Feb-2019 15:40:18
        6    */
        7
        8   /*************************************************************************/
        9   /* This automatically generated example C main file shows how to call    */
       10   /* entry-point functions that MATLAB Coder generated. You must customize */
       11   /* this file for your application. Do not modify this file directly.     */
       12   /* Instead, make a copy of this file, modify it, and integrate it into   */
       13   /* your development environment.                                         */
       14   /*                                                                       */
       15   /* This file initializes entry-point function arguments to a default     */
       16   /* size and value before calling the entry-point functions. It does      */
       17   /* not store or use any values returned from the entry-point functions.  */
       18   /* If necessary, it does pre-allocate memory for returned values.        */
       19   /* You can use this file as a starting point for a main function that    */
       20   /* you can deploy in your application.                                   */
       21   /*                                                                       */
       22   /* After you copy the file, and before you deploy it, you must make the  */
       23   /* following changes:                                                    */
       24   /* * For variable-size function arguments, change the example sizes to   */
       25   /* the sizes that your application requires.                             */
       26   /* * Change the example values of function arguments to the values that  */
       27   /* your application requires.                                            */
       28   /* * If the entry-point functions return values, store these values or   */
       29   /* otherwise use them as required by your application.                   */
       30   /*                                                                       */
       31   /*************************************************************************/
       32   /* Include Files */
       33   #include "rt_nonfinite.h"
       34   #include "MLS_applyDeform.h"
       35   #include "main.h"
       36   #include "MLS_applyDeform_terminate.h"
       37   #include "MLS_applyDeform_initialize.h"
       38
       39   /* Function Declarations */
       40   static void argInit_154x2_real_T(double result[308]);
       41   static void argInit_1x2_real_T(double result[2]);
       42   static void argInit_480x640x2_real_T(double result[614400]);
       43   static void argInit_480x640x3_uint8_T(unsigned char result[921600]);
       44   static double argInit_real_T(void);
       45   static unsigned char argInit_uint8_T(void);
       46   static void main_MLS_applyDeform(void);
       47
       48   /* Function Definitions */
       49
       50   /*
       51    * Arguments    : double result[308]
       52    * Return Type  : void
       53    */
       54   static void argInit_154x2_real_T(double result[308])
       55   {
       56     int idx0;
       57     int idx1;
       58
       59     /* Loop over the array to initialize each element. */
       60     for (idx0 = 0; idx0 < 154; idx0++) {
       61       for (idx1 = 0; idx1 < 2; idx1++) {
       62         /* Set the value of the array element.
       63            Change this value to the value that the application requires. */
       64         result[idx0 + 154 * idx1] = argInit_real_T();
       65       }
       66     }
       67   }
       68
       69   /*
       70    * Arguments    : double result[2]
       71    * Return Type  : void
       72    */
       73   static void argInit_1x2_real_T(double result[2])
       74   {
       75     int idx1;
       76
       77     /* Loop over the array to initialize each element. */
       78     for (idx1 = 0; idx1 < 2; idx1++) {
       79       /* Set the value of the array element.
       80          Change this value to the value that the application requires. */
       81       result[idx1] = argInit_real_T();
       82     }
       83   }
       84
       85   /*
       86    * Arguments    : double result[614400]
       87    * Return Type  : void
       88    */
       89   static void argInit_480x640x2_real_T(double result[614400])
       90   {
       91     int idx0;
       92     int idx1;
       93     int idx2;
       94
       95     /* Loop over the array to initialize each element. */
       96     for (idx0 = 0; idx0 < 480; idx0++) {
       97       for (idx1 = 0; idx1 < 640; idx1++) {
       98         for (idx2 = 0; idx2 < 2; idx2++) {
       99           /* Set the value of the array element.
      100              Change this value to the value that the application requires. */
      101           result[(idx0 + 480 * idx1) + 307200 * idx2] = argInit_real_T();
      102         }
      103       }
      104     }
      105   }
      106
      107   /*
      108    * Arguments    : unsigned char result[921600]
      109    * Return Type  : void
      110    */
      111   static void argInit_480x640x3_uint8_T(unsigned char result[921600])
      112   {
      113     int idx0;
      114     int idx1;
      115     int idx2;
      116
      117     /* Loop over the array to initialize each element. */
      118     for (idx0 = 0; idx0 < 480; idx0++) {
      119       for (idx1 = 0; idx1 < 640; idx1++) {
      120         for (idx2 = 0; idx2 < 3; idx2++) {
      121           /* Set the value of the array element.
      122              Change this value to the value that the application requires. */
      123           result[(idx0 + 480 * idx1) + 307200 * idx2] = argInit_uint8_T();
      124         }
      125       }
      126     }
      127   }
      128
      129   /*
      130    * Arguments    : void
      131    * Return Type  : double
      132    */
      133   static double argInit_real_T(void)
      134   {
      135     return 0.0;
      136   }
      137
      138   /*
      139    * Arguments    : void
      140    * Return Type  : unsigned char
      141    */
      142   static unsigned char argInit_uint8_T(void)
      143   {
      144     return 0;
      145   }
      146
      147   /*
      148    * Arguments    : void
      149    * Return Type  : void
      150    */
      151   static void main_MLS_applyDeform(void)
      152   {
      153     static unsigned char uv0[921600];
      154     static double f[614400];
      155     double dv0[308];
      156     double dv1[2];
      157     static unsigned char newImg[921600];
      158
      159     /* Initialize function 'MLS_applyDeform' input arguments. */
      160     /* Initialize function input argument 'oldImg'. */
      161     /* Initialize function input argument 'f'. */
      162     /* Initialize function input argument 'v'. */
      163     /* Initialize function input argument 'grid_size'. */
      164     /* Call the entry-point 'MLS_applyDeform'. */
      165     argInit_480x640x3_uint8_T(uv0);
      166     argInit_480x640x2_real_T(f);
      167     argInit_154x2_real_T(dv0);
      168     argInit_1x2_real_T(dv1);
      169     MLS_applyDeform(uv0, f, dv0, dv1, newImg);
      170   }
      171
      172   /*
      173    * Arguments    : int argc
      174    *                const char * const argv[]
      175    * Return Type  : int
      176    */
      177   int main(int argc, const char * const argv[])
      178   {
      179     (void)argc;
      180     (void)argv;
      181
      182     /* Initialize the application.
      183        You do not need to do this more than one time. */
      184     MLS_applyDeform_initialize();
      185
      186     /* Invoke the entry-point functions.
      187        You can call entry-point functions multiple times. */
      188     main_MLS_applyDeform();
      189
      190     /* Terminate the application.
      191        You do not need to do this more than one time. */
      192     MLS_applyDeform_terminate();
      193     return 0;
      194   }
      195
      196   /*
      197    * File trailer for main.c
      198    *
      199    * [EOF]
      200    */
      201