1 |
william |
72 |
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 Pixel |
9 |
|
|
{ |
10 |
|
|
public byte UInt8; |
11 |
|
|
|
12 |
|
|
public IntPtr NativePointer; |
13 |
|
|
|
14 |
|
|
internal static Pixel ReadFromMemory(IntPtr pointer) |
15 |
|
|
{ |
16 |
|
|
if (pointer == IntPtr.Zero) return null; |
17 |
|
|
native.Pixel native = Helpers.ReadFromMemory<native.Pixel>(pointer); |
18 |
|
|
Pixel managed = ReadFromNative(native); |
19 |
|
|
managed.NativePointer = pointer; |
20 |
|
|
return managed; |
21 |
|
|
} |
22 |
|
|
|
23 |
|
|
internal static Pixel ReadFromNative(native.Pixel native) |
24 |
|
|
{ |
25 |
|
|
Pixel managed = new Pixel(); |
26 |
|
|
managed.UInt8 = native.UInt8; |
27 |
|
|
return managed; |
28 |
|
|
} |
29 |
|
|
} |
30 |
|
|
} |