bitmap_scale.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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. /* Choose the fastest interpolation algorithm. */
  25. #define GRUB_VIDEO_BITMAP_SCALE_METHOD_FASTEST 0
  26. /* Choose the highest quality interpolation algorithm. */
  27. #define GRUB_VIDEO_BITMAP_SCALE_METHOD_BEST 1
  28. /* Specific algorithms: */
  29. /* Nearest neighbor interpolation. */
  30. #define GRUB_VIDEO_BITMAP_SCALE_METHOD_NEAREST 2
  31. /* Bilinear interpolation. */
  32. #define GRUB_VIDEO_BITMAP_SCALE_METHOD_BILINEAR 3
  33. #define GRUB_VIDEO_BITMAP_SCALE_METHOD_MASK 0xf
  34. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_NORMAL 0
  35. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_CENTER 0x10
  36. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_TILING 0x20
  37. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_MINFIT 0x30
  38. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_MAXFIT 0x40
  39. #define GRUB_VIDEO_BITMAP_SCALE_TYPE_MASK 0xf0
  40. grub_err_t
  41. grub_video_bitmap_create_scaled (struct grub_video_bitmap **dst,
  42. int dst_width, int dst_height,
  43. struct grub_video_bitmap *src,
  44. int scale, grub_video_color_t color);
  45. #endif /* ! GRUB_BITMAP_SCALE_HEADER */