/[gr2lib]/trunk/gr2lib/core/coretypes/implementation/Layout.cs
ViewVC logotype

Contents of /trunk/gr2lib/core/coretypes/implementation/Layout.cs

Parent Directory Parent Directory | Revision Log Revision Log


Revision 72 - (show annotations) (download)
Thu Jul 15 14:22:00 2010 UTC (11 years, 4 months ago) by william
File size: 1171 byte(s)
add: reading of textures

1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4 using gr2lib.core.helpers;
5
6 namespace gr2lib.core.coretypes.implementation
7 {
8 public class Layout
9 {
10 public int BytesPerPixel;
11 public int[] ShiftForComponent = new int[4];//4 values
12 public int[] BitsForComponent = new int[4];//4 values
13
14 public IntPtr NativePointer;
15
16 internal static Layout ReadFromMemory(IntPtr pointer)
17 {
18 if (pointer == IntPtr.Zero) return null;
19 native.Layout native = Helpers.ReadFromMemory<native.Layout>(pointer);
20 Layout managed = ReadFromNative(native);
21 managed.NativePointer = pointer;
22 return managed;
23 }
24
25 internal static Layout ReadFromNative(native.Layout native)
26 {
27 Layout managed = new Layout();
28 managed.BytesPerPixel = native.BytesPerPixel;
29 unsafe
30 {
31 managed.ShiftForComponent = native.ShiftForComponent;
32 managed.BitsForComponent = native.BitsForComponent;
33 }
34 return managed;
35 }
36 }
37 }

  ViewVC Help
Powered by ViewVC 1.1.22