source: mainline/uspace/lib/fb/imgmap.h@ b73530a

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since b73530a was 7c014d1, checked in by Martin Decky <martin@…>, 14 years ago

console and framebuffer server rewrite

  • Property mode set to 100644
File size: 3.6 KB
RevLine 
[7c014d1]1/*
2 * Copyright (c) 2011 Martin Decky
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * - Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * - Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * - The name of the author may not be used to endorse or promote products
15 * derived from this software without specific prior written permission.
16 *
17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20 * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 */
28
29/** @addtogroup imgmap
30 * @{
31 */
32/**
33 * @file
34 */
35
36#ifndef IMGMAP_IMGMAP_H_
37#define IMGMAP_IMGMAP_H_
38
39#include <sys/types.h>
40#include <abi/fb/visuals.h>
41#include <bool.h>
42#include "fb.h"
43
44typedef enum {
45 IMGMAP_FLAG_NONE = 0,
46 IMGMAP_FLAG_SHARED = 1
47} imgmap_flags_t;
48
49/** Function to render a pixel. */
50typedef void (*pixel2visual_t)(void *, pixel_t);
51
52/** Function to render a bit mask. */
53typedef void (*visual_mask_t)(void *, bool);
54
55/** Function to retrieve a pixel. */
56typedef pixel_t (*visual2pixel_t)(void *);
57
58extern void pixel2rgb_0888(void *, pixel_t);
59extern void pixel2bgr_0888(void *, pixel_t);
60extern void pixel2rgb_8880(void *, pixel_t);
61extern void pixel2bgr_8880(void *, pixel_t);
62extern void pixel2rgb_888(void *, pixel_t);
63extern void pixel2bgr_888(void *, pixel_t);
64extern void pixel2rgb_555_be(void *, pixel_t);
65extern void pixel2rgb_555_le(void *, pixel_t);
66extern void pixel2rgb_565_be(void *, pixel_t);
67extern void pixel2rgb_565_le(void *, pixel_t);
68extern void pixel2bgr_323(void *, pixel_t);
69extern void pixel2gray_8(void *, pixel_t);
70
71extern void visual_mask_0888(void *, bool);
72extern void visual_mask_8880(void *, bool);
73extern void visual_mask_888(void *, bool);
74extern void visual_mask_555(void *, bool);
75extern void visual_mask_565(void *, bool);
76extern void visual_mask_323(void *, bool);
77extern void visual_mask_8(void *, bool);
78
79extern pixel_t rgb_0888_2pixel(void *);
80extern pixel_t bgr_0888_2pixel(void *);
81extern pixel_t rgb_8880_2pixel(void *);
82extern pixel_t bgr_8880_2pixel(void *);
83extern pixel_t rgb_888_2pixel(void *);
84extern pixel_t bgr_888_2pixel(void *);
85extern pixel_t rgb_555_be_2pixel(void *);
86extern pixel_t rgb_555_le_2pixel(void *);
87extern pixel_t rgb_565_be_2pixel(void *);
88extern pixel_t rgb_565_le_2pixel(void *);
89extern pixel_t bgr_323_2pixel(void *);
90extern pixel_t gray_8_2pixel(void *);
91
92extern imgmap_t *imgmap_create(sysarg_t, sysarg_t, visual_t, imgmap_flags_t);
93extern void imgmap_put_pixel(imgmap_t *, sysarg_t, sysarg_t, pixel_t);
94extern pixel_t imgmap_get_pixel(imgmap_t *, sysarg_t, sysarg_t);
95
96extern imgmap_t *imgmap_decode_tga(void *, size_t, imgmap_flags_t);
97extern void imgmap_get_resolution(imgmap_t *, sysarg_t *, sysarg_t *);
98
99#endif
100
101/** @}
102 */
Note: See TracBrowser for help on using the repository browser.