bitmap.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * GRUB -- GRand Unified Bootloader
  3. * Copyright (C) 2006,2007 Free Software Foundation, Inc.
  4. *
  5. * GRUB is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * GRUB is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef GRUB_BITMAP_HEADER
  19. #define GRUB_BITMAP_HEADER 1
  20. #include <grub/err.h>
  21. #include <grub/symbol.h>
  22. #include <grub/types.h>
  23. #include <grub/video.h>
  24. struct grub_video_bitmap
  25. {
  26. /* Bitmap format description. */
  27. struct grub_video_mode_info mode_info;
  28. /* Pointer to bitmap data formatted according to mode_info. */
  29. void *data;
  30. int transparent;
  31. };
  32. struct grub_video_bitmap_reader
  33. {
  34. /* File extension for this bitmap type (including dot). */
  35. const char *extension;
  36. /* Reader function to load bitmap. */
  37. grub_err_t (*reader) (struct grub_video_bitmap **bitmap,
  38. const char *filename);
  39. /* Next reader. */
  40. struct grub_video_bitmap_reader *next;
  41. };
  42. typedef struct grub_video_bitmap_reader *grub_video_bitmap_reader_t;
  43. void EXPORT_FUNC (grub_video_bitmap_reader_register) (grub_video_bitmap_reader_t reader);
  44. void EXPORT_FUNC (grub_video_bitmap_reader_unregister) (grub_video_bitmap_reader_t reader);
  45. grub_err_t EXPORT_FUNC (grub_video_bitmap_create) (struct grub_video_bitmap **bitmap,
  46. unsigned int width, unsigned int height,
  47. enum grub_video_blit_format blit_format);
  48. grub_err_t EXPORT_FUNC (grub_video_bitmap_destroy) (struct grub_video_bitmap *bitmap);
  49. grub_err_t EXPORT_FUNC (grub_video_bitmap_load) (struct grub_video_bitmap **bitmap,
  50. const char *filename);
  51. unsigned int EXPORT_FUNC (grub_video_bitmap_get_width) (struct grub_video_bitmap *bitmap);
  52. unsigned int EXPORT_FUNC (grub_video_bitmap_get_height) (struct grub_video_bitmap *bitmap);
  53. void EXPORT_FUNC (grub_video_bitmap_get_mode_info) (struct grub_video_bitmap *bitmap,
  54. struct grub_video_mode_info *mode_info);
  55. void *EXPORT_FUNC (grub_video_bitmap_get_data) (struct grub_video_bitmap *bitmap);
  56. #endif /* ! GRUB_BITMAP_HEADER */