title: How to compile vImage emboss effect sample code?
body: <p>Here is the code found in the <a href="https://developer.apple.com/library/ios/documentation/Performance/Conceptual/vImage/ConvolutionOperations/ConvolutionOperations.html#//apple_ref/doc/uid/TP30001001-CH205-SW10" rel="nofollow">documentation</a>:</p>
  
  <pre><code>int myEmboss(void *inData,
  unsigned int inRowBytes,
  void *outData,
  unsigned int outRowBytes,
  unsigned int height,
  unsigned int width,
  void *kernel,
  unsigned int kernel_height,
  unsigned int kernel_width,
  int divisor ,
  vImage_Flags flags ) {
     uint_8 kernel = {-2, -2, 0, -2, 6, 0, 0, 0, 0}; // 1
     vImage_Buffer src = { inData, height, width, inRowBytes }; // 2
     vImage_Buffer dest = { outData, height, width, outRowBytes }; // 3
     unsigned char bgColor[4] = { 0, 0, 0, 0 }; // 4
     vImage_Error err; // 5
     err = vImageConvolve_ARGB8888(    &amp;src,     //const vImage_Buffer *src
                                       &amp;dest,    //const vImage_Buffer *dest,
                                        NULL,
                                        0,    //unsigned int srcOffsetToROI_X,
                                        0,    //unsigned int srcOffsetToROI_Y,
                                        kernel,    //const signed int *kernel,
                                        kernel_height,     //unsigned int
                                        kernel_width,    //unsigned int
                                        divisor,    //int
                                        bgColor,
                                        flags | kvImageBackgroundColorFill
                                        //vImage_Flags flags
                                      );
  
  
     return err;
  }
  </code></pre>
  
  <p>Here is the problem: the kernel variable seems to refer to three different types:</p>
  
  <ol>
  <li>void * kernel in the formal parameter list</li>
  <li>an undefined unsigned int uint_8 kernel, as a new variable which presumably would shadow the formal parameter</li>
  <li>a const signed int *kernel when calling  vImageConvolve_ARGB8888.</li>
  </ol>
  
  <p>Is this actual code ? How may I compile this function ? </p>