genode/repos/os/include/os/texture.h
Norman Feske ca971bbfd8 Move repositories to 'repos/' subdirectory
This patch changes the top-level directory layout as a preparatory
step for improving the tools for managing 3rd-party source codes.
The rationale is described in the issue referenced below.

Issue #1082
2014-05-14 16:08:00 +02:00

64 lines
1.3 KiB
C++

/*
* \brief Texture representation
* \author Norman Feske
* \date 2013-12-30
*/
/*
* Copyright (C) 2013 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__TEXTURE_H_
#define _INCLUDE__OS__TEXTURE_H_
#include <os/surface.h>
namespace Genode {
class Texture_base;
template <typename PT> class Texture;
}
class Genode::Texture_base
{
private:
Surface_base::Area _size;
public:
Texture_base(Surface_base::Area size) : _size(size) { }
Surface_base::Area size() const { return _size; }
};
template <typename PT>
class Genode::Texture : public Texture_base
{
private:
PT *_pixel;
unsigned char *_alpha;
public:
Texture(PT *pixel, unsigned char *alpha, Surface_base::Area size)
: Texture_base(size), _pixel(pixel), _alpha(alpha) { }
PT *pixel() { return _pixel; }
PT const *pixel() const { return _pixel; }
unsigned char *alpha() { return _alpha; }
unsigned char const *alpha() const { return _alpha; }
/**
* Import rgba data line into texture
*/
void rgba(unsigned char const *rgba, unsigned len, int y);
};
#endif /* _INCLUDE__OS__TEXTURE_H_ */