1 Partial Public Class TestClass
7 Dim src As FVIL.Data.CFviImage = Nothing
8 Dim dst As FVIL.Data.CFviImage = Nothing
9 Dim hfga_src As FHANDLE = IntPtr.Zero
10 Dim hfga_dst1 As FHANDLE = IntPtr.Zero
11 Dim hfga_dst2 As FHANDLE = IntPtr.Zero
17 If fga.fnFGA_is_setuped() = False Then
22 '' ==================================================
24 src = New FVIL.Data.CFviImage("Data/key_UC8_M.png")
26 type = api.fnFIE_img_get_type(src.GetFIE())
27 channels = api.fnFIE_img_get_channels(src.GetFIE())
28 width = api.fnFIE_img_get_width(src.GetFIE())
29 height = api.fnFIE_img_get_height(src.GetFIE())
32 hfga_src = fga.fnFGA_img_root_alloc(type, channels, width, height)
35 fga.fnFGA_img_copy(src.GetFIE(), hfga_src)
37 '' ==================================================
39 type = fga.fnFGA_img_get_type(hfga_src)
40 channels = fga.fnFGA_img_get_channels(hfga_src)
41 width = fga.fnFGA_img_get_width(hfga_src)
42 height = fga.fnFGA_img_get_height(hfga_src)
45 hfga_dst1 = fga.fnFGA_img_root_alloc(type, channels, width, height)
46 hfga_dst2 = fga.fnFGA_img_root_alloc(type, channels, width, height)
49 status = fga.fnFGA_average(hfga_src, hfga_dst1, f_border_mode.F_BORDER_CONTINUOUS, 0.0)
50 If status <> f_err.F_ERR_NONE Then
51 Console.WriteLine("fnFGA_average failed.({0})", status)
52 Throw New FvException(status)
56 status = fga.fnFGA_sobel(hfga_dst1, hfga_dst2, f_sobel_mode.F_SOBEL_XY_MODE, f_border_mode.F_BORDER_CONTINUOUS, 0.0)
57 If status <> f_err.F_ERR_NONE Then
58 Console.WriteLine("fnFGA_sobel failed.({0})", status)
59 Throw New FvException(status)
62 '' ==================================================
64 type = fga.fnFGA_img_get_type(hfga_dst2)
65 channels = fga.fnFGA_img_get_channels(hfga_dst2)
66 width = fga.fnFGA_img_get_width(hfga_dst2)
67 height = fga.fnFGA_img_get_height(hfga_dst2)
70 Dim hfie_dst As FHANDLE = api.fnFIE_img_root_alloc(type, channels, width, height)
73 fga.fnFGA_img_copy(hfga_dst2, hfie_dst)
76 dst = New FVIL.Data.CFviImage(hfie_dst, False)
77 dst.Save("Result/Result3.png")
80 If src IsNot Nothing Then src.Dispose()
81 If dst IsNot Nothing Then dst.Dispose()
93 Dim status As Int32 = fga.fnFGA_setup()
95 If status = f_err.F_ERR_NONE Then