bitmap_scale.h 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. /* bitmap_scale.h - Bitmap scaling functions. */
  2. /*
  3. * GRUB -- GRand Unified Bootloader
  4. * Copyright (C) 2008,2009 Free Software Foundation, Inc.
  5. *
  6. * GRUB is free software: you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation, either version 3 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * GRUB is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with GRUB. If not, see <http://www.gnu.org/licenses/>.
  18. */
  19. #ifndef GRUB_BITMAP_SCALE_HEADER
  20. #define GRUB_BITMAP_SCALE_HEADER 1
  21. #include <grub/err.h>
  22. #include <grub/types.h>
  23. #include <grub/bitmap_scale.h>
  24. enum grub_video_bitmap_scale_method
  25. {
  26. /* Choose the fastest interpolation algorithm. */
  27. GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST,
  28. /* Choose the highest quality interpolation algorithm. */
  29. GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST,
  30. /* Specific algorithms: */
  31. /* Nearest neighbor interpolation. */
  32. GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST,
  33. /* Bilinear interpolation. */
  34. GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR
  35. };
  36. typedef enum grub_video_bitmap_selection_method
  37. {
  38. GRUB_VIDEO_BITMAP_SELECTION_METHOD_STRETCH,
  39. GRUB_VIDEO_BITMAP_SELECTION_METHOD_CROP,
  40. GRUB_VIDEO_BITMAP_SELECTION_METHOD_PADDING,
  41. GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITWIDTH,
  42. GRUB_VIDEO_BITMAP_SELECTION_METHOD_FITHEIGHT
  43. } grub_video_bitmap_selection_method_t;
  44. typedef enum grub_video_bitmap_v_align
  45. {
  46. GRUB_VIDEO_BITMAP_V_ALIGN_TOP,
  47. GRUB_VIDEO_BITMAP_V_ALIGN_CENTER,
  48. GRUB_VIDEO_BITMAP_V_ALIGN_BOTTOM
  49. } grub_video_bitmap_v_align_t;
  50. typedef enum grub_video_bitmap_h_align
  51. {
  52. GRUB_VIDEO_BITMAP_H_ALIGN_LEFT,
  53. GRUB_VIDEO_BITMAP_H_ALIGN_CENTER,
  54. GRUB_VIDEO_BITMAP_H_ALIGN_RIGHT
  55. } grub_video_bitmap_h_align_t;
  56. grub_err_t
  57. EXPORT_FUNC (grub_video_bitmap_create_scaled) (struct grub_video_bitmap **dst,
  58. int dst_width, int dst_height,
  59. struct grub_video_bitmap *src,
  60. enum
  61. grub_video_bitmap_scale_method
  62. scale_method);
  63. grub_err_t
  64. EXPORT_FUNC (grub_video_bitmap_scale_proportional)
  65. (struct grub_video_bitmap **dst,
  66. int dst_width, int dst_height,
  67. struct grub_video_bitmap *src,
  68. enum grub_video_bitmap_scale_method
  69. scale_method,
  70. grub_video_bitmap_selection_method_t
  71. selection_method,
  72. grub_video_bitmap_v_align_t v_align,
  73. grub_video_bitmap_h_align_t h_align);
  74. #endif /* ! GRUB_BITMAP_SCALE_HEADER */