2N/A * GRUB -- GRand Unified Bootloader 2N/A * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. 2N/A * GRUB is free software: you can redistribute it and/or modify 2N/A * it under the terms of the GNU General Public License as published by 2N/A * the Free Software Foundation, either version 3 of the License, or 2N/A * (at your option) any later version. 2N/A * GRUB is distributed in the hope that it will be useful, 2N/A * but WITHOUT ANY WARRANTY; without even the implied warranty of 2N/A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 2N/A * GNU General Public License for more details. 2N/A * You should have received a copy of the GNU General Public License 2N/A/* Prototypes for module-local functions. */ 2N/A/* This function creates a new scaled version of the bitmap SRC. The new 2N/A bitmap has dimensions DST_WIDTH by DST_HEIGHT. The scaling algorithm 2N/A is given by SCALE_METHOD. If an error is encountered, the return code is 2N/A not equal to GRUB_ERR_NONE, and the bitmap DST is either not created, or 2N/A it is destroyed before this function returns. 2N/A Supports only direct color modes which have components separated 2N/A into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). 2N/A But because of this simplifying assumption, the implementation is 2N/A greatly simplified. */ 2N/A /* Verify the simplifying assumptions. */ 2N/A "null src bitmap in grub_video_bitmap_create_scaled");
2N/A "src format not supported for scale");
2N/A "source bitmap has a zero dimension");
2N/A "requested to scale to a size w/ a zero dimension");
2N/A "bitmap to scale has inconsistent Bpp and bpp");
2N/A /* Create the new bitmap. */ 2N/A /* Success: *dst is now a pointer to the scaled bitmap. */ 2N/A /* Destroy the bitmap and return the error code. */ 2N/A/* Nearest neighbor bitmap scaling algorithm. 2N/A Copy the bitmap SRC to the bitmap DST, scaling the bitmap to fit the 2N/A dimensions of DST. This function uses the nearest neighbor algorithm to 2N/A interpolate the pixels. 2N/A Supports only direct color modes which have components separated 2N/A into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). 2N/A But because of this simplifying assumption, the implementation is 2N/A greatly simplified. */ 2N/A /* Verify the simplifying assumptions. */ 2N/A /* bytes_per_pixel is the same for both src and dst. */ 2N/A /* Compute the source coordinate that the destination coordinate 2N/A /* Get the address of the pixels in src and dst. */ 2N/A /* Copy the pixel color value. */ 2N/A/* Bilinear interpolation image scaling algorithm. 2N/A Copy the bitmap SRC to the bitmap DST, scaling the bitmap to fit the 2N/A dimensions of DST. This function uses the bilinear interpolation algorithm 2N/A to interpolate the pixels. 2N/A Supports only direct color modes which have components separated 2N/A into bytes (e.g., RGBA 8:8:8:8 or BGR 8:8:8 true color). 2N/A But because of this simplifying assumption, the implementation is 2N/A greatly simplified. */ 2N/A /* Verify the simplifying assumptions. */ 2N/A /* bytes_per_pixel is the same for both src and dst. */ 2N/A /* Compute the source coordinate that the destination coordinate 2N/A /* Get the address of the pixels in src and dst. */ 2N/A /* If we have enough space to do so, use bilinear interpolation. 2N/A Otherwise, fall back to nearest neighbor for this pixel. */ 2N/A /* Do bilinear interpolation. */ 2N/A /* Fixed-point .8 numbers representing the fraction of the 2N/A distance in the x (u) and y (v) direction within the 2N/A box of 4 pixels in the source. */ 2N/A /* Get the component's values for the 2N/A four source corner pixels. */ 2N/A /* Do linear interpolations along the top and bottom 2N/A /* Interpolate vertically. */ 2N/A /* Fall back to nearest neighbor interpolation. */ 2N/A /* Copy the pixel color value. */