ReactOS 0.4.16-dev-2122-g1628f5e
vidfb.h
Go to the documentation of this file.
1/*
2 * PROJECT: FreeLoader
3 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
4 * PURPOSE: Video support for linear framebuffers
5 * COPYRIGHT: Copyright 2025 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
6 */
7
8#pragma once
9
10#include "twidbits.h"
11
21typedef struct _PIXEL_BITMASK
22{
28
29
42 _In_ ULONG RedMask,
43 _In_ ULONG GreenMask,
44 _In_ ULONG BlueMask,
45 _In_ ULONG ReservedMask)
46{
47 ULONG CompoundMask = (RedMask | GreenMask | BlueMask | ReservedMask);
48 /* Alternatively, the calculation could be done by finding the highest
49 * bit set in the combined pixel color masks, if they are packed together. */
50 return CountNumberOfBits(CompoundMask); // FindHighestSetBit(CompoundMask);
51}
52
59 _In_ UINT32 PixelsPerScanLine,
60 _In_ UINT32 BitsPerPixel,
61 _In_opt_ PPIXEL_BITMASK PixelMasks);
62
63VOID
66 _In_ BOOLEAN FullScreen);
67
68VOID
70 _In_ UCHAR Char,
71 _In_ ULONG X,
72 _In_ ULONG Y,
73 _In_ UINT32 FgColor,
74 _In_ UINT32 BgColor);
75
76VOID
81
84
85VOID
88 _In_ ULONG Scroll);
89
90#if 0
91VOID
92VidFbSetTextCursorPosition(UCHAR X, UCHAR Y);
93
94VOID
95VidFbHideShowTextCursor(BOOLEAN Show);
96
98VidFbIsPaletteFixed(VOID);
99
100VOID
101VidFbSetPaletteColor(
104
105VOID
106VidFbGetPaletteColor(
109#endif
110
111
112
113/*
114 * PROJECT: FreeLoader
115 * LICENSE: GPL-2.0-or-later (https://spdx.org/licenses/GPL-2.0-or-later)
116 * or MIT (https://spdx.org/licenses/MIT)
117 * PURPOSE: Linear framebuffer based console support
118 * COPYRIGHT: Copyright 2025 Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
119 */
120
121#pragma once
122
123VOID
125 _In_ UCHAR Attr);
126
127VOID
129 _In_ UCHAR Char,
130 _In_ ULONG Column,
131 _In_ ULONG Row,
132 _In_ UINT32 FgColor,
133 _In_ UINT32 BgColor);
134
135VOID
137 _In_ UCHAR Char,
138 _In_ UCHAR Attr,
139 _In_ ULONG Column,
140 _In_ ULONG Row);
141
142VOID
147
148ULONG
150
151VOID
154
155VOID
157 _In_ UCHAR Attr);
unsigned char BOOLEAN
unsigned int UINT32
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
Definition: bufpool.h:45
#define Y(I)
_In_ HANDLE _Outptr_result_bytebuffer_ ViewSize PVOID * BaseAddress
Definition: mmfuncs.h:404
#define _Out_
Definition: no_sal2.h:160
#define _In_
Definition: no_sal2.h:158
#define _In_opt_
Definition: no_sal2.h:212
static ULONG ScreenWidth
Definition: pcvideo.c:116
static ULONG ScreenHeight
Definition: pcvideo.c:117
Physical format of an RGB pixel, specified with per-component bit-masks. A bit being set defines thos...
Definition: vidfb.h:22
ULONG RedMask
Definition: vidfb.h:23
ULONG BlueMask
Definition: vidfb.h:25
ULONG GreenMask
Definition: vidfb.h:24
ULONG ReservedMask
Definition: vidfb.h:26
FORCEINLINE ULONG CountNumberOfBits(_In_ UINT32 n)
Return the number of bits set in a 32-bit integer.
Definition: twidbits.h:22
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:89
_In_ HFONT _Out_ PUINT Height
Definition: font.h:88
VOID FbConsScrollUp(_In_ UCHAR Attr)
Definition: vidfb.c:477
VOID FbConsClearScreen(_In_ UCHAR Attr)
Definition: vidfb.c:377
VOID FbConsGetDisplaySize(_Out_ PULONG Width, _Out_ PULONG Height, _Out_ PULONG Depth)
Returns the width and height in number of CGA characters/attributes, of a full text-mode CGA-style ch...
Definition: vidfb.c:426
FORCEINLINE ULONG PixelBitmasksToBpp(_In_ ULONG RedMask, _In_ ULONG GreenMask, _In_ ULONG BlueMask, _In_ ULONG ReservedMask)
Calculates the number of bits per pixel ("PixelDepth") for the given pixel format,...
Definition: vidfb.h:41
ULONG VidFbGetBufferSize(VOID)
Returns the size in bytes, of a full graphics pixel buffer rectangle that can fill the whole visible ...
Definition: vidfb.c:274
VOID VidFbClearScreenColor(_In_ UINT32 Color, _In_ BOOLEAN FullScreen)
Definition: vidfb.c:194
VOID VidFbScrollUp(_In_ UINT32 Color, _In_ ULONG Scroll)
Definition: vidfb.c:281
ULONG FbConsGetBufferSize(VOID)
Returns the size in bytes, of a full text-mode CGA-style character buffer rectangle that can fill the...
Definition: vidfb.c:445
struct _PIXEL_BITMASK * PPIXEL_BITMASK
struct _PIXEL_BITMASK PIXEL_BITMASK
Physical format of an RGB pixel, specified with per-component bit-masks. A bit being set defines thos...
BOOLEAN VidFbInitializeVideo(_In_ ULONG_PTR BaseAddress, _In_ ULONG BufferSize, _In_ UINT32 ScreenWidth, _In_ UINT32 ScreenHeight, _In_ UINT32 PixelsPerScanLine, _In_ UINT32 BitsPerPixel, _In_opt_ PPIXEL_BITMASK PixelMasks)
Initializes internal framebuffer information based on the given parameters.
Definition: vidfb.c:97
VOID FbConsPutChar(_In_ UCHAR Char, _In_ UCHAR Attr, _In_ ULONG Column, _In_ ULONG Row)
Displays a character with specific text attributes at a given position.
Definition: vidfb.c:409
VOID FbConsOutputChar(_In_ UCHAR Char, _In_ ULONG Column, _In_ ULONG Row, _In_ UINT32 FgColor, _In_ UINT32 BgColor)
Displays a character at a given position with specific foreground and background colors.
Definition: vidfb.c:391
VOID VidFbOutputChar(_In_ UCHAR Char, _In_ ULONG X, _In_ ULONG Y, _In_ UINT32 FgColor, _In_ UINT32 BgColor)
Displays a character at a given pixel position with specific foreground and background colors.
Definition: vidfb.c:217
VOID VidFbGetDisplaySize(_Out_ PULONG Width, _Out_ PULONG Height, _Out_ PULONG Depth)
Returns the width and height in pixels, of the whole visible area of the graphics framebuffer.
Definition: vidfb.c:258
VOID FbConsCopyOffScreenBufferToVRAM(_In_ PVOID Buffer)
Copies a full text-mode CGA-style character buffer rectangle to the console.
Definition: vidfb.c:456
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254
#define FORCEINLINE
Definition: wdftypes.h:67
_In_opt_ PALLOCATE_FUNCTION _In_opt_ PFREE_FUNCTION _In_ ULONG _In_ SIZE_T _In_ ULONG _In_ USHORT Depth
Definition: exfuncs.h:819
unsigned char UCHAR
Definition: xmlstorage.h:181