mirror of
https://github.com/genodelabs/genode.git
synced 2025-04-09 04:15:52 +00:00
os: define ALPHA8 pixel format
This commit is contained in:
parent
a7fa0ccd06
commit
b01c74ae12
39
repos/os/include/os/pixel_alpha8.h
Normal file
39
repos/os/include/os/pixel_alpha8.h
Normal file
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* \brief Template specializations for the ALPHA8 pixel format
|
||||
* \author Norman Feske
|
||||
* \date 2014-09-10
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2014 Genode Labs GmbH
|
||||
*
|
||||
* This file is part of the Genode OS framework, which is distributed
|
||||
* under the terms of the GNU General Public License version 2.
|
||||
*/
|
||||
|
||||
#ifndef _INCLUDE__OS__PIXEL_ALPHA8_H_
|
||||
#define _INCLUDE__OS__PIXEL_ALPHA8_H_
|
||||
|
||||
#include <os/pixel_rgba.h>
|
||||
|
||||
namespace Genode {
|
||||
|
||||
typedef Genode::Pixel_rgba<unsigned char, Genode::Surface_base::ALPHA8,
|
||||
0, 0, 0, 0, 0, 0, 0xff, 0>
|
||||
Pixel_alpha8;
|
||||
|
||||
|
||||
/*
|
||||
* The second pixel parameter is ignored. It can be of any pixel type.
|
||||
*/
|
||||
template <>
|
||||
template <typename PT>
|
||||
inline Pixel_alpha8 Pixel_alpha8::mix(Pixel_alpha8 p1, PT, int alpha)
|
||||
{
|
||||
Pixel_alpha8 res;
|
||||
res.pixel = p1.pixel + (((255 - p1.pixel)*alpha) >> 8);
|
||||
return res;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* _INCLUDE__OS__PIXEL_ALPHA8_H_ */
|
@ -37,7 +37,7 @@ class Genode::Surface_base
|
||||
typedef Genode::Rect<> Rect;
|
||||
typedef Genode::Color Color;
|
||||
|
||||
enum Pixel_format { UNKNOWN, RGB565, RGB888 };
|
||||
enum Pixel_format { UNKNOWN, RGB565, RGB888, ALPHA8 };
|
||||
|
||||
struct Flusher
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user