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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 189 - (show annotations) (download)
Sat Jul 24 04:52:20 2010 UTC (9 years, 4 months ago) by william
File size: 28780 byte(s)
Add Custom Pixel Layout: GrannyABGR8888PixelFormat

1 #define HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS // when defined will disable warnings about missing XML comments for all typedefs (CS1591)
2 using System;
3 using System.Collections.Generic;
4 using System.Linq;
5 using System.Text;
6 using gr2lib.core.coretypes.implementation;
7 using System.Runtime.InteropServices;
8
9 namespace gr2lib.core.typedefs
10 {
11
12 #if HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS
13 #pragma warning disable 1591
14 #endif
15
16 #region public enum granny_pixel_layout
17 public enum granny_pixel_layout
18 {
19 GrannyRGB555PixelFormat,
20 GrannyRGB565PixelFormat,
21 GrannyRGBA5551PixelFormat,
22 GrannyRGBA4444PixelFormat,
23 GrannyRGB888PixelFormat,
24 GrannyRGBA8888PixelFormat,
25 GrannyARGB8888PixelFormat,
26 GrannyBGR555PixelFormat,
27 GrannyBGR565PixelFormat,
28 GrannyBGRA5551PixelFormat,
29 GrannyBGRA4444PixelFormat,
30 GrannyBGR888PixelFormat,
31 GrannyBGRA8888PixelFormat,
32 GrannyABGR8888PixelFormat
33 }
34 #endregion
35
36 #region public struct granny_pixel_layouts
37 public struct granny_pixel_layouts
38 {
39 #region GetPixelLayoutFromEnum(granny_pixel_layout layout_type)
40 public static Layout GetPixelLayoutFromEnum(granny_pixel_layout layout_type)
41 {
42 switch (layout_type)
43 {
44 case granny_pixel_layout.GrannyBGR555PixelFormat: return granny_pixel_layouts.GrannyBGR555PixelFormat;
45 case granny_pixel_layout.GrannyBGR565PixelFormat: return granny_pixel_layouts.GrannyBGR565PixelFormat;
46 case granny_pixel_layout.GrannyBGR888PixelFormat: return granny_pixel_layouts.GrannyBGR888PixelFormat;
47 case granny_pixel_layout.GrannyBGRA4444PixelFormat: return granny_pixel_layouts.GrannyBGRA4444PixelFormat;
48 case granny_pixel_layout.GrannyBGRA5551PixelFormat: return granny_pixel_layouts.GrannyBGRA5551PixelFormat;
49 case granny_pixel_layout.GrannyBGRA8888PixelFormat: return granny_pixel_layouts.GrannyBGRA8888PixelFormat;
50 case granny_pixel_layout.GrannyRGB555PixelFormat: return granny_pixel_layouts.GrannyRGB555PixelFormat;
51 case granny_pixel_layout.GrannyRGB565PixelFormat: return granny_pixel_layouts.GrannyRGB565PixelFormat;
52 case granny_pixel_layout.GrannyRGB888PixelFormat: return granny_pixel_layouts.GrannyRGB888PixelFormat;
53 case granny_pixel_layout.GrannyRGBA4444PixelFormat: return granny_pixel_layouts.GrannyRGBA4444PixelFormat;
54 case granny_pixel_layout.GrannyRGBA5551PixelFormat: return granny_pixel_layouts.GrannyRGBA5551PixelFormat;
55 case granny_pixel_layout.GrannyRGBA8888PixelFormat: return granny_pixel_layouts.GrannyRGBA8888PixelFormat;
56 case granny_pixel_layout.GrannyARGB8888PixelFormat: return granny_pixel_layouts.GrannyARGB8888PixelFormat;
57 default: return granny_pixel_layouts.GrannyDefaultPixelLayout;
58 }
59 }
60 #endregion
61 #region Pixel Layout: GrannyDefaultPixelLayout
62 /// <summary>
63 /// default pixel layout (GrannyRGBA8888PixelFormat)
64 /// </summary>
65 public static Layout GrannyDefaultPixelLayout
66 {
67 #region Get GrannyDefaultPixelLayout
68 get
69 {
70 return GetPixelLayoutFromEnum(granny_pixel_layout.GrannyRGBA8888PixelFormat);
71 }
72 #endregion
73 }
74 #endregion
75 #region Pixel Layout: GrannyRGB555PixelFormat
76 /// <summary>
77 /// 16bpp 5-bit red, 5-bit green, 5-bit blue
78 /// </summary>
79 public static Layout GrannyRGB555PixelFormat
80 {
81 #region Get GrannyRGB555PixelFormat Layout
82 get
83 {
84 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
85 if (hdl != IntPtr.Zero)
86 {
87 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB555PixelFormat");
88 if (addr != IntPtr.Zero)
89 {
90 gr2lib.core.coretypes.native.Layout _native_ptr;
91 gr2lib.core.coretypes.native.Layout _native;
92 Layout _tmp_layout = new Layout();
93 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
94 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
95 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
96 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
97 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
98 _tmp_layout.BitsForComponent = _native.BitsForComponent;
99 return _tmp_layout;
100 }
101 else
102 {
103 return new Layout();
104 }
105 }
106 else
107 {
108 return new Layout();
109 }
110 }
111 #endregion
112 }
113 #endregion
114 #region Pixel Layout: GrannyRGB565PixelFormat
115 /// <summary>
116 /// 16bpp 5-bit red, 6-bit green, 5-bit blue
117 /// </summary>
118 public static Layout GrannyRGB565PixelFormat
119 {
120 #region Get GrannyRGB565PixelFormat Layout
121 get
122 {
123 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
124 if (hdl != IntPtr.Zero)
125 {
126 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB565PixelFormat");
127 if (addr != IntPtr.Zero)
128 {
129 gr2lib.core.coretypes.native.Layout _native_ptr;
130 gr2lib.core.coretypes.native.Layout _native;
131 Layout _tmp_layout = new Layout();
132 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
133 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
134 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
135 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
136 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
137 _tmp_layout.BitsForComponent = _native.BitsForComponent;
138 return _tmp_layout;
139 }
140 else
141 {
142 return new Layout();
143 }
144 }
145 else
146 {
147 return new Layout();
148 }
149 }
150 #endregion
151 }
152 #endregion
153 #region Pixel Layout: GrannyRGBA5551PixelFormat
154 /// <summary>
155 /// 16bpp 5-bit red, 5-bit green, 5-bit blue, 1-bit alpha
156 /// </summary>
157 public static Layout GrannyRGBA5551PixelFormat
158 {
159 #region Get GrannyRGBA5551PixelFormat Layout
160 get
161 {
162 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
163 if (hdl != IntPtr.Zero)
164 {
165 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA5551PixelFormat");
166 if (addr != IntPtr.Zero)
167 {
168 gr2lib.core.coretypes.native.Layout _native_ptr;
169 gr2lib.core.coretypes.native.Layout _native;
170 Layout _tmp_layout = new Layout();
171 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
172 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
173 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
174 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
175 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
176 _tmp_layout.BitsForComponent = _native.BitsForComponent;
177 return _tmp_layout;
178 }
179 else
180 {
181 return new Layout();
182 }
183 }
184 else
185 {
186 return new Layout();
187 }
188 }
189 #endregion
190 }
191 #endregion
192 #region Pixel Layout: GrannyRGBA4444PixelFormat
193 /// <summary>
194 /// 16bpp 4-bit red, 4-bit green, 4-bit blue, 4-bit alpha
195 /// </summary>
196 public static Layout GrannyRGBA4444PixelFormat
197 {
198 #region Get GrannyRGBA4444PixelFormat Layout
199 get
200 {
201 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
202 if (hdl != IntPtr.Zero)
203 {
204 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA4444PixelFormat");
205 if (addr != IntPtr.Zero)
206 {
207 gr2lib.core.coretypes.native.Layout _native_ptr;
208 gr2lib.core.coretypes.native.Layout _native;
209 Layout _tmp_layout = new Layout();
210 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
211 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
212 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
213 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
214 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
215 _tmp_layout.BitsForComponent = _native.BitsForComponent;
216 return _tmp_layout;
217 }
218 else
219 {
220 return new Layout();
221 }
222 }
223 else
224 {
225 return new Layout();
226 }
227 }
228 #endregion
229 }
230 #endregion
231 #region Pixel Layout: GrannyRGB888PixelFormat
232 /// <summary>
233 /// 24bpp 8-bit red, 8-bit green, 8-bit blue
234 /// </summary>
235 public static Layout GrannyRGB888PixelFormat
236 {
237 #region Get GrannyRGB888PixelFormat Layout
238 get
239 {
240 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
241 if (hdl != IntPtr.Zero)
242 {
243 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGB888PixelFormat");
244 if (addr != IntPtr.Zero)
245 {
246 gr2lib.core.coretypes.native.Layout _native_ptr;
247 gr2lib.core.coretypes.native.Layout _native;
248 Layout _tmp_layout = new Layout();
249 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
250 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
251 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
252 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
253 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
254 _tmp_layout.BitsForComponent = _native.BitsForComponent;
255 return _tmp_layout;
256 }
257 else
258 {
259 return new Layout();
260 }
261 }
262 else
263 {
264 return new Layout();
265 }
266 }
267 #endregion
268 }
269 #endregion
270 #region Pixel Layout: GrannyRGBA8888PixelFormat
271 /// <summary>
272 /// 32bpp 8-bit red, 8-bit green, 8-bit blue, 8-bit alpha
273 /// </summary>
274 public static Layout GrannyRGBA8888PixelFormat
275 {
276 #region Get GrannyRGBA8888PixelFormat Layout
277 get
278 {
279 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
280 if (hdl != IntPtr.Zero)
281 {
282 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyRGBA8888PixelFormat");
283 if (addr != IntPtr.Zero)
284 {
285 gr2lib.core.coretypes.native.Layout _native_ptr;
286 gr2lib.core.coretypes.native.Layout _native;
287 Layout _tmp_layout = new Layout();
288 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
289 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
290 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
291 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
292 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
293 _tmp_layout.BitsForComponent = _native.BitsForComponent;
294 return _tmp_layout;
295 }
296 else
297 {
298 return new Layout();
299 }
300 }
301 else
302 {
303 return new Layout();
304 }
305 }
306 #endregion
307 }
308 #endregion
309 #region Pixel Layout: GrannyARGB8888PixelFormat
310 /// <summary>
311 /// 32bpp 8-bit red, 8-bit green, 8-bit blue, 8-bit alpha
312 /// </summary>
313 public static Layout GrannyARGB8888PixelFormat
314 {
315 #region Get GrannyARGB8888PixelFormat Layout
316 get
317 {
318 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
319 if (hdl != IntPtr.Zero)
320 {
321 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyARGB8888PixelFormat");
322 if (addr != IntPtr.Zero)
323 {
324 gr2lib.core.coretypes.native.Layout _native_ptr;
325 gr2lib.core.coretypes.native.Layout _native;
326 Layout _tmp_layout = new Layout();
327 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
328 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
329 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
330 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
331 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
332 _tmp_layout.BitsForComponent = _native.BitsForComponent;
333 return _tmp_layout;
334 }
335 else
336 {
337 return new Layout();
338 }
339 }
340 else
341 {
342 return new Layout();
343 }
344 }
345 #endregion
346 }
347 #endregion
348
349 #region Pixel Layout: GrannyABGR8888PixelFormat
350 /// <summary>
351 /// 32bpp 8-bit red, 8-bit green, 8-bit blue, 8-bit alpha
352 /// </summary>
353 public static Layout GrannyABGR8888PixelFormat
354 {
355 #region Get GrannyABGR8888PixelFormat Layout
356 get
357 {
358 Layout _tmp_layout = granny_pixel_layouts.GrannyARGB8888PixelFormat;
359 unsafe
360 {
361 GCHandle layoutHandle = GCHandle.Alloc(_tmp_layout.BytesPerPixel, GCHandleType.Pinned);
362 _tmp_layout.NativePointer = layoutHandle.AddrOfPinnedObject();
363 layoutHandle.Free();
364 }
365 int R = _tmp_layout.ShiftForComponent[1];
366 int B = _tmp_layout.ShiftForComponent[3];
367
368 // swap R & B
369 _tmp_layout.ShiftForComponent[1] = B;
370 _tmp_layout.ShiftForComponent[3] = R;
371 return _tmp_layout;
372 }
373 #endregion
374 }
375 #endregion
376
377 #region Pixel Layout: GrannyBGR555PixelFormat
378 /// <summary>
379 /// 16bpp 5-bit blue, 5-bit green, 5-bit red
380 /// </summary>
381 public static Layout GrannyBGR555PixelFormat
382 {
383 #region Get GrannyBGR555PixelFormat Layout
384 get
385 {
386 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
387 if (hdl != IntPtr.Zero)
388 {
389 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR555PixelFormat");
390 if (addr != IntPtr.Zero)
391 {
392 gr2lib.core.coretypes.native.Layout _native_ptr;
393 gr2lib.core.coretypes.native.Layout _native;
394 Layout _tmp_layout = new Layout();
395 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
396 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
397 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
398 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
399 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
400 _tmp_layout.BitsForComponent = _native.BitsForComponent;
401 return _tmp_layout;
402 }
403 else
404 {
405 return new Layout();
406 }
407 }
408 else
409 {
410 return new Layout();
411 }
412 }
413 #endregion
414 }
415 #endregion
416 #region Pixel Layout: GrannyBGR565PixelFormat
417 /// <summary>
418 /// 16bpp 5-bit blue, 6-bit green, 5-bit red
419 /// </summary>
420 public static Layout GrannyBGR565PixelFormat
421 {
422 #region Get GrannyBGR565PixelFormat Layout
423 get
424 {
425 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
426 if (hdl != IntPtr.Zero)
427 {
428 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR565PixelFormat");
429 if (addr != IntPtr.Zero)
430 {
431 gr2lib.core.coretypes.native.Layout _native_ptr;
432 gr2lib.core.coretypes.native.Layout _native;
433 Layout _tmp_layout = new Layout();
434 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
435 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
436 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
437 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
438 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
439 _tmp_layout.BitsForComponent = _native.BitsForComponent;
440 return _tmp_layout;
441 }
442 else
443 {
444 return new Layout();
445 }
446 }
447 else
448 {
449 return new Layout();
450 }
451 }
452 #endregion
453 }
454 #endregion
455 #region Pixel Layout: GrannyBGRA5551PixelFormat
456 /// <summary>
457 /// 16bpp 5-bit blue, 5-bit green, 5-bit red, 1-bit alpha
458 /// </summary>
459 public static Layout GrannyBGRA5551PixelFormat
460 {
461 #region Get GrannyBGRA5551PixelFormat Layout
462 get
463 {
464 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
465 if (hdl != IntPtr.Zero)
466 {
467 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA5551PixelFormat");
468 if (addr != IntPtr.Zero)
469 {
470 gr2lib.core.coretypes.native.Layout _native_ptr;
471 gr2lib.core.coretypes.native.Layout _native;
472 Layout _tmp_layout = new Layout();
473 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
474 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
475 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
476 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
477 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
478 _tmp_layout.BitsForComponent = _native.BitsForComponent;
479 return _tmp_layout;
480 }
481 else
482 {
483 return new Layout();
484 }
485 }
486 else
487 {
488 return new Layout();
489 }
490 }
491 #endregion
492 }
493 #endregion
494 #region Pixel Layout: GrannyBGRA4444PixelFormat
495 /// <summary>
496 /// 16bpp 4-bit blue, 4-bit green, 4-bit red, 4-bit alpha
497 /// </summary>
498 public static Layout GrannyBGRA4444PixelFormat
499 {
500 #region Get GrannyBGRA4444PixelFormat Layout
501 get
502 {
503 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
504 if (hdl != IntPtr.Zero)
505 {
506 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA4444PixelFormat");
507 if (addr != IntPtr.Zero)
508 {
509 gr2lib.core.coretypes.native.Layout _native_ptr;
510 gr2lib.core.coretypes.native.Layout _native;
511 Layout _tmp_layout = new Layout();
512 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
513 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
514 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
515 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
516 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
517 _tmp_layout.BitsForComponent = _native.BitsForComponent;
518 return _tmp_layout;
519 }
520 else
521 {
522 return new Layout();
523 }
524 }
525 else
526 {
527 return new Layout();
528 }
529 }
530 #endregion
531 }
532 #endregion
533 #region Pixel Layout: GrannyBGR888PixelFormat
534 /// <summary>
535 /// 24bpp 8-bit blue, 8-bit green, 8-bit red
536 /// </summary>
537 public static Layout GrannyBGR888PixelFormat
538 {
539 #region Get GrannyBGR888PixelFormat Layout
540 get
541 {
542 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
543 if (hdl != IntPtr.Zero)
544 {
545 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGR888PixelFormat");
546 if (addr != IntPtr.Zero)
547 {
548 gr2lib.core.coretypes.native.Layout _native_ptr;
549 gr2lib.core.coretypes.native.Layout _native;
550 Layout _tmp_layout = new Layout();
551 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
552 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
553 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
554 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
555 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
556 _tmp_layout.BitsForComponent = _native.BitsForComponent;
557 return _tmp_layout;
558 }
559 else
560 {
561 return new Layout();
562 }
563 }
564 else
565 {
566 return new Layout();
567 }
568 }
569 #endregion
570 }
571 #endregion
572 #region Pixel Layout: GrannyBGRA8888PixelFormat
573 /// <summary>
574 /// 32bpp 8-bit blue, 8-bit green, 8-bit red, 8-bit alpha
575 /// </summary>
576 public static Layout GrannyBGRA8888PixelFormat
577 {
578 #region Get GrannyBGRA8888PixelFormat Layout
579 get
580 {
581 IntPtr hdl = coreapi.LoadLibrary("granny2.dll");
582 if (hdl != IntPtr.Zero)
583 {
584 IntPtr addr = coreapi.GetProcAddress(hdl, "GrannyBGRA8888PixelFormat");
585 if (addr != IntPtr.Zero)
586 {
587 gr2lib.core.coretypes.native.Layout _native_ptr;
588 gr2lib.core.coretypes.native.Layout _native;
589 Layout _tmp_layout = new Layout();
590 _native_ptr = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure(addr, typeof(gr2lib.core.coretypes.native.Layout));
591 _native = (gr2lib.core.coretypes.native.Layout)Marshal.PtrToStructure((IntPtr)_native_ptr.BytesPerPixel, typeof(gr2lib.core.coretypes.native.Layout));
592 _tmp_layout.NativePointer = (IntPtr)_native_ptr.BytesPerPixel;
593 _tmp_layout.BytesPerPixel = _native.BytesPerPixel;
594 _tmp_layout.ShiftForComponent = _native.ShiftForComponent;
595 _tmp_layout.BitsForComponent = _native.BitsForComponent;
596 return _tmp_layout;
597 }
598 else
599 {
600 return new Layout();
601 }
602 }
603 else
604 {
605 return new Layout();
606 }
607 }
608 #endregion
609 }
610 #endregion
611 }
612 #endregion
613
614 #if HIDE_MISSING_XML_COMMENTS_FOR_TYPEDEFS
615 #pragma warning restore 1591
616 #endif
617 }

  ViewVC Help
Powered by ViewVC 1.1.22