The Pedigree Project
0.1
src
system
include
pedigree
kernel
machine
Display.h
1
/*
2
* Copyright (c) 2008-2014, Pedigree Developers
3
*
4
* Please see the CONTRIB file in the root of the source tree for a full
5
* list of contributors.
6
*
7
* Permission to use, copy, modify, and distribute this software for any
8
* purpose with or without fee is hereby granted, provided that the above
9
* copyright notice and this permission notice appear in all copies.
10
*
11
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
12
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
13
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
14
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
15
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
16
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
17
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
*/
19
20
#ifndef MACHINE_DISPLAY_H
21
#define MACHINE_DISPLAY_H
22
23
#include "pedigree/kernel/compiler.h"
24
#include "pedigree/kernel/graphics/Graphics.h"
25
#include "pedigree/kernel/machine/Device.h"
26
#include "pedigree/kernel/processor/types.h"
27
#include "pedigree/kernel/utilities/List.h"
28
29
class
String
;
30
45
class
EXPORTED_PUBLIC
Display
:
public
Device
{
46
public
:
48
struct
rgb_t
{
49
uint8_t r, g, b, a;
50
}
PACKED
;
51
53
struct
PixelFormat
{
54
uint8_t
mRed
;
55
uint8_t
pRed
;
56
uint8_t
mGreen
;
57
uint8_t
pGreen
;
58
uint8_t
mBlue
;
59
uint8_t
pBlue
;
60
uint8_t
mAlpha
;
61
uint8_t
pAlpha
;
62
uint8_t
nBpp
;
63
uint32_t
nPitch
;
64
};
65
67
struct
ScreenMode
{
68
ScreenMode
();
69
70
uint32_t id;
71
uint32_t width;
72
uint32_t height;
73
uint32_t refresh;
74
uintptr_t framebuffer;
75
PixelFormat
pf;
76
77
Graphics::PixelFormat pf2;
78
uint32_t bytesPerLine;
79
uint32_t bytesPerPixel;
80
81
bool
textMode;
// is a text mode, not a graphics mode
82
};
83
84
Display
();
85
Display
(
Device
* p);
86
virtual
~Display
();
87
88
virtual
Type
getType
();
89
90
virtual
void
getName
(
String
& str);
91
92
virtual
void
dump
(
String
& str);
93
97
virtual
void
* getFramebuffer();
98
102
virtual
rgb_t
* newBuffer();
103
105
virtual
void
setCurrentBuffer(
rgb_t
* pBuffer);
106
113
virtual
void
updateBuffer(
rgb_t
* pBuffer,
size_t
x1 = ~0UL,
size_t
y1 = ~0UL,
size_t
x2 = ~0UL,
114
size_t
y2 = ~0UL);
115
118
virtual
void
killBuffer(
rgb_t
* pBuffer);
119
122
virtual
void
bitBlit(
rgb_t
* pBuffer,
size_t
fromX,
size_t
fromY,
size_t
toX,
size_t
toY,
123
size_t
width,
size_t
height);
124
127
virtual
void
fillRectangle(
rgb_t
* pBuffer,
size_t
x,
size_t
y,
size_t
width,
size_t
height,
128
rgb_t
colour);
129
132
virtual
bool
getPixelFormat(
PixelFormat
& pf);
133
136
virtual
bool
getCurrentScreenMode(
ScreenMode
& sm);
137
140
virtual
bool
getScreenModes(
List<ScreenMode*>
& sms);
141
144
virtual
bool
setScreenMode(
ScreenMode
sm);
145
148
virtual
bool
setScreenMode(
size_t
modeId);
149
151
virtual
bool
setScreenMode(
size_t
nWidth,
size_t
nHeight,
size_t
nBpp);
152
};
153
154
#endif
Device
Definition
Device.h:41
Device::dump
virtual void dump(String &str)
Definition
Device.h:261
Device::Type
Type
Definition
Device.h:72
Device::Display
@ Display
Definition
Device.h:78
Device::getName
virtual void getName(String &str)
Definition
Device.cc:130
Device::getType
virtual Type getType()
Definition
Device.h:178
Display
Definition
Display.h:45
List
Definition
List.h:61
String
Definition
String.h:43
PACKED
#define PACKED
Definition
system/include/pedigree/kernel/compiler.h:48
Display::PixelFormat
Definition
Display.h:53
Display::PixelFormat::pAlpha
uint8_t pAlpha
Position of the alpha field.
Definition
Display.h:61
Display::PixelFormat::pBlue
uint8_t pBlue
Position of blue field.
Definition
Display.h:59
Display::PixelFormat::mAlpha
uint8_t mAlpha
Alpha mask.
Definition
Display.h:60
Display::PixelFormat::mRed
uint8_t mRed
Red mask.
Definition
Display.h:54
Display::PixelFormat::mGreen
uint8_t mGreen
Green mask.
Definition
Display.h:56
Display::PixelFormat::nBpp
uint8_t nBpp
Bits per pixel (total).
Definition
Display.h:62
Display::PixelFormat::pRed
uint8_t pRed
Position of red field.
Definition
Display.h:55
Display::PixelFormat::nPitch
uint32_t nPitch
Bytes per scanline.
Definition
Display.h:63
Display::PixelFormat::pGreen
uint8_t pGreen
Position of green field.
Definition
Display.h:57
Display::PixelFormat::mBlue
uint8_t mBlue
Blue mask.
Definition
Display.h:58
Display::ScreenMode
Definition
Display.h:67
Display::rgb_t
Definition
Display.h:48
Generated on Sat Oct 3 2026 06:38:07 for The Pedigree Project by
1.9.8