コード例 #1
0
 extern static nint vImageConvolveMultiKernel_ARGBFFFF(ref vImageBuffer src,
                                                       ref vImageBuffer dest,
                                                       IntPtr tempBuffer,
                                                       vImagePixelCount srcOffsetToROI_X,
                                                       vImagePixelCount srcOffsetToROI_Y,
                                                       float * [] kernels,                 //must be 4, defined as 'float*[4]'
                                                       uint kernel_height,
                                                       uint kernel_width,
                                                       float [] biases,                   // must be 4
                                                       PixelFFFF backgroundColor,
                                                       vImageFlags flags);
コード例 #2
0
        public static vImageError ConvolveMultiKernelARGBFFFF(ref vImageBuffer src,
                                                              ref vImageBuffer dest,
                                                              IntPtr tempBuffer,
                                                              vImagePixelCount srcOffsetToROI_X,
                                                              vImagePixelCount srcOffsetToROI_Y,
                                                              float [][] kernels,            //must be 4
                                                              uint kernel_height,
                                                              uint kernel_width,
                                                              float [] biases,             // must be 4
                                                              PixelFFFF backgroundColor,
                                                              vImageFlags flags)
        {
            if (kernels is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(kernels));
            }
            if (biases is null)
            {
                ObjCRuntime.ThrowHelper.ThrowArgumentNullException(nameof(biases));
            }
            if (kernels.Length < 4)
            {
                throw new ArgumentException("Must contain at least four elements", "kernels");
            }
            if (biases.Length < 4)
            {
                throw new ArgumentException("Must contain at least four elements", "biases");
            }
            unsafe
            {
                fixed(float *f1 = kernels [0])
                {
                    fixed(float *f2 = kernels [1])
                    {
                        fixed(float *f3 = kernels [2])
                        {
                            fixed(float *f4 = kernels [3])
                            {
                                var ptrs = new float * [4];

                                ptrs [0] = f1;
                                ptrs [1] = f2;
                                ptrs [2] = f3;
                                ptrs [3] = f4;
                                return((vImageError)(long)vImageConvolveMultiKernel_ARGBFFFF(ref src, ref dest, tempBuffer, srcOffsetToROI_X, srcOffsetToROI_Y, ptrs, kernel_height, kernel_width, biases, backgroundColor, flags));
                            }
                        }
                    }
                }
            }
        }
コード例 #3
0
 public static vImageError RichardsonLucyDeConvolveARGBFFFF(ref vImageBuffer src, ref vImageBuffer dest, IntPtr tempBuffer, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float *kernel, float *kernel2, uint kernel_height, uint kernel_width, uint kernel_height2, uint kernel_width2, PixelFFFF backgroundColor, uint iterationCount, vImageFlags flags)
 {
     return((vImageError)(long)vImageRichardsonLucyDeConvolve_ARGBFFFF(ref src, ref dest, tempBuffer, srcOffsetToROI_X, srcOffsetToROI_Y, kernel, kernel2, kernel_height, kernel_width, kernel_height2, kernel_width2, backgroundColor, iterationCount, flags));
 }
コード例 #4
0
 extern static nint vImageRichardsonLucyDeConvolve_ARGBFFFF(ref vImageBuffer src, ref vImageBuffer dest, IntPtr tempBuffer, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float *kernel, float *kernel2, uint kernel_height, uint kernel_width, uint kernel_height2, uint kernel_width2, PixelFFFF backgroundColor, uint iterationCount, vImageFlags flags);
コード例 #5
0
 public static vImageError ConvolveWithBiasARGBFFFF(ref vImageBuffer src, ref vImageBuffer dest, IntPtr tempBuffer, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float *kernel, uint kernel_height, uint kernel_width, float bias, PixelFFFF backgroundColor, vImageFlags flags)
 {
     return((vImageError)(long)vImageConvolveWithBias_ARGBFFFF(ref src, ref dest, tempBuffer, srcOffsetToROI_X, srcOffsetToROI_Y, kernel, kernel_height, kernel_width, bias, backgroundColor, flags));
 }
コード例 #6
0
 extern static nint vImageConvolveWithBias_ARGBFFFF(ref vImageBuffer src, ref vImageBuffer dest, IntPtr tempBuffer, vImagePixelCount srcOffsetToROI_X, vImagePixelCount srcOffsetToROI_Y, float *kernel, uint kernel_height, uint kernel_width, float bias, PixelFFFF backgroundColor, vImageFlags flags);