Loading...
Searching...
No Matches
colors.h
Go to the documentation of this file.
/*
* (c) 2008-2009 Adam Lackorzynski <adam@os.inf.tu-dresden.de>
* economic rights: Technische Universität Dresden (Germany)
*
* License: see LICENSE.spdx (in this directory or the directories above)
*/
#pragma once
#include <l4/sys/compiler.h>
typedef struct l4re_video_color_component_t
{
unsigned char size;
unsigned char shift;
} __attribute__((packed)) l4re_video_color_component_t;
typedef struct l4re_video_pixel_info_t
{
l4re_video_color_component_t r, g, b, a;
unsigned char bytes_per_pixel;
} l4re_video_pixel_info_t;
L4_BEGIN_DECLS
L4_INLINE L4_CV int
l4re_video_bits_per_pixel(l4re_video_pixel_info_t *p) L4_NOTHROW;
/* ************************************************************** */
/* Implementations */
L4_INLINE L4_CV int
l4re_video_bits_per_pixel(l4re_video_pixel_info_t *p) L4_NOTHROW
{
return p->r.size + p->b.size + p->g.size + p->a.size;
}
L4_END_DECLS
compiler.h
L4 compiler related defines.
L4_CV
#define L4_CV
Define calling convention.
Definition linkage.h:33
L4_NOTHROW
#define L4_NOTHROW
Mark a function declaration and definition as never throwing an exception.
Definition compiler.h:161
L4_INLINE
#define L4_INLINE
L4 Inline function attribute.
Definition compiler.h:51
L4_BEGIN_DECLS
#define L4_BEGIN_DECLS
Start section with C types and functions.
Definition compiler.h:165
L4_END_DECLS
#define L4_END_DECLS
End section with C types and functions.
Definition compiler.h:166
l4re_video_color_component_t
Color component structure.
Definition colors.h:21
l4re_video_color_component_t::size
unsigned char size
Size in bits.
Definition colors.h:22
l4re_video_color_component_t::shift
unsigned char shift
offset in pixel
Definition colors.h:23
l4re_video_pixel_info_t
Pixel_info structure.
Definition colors.h:31
l4re_video_pixel_info_t::a
l4re_video_color_component_t a
Colors.
Definition colors.h:32
l4re_video_pixel_info_t::bytes_per_pixel
unsigned char bytes_per_pixel
Bytes per pixel.
Definition colors.h:33