/[gr2lib]/trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs
ViewVC logotype

Diff of /trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

--- trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/20 08:11:31	148
+++ trunk/gr2lib/core/typedefs/granny_pixel_layouts.cs	2010/07/24 06:31:50	191
@@ -1,4 +1,5 @@
-´╗┐using System;
+´╗┐#define HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS // when defined will disable warnings about missing XML comments for all typedefs (CS1591)
+using System;
 using System.Collections.Generic;
 using System.Linq;
 using System.Text;
@@ -8,6 +9,11 @@
 namespace gr2lib.core.typedefs
 {
 
+#if HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS
+#pragma warning disable 1591
+#endif
+
+    #region public enum granny_pixel_layout
     public enum granny_pixel_layout
     {
         GrannyRGB555PixelFormat,
@@ -22,12 +28,15 @@
         GrannyBGRA5551PixelFormat,
         GrannyBGRA4444PixelFormat,
         GrannyBGR888PixelFormat,
-        GrannyBGRA8888PixelFormat
+        GrannyBGRA8888PixelFormat,
+        GrannyABGR8888PixelFormat
     }
+    #endregion
 
+    #region public struct granny_pixel_layouts
     public struct granny_pixel_layouts
     {
-
+        #region GetPixelLayoutFromEnum(granny_pixel_layout layout_type)
         public static Layout GetPixelLayoutFromEnum(granny_pixel_layout layout_type)
         {
             switch (layout_type)
@@ -48,21 +57,21 @@
                 default: return granny_pixel_layouts.GrannyDefaultPixelLayout;
             }
         }
-
-
+        #endregion
         #region Pixel Layout: GrannyDefaultPixelLayout
         /// <summary>
         /// default pixel layout (GrannyRGBA8888PixelFormat)
         /// </summary>
         public static Layout GrannyDefaultPixelLayout
         {
+            #region Get GrannyDefaultPixelLayout
             get
             {
                 return GetPixelLayoutFromEnum(granny_pixel_layout.GrannyRGBA8888PixelFormat);
             }
+            #endregion
         }
         #endregion
-
         #region Pixel Layout: GrannyRGB555PixelFormat
         /// <summary>
         /// 16bpp  5-bit red, 5-bit green, 5-bit blue
@@ -72,19 +81,21 @@
             #region Get GrannyRGB555PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB555PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGB555PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -100,8 +111,6 @@
             #endregion
         }
         #endregion
-
-
         #region Pixel Layout: GrannyRGB565PixelFormat
         /// <summary>
         /// 16bpp  5-bit red, 6-bit green, 5-bit blue
@@ -111,19 +120,21 @@
             #region Get GrannyRGB565PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB565PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGB565PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -139,7 +150,6 @@
             #endregion
         }
         #endregion
-
         #region Pixel Layout: GrannyRGBA5551PixelFormat
         /// <summary>
         /// 16bpp  5-bit red, 5-bit green, 5-bit blue, 1-bit alpha
@@ -149,19 +159,21 @@
             #region Get GrannyRGBA5551PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA5551PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGBA5551PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -186,19 +198,21 @@
             #region Get GrannyRGBA4444PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA4444PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGBA4444PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -223,19 +237,21 @@
             #region Get GrannyRGB888PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB888PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGB888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
+                        gr2lib.core.coretypes.native.Layout _native_ptr;
                         gr2lib.core.coretypes.native.Layout _native;
                         Layout _tmp_layout = new Layout();
-                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
-                        _tmp_layout.BytesPerPixel = Marshal.ReadInt32((IntPtr)_native.BytesPerPixel);
-                        for (int i = 0; i < _native.ShiftForComponent.Length; i++) { _tmp_layout.ShiftForComponent[i] = Marshal.ReadInt32((IntPtr)_native.ShiftForComponent[i]); }
-                        for (int i = 0; i < _native.BitsForComponent.Length; i++) { _tmp_layout.BitsForComponent[i] = Marshal.ReadInt32((IntPtr)_native.BitsForComponent[i]); }
-                        _tmp_layout.NativePointer = (IntPtr)_native.BytesPerPixel;
+                        _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
+                        _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
+                        _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
+                        _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
+                        _tmp_layout.BitsForComponent = _native.BitsForComponent;
                         return _tmp_layout;
                     }
                     else
@@ -260,10 +276,10 @@
             #region Get GrannyRGBA8888PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA8888PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyRGBA8888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -271,6 +287,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -298,10 +315,10 @@
             #region Get GrannyARGB8888PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyARGB8888PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyARGB8888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -309,6 +326,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -327,6 +345,33 @@
             #endregion
         }
         #endregion
+        #region Pixel Layout: GrannyABGR8888PixelFormat
+        /// <summary>
+        /// 32bpp  8-bit red, 8-bit green, 8-bit blue, 8-bit alpha
+        /// </summary>
+        public static Layout GrannyABGR8888PixelFormat
+        {
+            #region Get GrannyABGR8888PixelFormat Layout
+            get
+            {
+                Layout _tmp_layout = granny_pixel_layouts.GrannyARGB8888PixelFormat;               
+                unsafe
+                {
+                    GCHandle layoutHandle = GCHandle.Alloc(_tmp_layout.BytesPerPixel, GCHandleType.Pinned);                    
+                    _tmp_layout.NativePointer = layoutHandle.AddrOfPinnedObject();
+                    layoutHandle.Free();
+                }            
+                int R = _tmp_layout.ShiftForComponent[1];
+                int B = _tmp_layout.ShiftForComponent[3];
+
+                // swap R & B
+                _tmp_layout.ShiftForComponent[1] = B;
+                _tmp_layout.ShiftForComponent[3] = R;
+                return _tmp_layout;
+            }
+            #endregion
+        }
+        #endregion
         #region Pixel Layout: GrannyBGR555PixelFormat
         /// <summary>
         /// 16bpp  5-bit blue, 5-bit green, 5-bit red
@@ -336,10 +381,10 @@
             #region Get GrannyBGR555PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR555PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGR555PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -347,6 +392,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -374,10 +420,10 @@
             #region Get GrannyBGR565PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR565PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGR565PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -385,6 +431,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -412,10 +459,10 @@
             #region Get GrannyBGRA5551PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA5551PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGRA5551PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -423,6 +470,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -450,10 +498,10 @@
             #region Get GrannyBGRA4444PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA4444PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGRA4444PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -461,6 +509,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -488,10 +537,10 @@
             #region Get GrannyBGR888PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR888PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGR888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -499,6 +548,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -526,10 +576,10 @@
             #region Get GrannyBGRA8888PixelFormat Layout
             get
             {
-                IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
+                IntPtr hdl = coreapi.ExternalSupport.LoadLibrary("granny2.dll");
                 if (hdl != IntPtr.Zero)
                 {
-                    IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA8888PixelFormat");
+                    IntPtr addr = coreapi.ExternalSupport.GetProcAddress(hdl, "GrannyBGRA8888PixelFormat");
                     if (addr != IntPtr.Zero)
                     {
                         gr2lib.core.coretypes.native.Layout _native_ptr;
@@ -537,6 +587,7 @@
                         Layout _tmp_layout = new Layout();
                         _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
                         _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
+                        _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
                         _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
                         _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
                         _tmp_layout.BitsForComponent = _native.BitsForComponent;
@@ -556,4 +607,9 @@
         }
         #endregion
     }
+    #endregion
+
+#if HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS
+#pragma warning restore 1591
+#endif
 }

 

  ViewVC Help
Powered by ViewVC 1.1.22