/[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/22 14:55:47	167
@@ -10,19 +10,34 @@
 
     public enum granny_pixel_layout
     {
+        //GrannyRGB555PixelFormat,
+        //GrannyRGB565PixelFormat,
+        //GrannyRGBA5551PixelFormat,
+        //GrannyRGBA4444PixelFormat,
+        //GrannyRGB888PixelFormat,
+        //GrannyRGBA8888PixelFormat,
+        //GrannyARGB8888PixelFormat,
+        //GrannyBGR555PixelFormat,
+        //GrannyBGR565PixelFormat,
+        //GrannyBGRA5551PixelFormat,
+        //GrannyBGRA4444PixelFormat,
+        //GrannyBGR888PixelFormat,
+        //GrannyBGRA8888PixelFormat
+
+        GrannyBGR555PixelFormat,
+        GrannyBGR565PixelFormat,
+        GrannyBGRA5551PixelFormat,
+        GrannyBGRA4444PixelFormat,
+        GrannyBGR888PixelFormat,
+        GrannyBGRA8888PixelFormat,
         GrannyRGB555PixelFormat,
         GrannyRGB565PixelFormat,
         GrannyRGBA5551PixelFormat,
         GrannyRGBA4444PixelFormat,
         GrannyRGB888PixelFormat,
         GrannyRGBA8888PixelFormat,
-        GrannyARGB8888PixelFormat,
-        GrannyBGR555PixelFormat,
-        GrannyBGR565PixelFormat,
-        GrannyBGRA5551PixelFormat,
-        GrannyBGRA4444PixelFormat,
-        GrannyBGR888PixelFormat,
-        GrannyBGRA8888PixelFormat
+        GrannyARGB8888PixelFormat
+
     }
 
     public struct granny_pixel_layouts
@@ -78,13 +93,15 @@
                     IntPtr addr = coreapi.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
@@ -117,13 +134,15 @@
                     IntPtr addr = coreapi.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
@@ -155,13 +174,15 @@
                     IntPtr addr = coreapi.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
@@ -192,13 +213,15 @@
                     IntPtr addr = coreapi.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
@@ -229,13 +252,15 @@
                     IntPtr addr = coreapi.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
@@ -271,6 +296,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;
@@ -309,6 +335,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;
@@ -347,6 +374,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;
@@ -385,6 +413,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;
@@ -423,6 +452,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;
@@ -461,6 +491,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;
@@ -499,6 +530,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;
@@ -537,6 +569,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;

 

  ViewVC Help
Powered by ViewVC 1.1.22