vaseboot/include/VasEBoot/video_fb.h

152 lines
5.6 KiB
C

/*
* VAS_EBOOT -- GRand Unified Bootloader
* Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc.
*
* VAS_EBOOT is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* VAS_EBOOT is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with VAS_EBOOT. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef VAS_EBOOT_VIDEO_FB_HEADER
#define VAS_EBOOT_VIDEO_FB_HEADER 1
#include <VasEBoot/symbol.h>
#include <VasEBoot/types.h>
#include <VasEBoot/err.h>
#include <VasEBoot/video.h>
/* FB module internal prototype (should not be used from elsewhere). */
struct VasEBoot_video_fbblit_info;
struct VasEBoot_video_fbrender_target;
#define VAS_EBOOT_VIDEO_FBSTD_NUMCOLORS 16
#define VAS_EBOOT_VIDEO_FBSTD_EXT_NUMCOLORS 256
extern struct VasEBoot_video_palette_data EXPORT_VAR(VasEBoot_video_fbstd_colors)[VAS_EBOOT_VIDEO_FBSTD_EXT_NUMCOLORS];
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_init) (void);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_fini) (void);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_info) (struct VasEBoot_video_mode_info *mode_info);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_palette) (unsigned int start, unsigned int count,
struct VasEBoot_video_palette_data *palette_data);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_set_palette) (unsigned int start, unsigned int count,
struct VasEBoot_video_palette_data *palette_data);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_set_viewport) (unsigned int x, unsigned int y,
unsigned int width, unsigned int height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_viewport) (unsigned int *x, unsigned int *y,
unsigned int *width,
unsigned int *height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_set_region) (unsigned int x, unsigned int y,
unsigned int width, unsigned int height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_region) (unsigned int *x, unsigned int *y,
unsigned int *width,
unsigned int *height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_set_area_status)
(VasEBoot_video_area_status_t area_status);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_area_status)
(VasEBoot_video_area_status_t *area_status);
VasEBoot_video_color_t
EXPORT_FUNC(VasEBoot_video_fb_map_color) (VasEBoot_uint32_t color_name);
VasEBoot_video_color_t
EXPORT_FUNC(VasEBoot_video_fb_map_rgb) (VasEBoot_uint8_t red, VasEBoot_uint8_t green,
VasEBoot_uint8_t blue);
VasEBoot_video_color_t
EXPORT_FUNC(VasEBoot_video_fb_map_rgba) (VasEBoot_uint8_t red, VasEBoot_uint8_t green,
VasEBoot_uint8_t blue, VasEBoot_uint8_t alpha);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_unmap_color) (VasEBoot_video_color_t color,
VasEBoot_uint8_t *red, VasEBoot_uint8_t *green,
VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha);
void
VasEBoot_video_fb_unmap_color_int (struct VasEBoot_video_fbblit_info * source,
VasEBoot_video_color_t color,
VasEBoot_uint8_t *red, VasEBoot_uint8_t *green,
VasEBoot_uint8_t *blue, VasEBoot_uint8_t *alpha);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_fill_rect) (VasEBoot_video_color_t color, int x, int y,
unsigned int width, unsigned int height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_blit_bitmap) (struct VasEBoot_video_bitmap *bitmap,
enum VasEBoot_video_blit_operators oper, int x, int y,
int offset_x, int offset_y,
unsigned int width, unsigned int height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_blit_render_target) (struct VasEBoot_video_fbrender_target *source,
enum VasEBoot_video_blit_operators oper,
int x, int y, int offset_x, int offset_y,
unsigned int width, unsigned int height);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_scroll) (VasEBoot_video_color_t color, int dx, int dy);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_create_render_target) (struct VasEBoot_video_fbrender_target **result,
unsigned int width, unsigned int height,
unsigned int mode_type __attribute__ ((unused)));
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_create_render_target_from_pointer) (struct VasEBoot_video_fbrender_target **result,
const struct VasEBoot_video_mode_info *mode_info,
void *ptr);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_delete_render_target) (struct VasEBoot_video_fbrender_target *target);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_get_active_render_target) (struct VasEBoot_video_fbrender_target **target);
VasEBoot_err_t
EXPORT_FUNC(VasEBoot_video_fb_set_active_render_target) (struct VasEBoot_video_fbrender_target *target);
typedef VasEBoot_err_t (*VasEBoot_video_fb_set_page_t) (int page);
VasEBoot_err_t
EXPORT_FUNC (VasEBoot_video_fb_setup) (unsigned int mode_type, unsigned int mode_mask,
struct VasEBoot_video_mode_info *mode_info,
volatile void *page0_ptr,
VasEBoot_video_fb_set_page_t set_page_in,
volatile void *page1_ptr);
VasEBoot_err_t
EXPORT_FUNC (VasEBoot_video_fb_swap_buffers) (void);
VasEBoot_err_t
EXPORT_FUNC (VasEBoot_video_fb_get_info_and_fini) (struct VasEBoot_video_mode_info *mode_info,
void **framebuf);
#endif /* ! VAS_EBOOT_VIDEO_FB_HEADER */