ReactOS 0.4.15-dev-5672-gf73ac17
video.h File Reference
#include <pshpack1.h>
#include <poppack.h>
Include dependency graph for video.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _PALETTE_ENTRY
 

Typedefs

typedef struct _PALETTE_ENTRY PALETTE_ENTRY
 
typedef struct _PALETTE_ENTRYPPALETTE_ENTRY
 

Functions

PVOID VideoAllocateOffScreenBuffer (VOID)
 
VOID VideoFreeOffScreenBuffer (VOID)
 
VOID VideoCopyOffScreenBufferToVRAM (VOID)
 
VOID VideoSavePaletteState (PPALETTE_ENTRY Palette, ULONG ColorCount)
 
VOID VideoRestorePaletteState (PPALETTE_ENTRY Palette, ULONG ColorCount)
 
VOID VideoSetAllColorsToBlack (ULONG ColorCount)
 
VOID VideoFadeIn (PPALETTE_ENTRY Palette, ULONG ColorCount)
 
VOID VideoFadeOut (ULONG ColorCount)
 

Typedef Documentation

◆ PALETTE_ENTRY

◆ PPALETTE_ENTRY

Function Documentation

◆ VideoAllocateOffScreenBuffer()

PVOID VideoAllocateOffScreenBuffer ( VOID  )

Definition at line 17 of file video.c.

18{
20
22
24
26
28}
#define MachVideoGetBufferSize()
Definition: machine.h:98
PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType)
Definition: mm.c:31
static PVOID VideoOffScreenBuffer
Definition: video.c:15
VOID VideoFreeOffScreenBuffer(VOID)
Definition: video.c:30
#define BufferSize
Definition: mmc.h:75
@ LoaderFirmwareTemporary
Definition: arc.h:132
uint32_t ULONG
Definition: typedefs.h:59
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:254

Referenced by TuiInitialize().

◆ VideoCopyOffScreenBufferToVRAM()

◆ VideoFadeIn()

VOID VideoFadeIn ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 80 of file video.c.

81{
84 PPALETTE_ENTRY PaletteColors;
85
86 PaletteColors = FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * ColorCount, TAG_PALETTE_COLORS);
87 if (!PaletteColors) return;
88
89 for (Index = 0; Index < RGB_MAX; Index++)
90 {
91 for (Color = 0; Color < ColorCount; Color++)
92 {
93 MachVideoGetPaletteColor(Color, &PaletteColors[Color].Red, &PaletteColors[Color].Green, &PaletteColors[Color].Blue);
94
95 // Increment each color so it approaches its real value
96 if (PaletteColors[Color].Red < Palette[Color].Red)
97 {
98 PaletteColors[Color].Red++;
99 }
100 if (PaletteColors[Color].Green < Palette[Color].Green)
101 {
102 PaletteColors[Color].Green++;
103 }
104 if (PaletteColors[Color].Blue < Palette[Color].Blue)
105 {
106 PaletteColors[Color].Blue++;
107 }
108
109 // Make sure we haven't exceeded the real value
110 if (PaletteColors[Color].Red > Palette[Color].Red)
111 {
112 PaletteColors[Color].Red = Palette[Color].Red;
113 }
114 if (PaletteColors[Color].Green > Palette[Color].Green)
115 {
116 PaletteColors[Color].Green = Palette[Color].Green;
117 }
118 if (PaletteColors[Color].Blue > Palette[Color].Blue)
119 {
120 PaletteColors[Color].Blue = Palette[Color].Blue;
121 }
122 }
123
124 // Set the colors
125 for (Color = 0; Color < ColorCount; Color++)
126 {
127 if ((Color % RGB_MAX_PER_ITERATION) == 0)
128 {
130 }
131
132 MachVideoSetPaletteColor(Color, PaletteColors[Color].Red, PaletteColors[Color].Green, PaletteColors[Color].Blue);
133 }
134 }
135
136 FrLdrTempFree(PaletteColors, TAG_PALETTE_COLORS);
137}
@ Green
Definition: bl.h:199
@ Red
Definition: bl.h:201
@ Blue
Definition: bl.h:198
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
#define MachVideoSync()
Definition: machine.h:116
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:188
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:197
#define TAG_PALETTE_COLORS
Definition: video.c:13
#define RGB_MAX
Definition: video.c:11
#define RGB_MAX_PER_ITERATION
Definition: video.c:12
Definition: video.h:12
UCHAR Blue
Definition: video.h:15
UCHAR Red
Definition: video.h:13
UCHAR Green
Definition: video.h:14
_In_ WDFCOLLECTION _In_ ULONG Index
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by TuiFadeInBackdrop().

◆ VideoFadeOut()

VOID VideoFadeOut ( ULONG  ColorCount)

Definition at line 139 of file video.c.

140{
141 ULONG Index;
142 UCHAR Color;
143 UCHAR Red;
144 UCHAR Green;
145 UCHAR Blue;
146
147 for (Index = 0; Index < RGB_MAX; Index++)
148 {
149 for (Color = 0; Color < ColorCount; Color++)
150 {
151 if ((Color % RGB_MAX_PER_ITERATION) == 0)
152 {
154 }
155
157
158 if (Red > 0)
159 {
160 Red--;
161 }
162 if (Green > 0)
163 {
164 Green--;
165 }
166 if (Blue > 0)
167 {
168 Blue--;
169 }
170
172 }
173 }
174}

Referenced by TuiFadeOut().

◆ VideoFreeOffScreenBuffer()

VOID VideoFreeOffScreenBuffer ( VOID  )

Definition at line 30 of file video.c.

31{
33 return;
34
37}
VOID MmFreeMemory(PVOID MemoryPointer)
Definition: mm.c:215
#define NULL
Definition: types.h:112

Referenced by TuiUnInitialize(), and VideoAllocateOffScreenBuffer().

◆ VideoRestorePaletteState()

VOID VideoRestorePaletteState ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 55 of file video.c.

56{
58
60
61 for (Color = 0; Color < ColorCount; Color++)
62 {
63 MachVideoSetPaletteColor((UCHAR)Color, Palette[Color].Red, Palette[Color].Green, Palette[Color].Blue);
64 }
65}

Referenced by TuiFadeOut().

◆ VideoSavePaletteState()

VOID VideoSavePaletteState ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 45 of file video.c.

46{
48
49 for (Color = 0; Color < ColorCount; Color++)
50 {
51 MachVideoGetPaletteColor((UCHAR)Color, &Palette[Color].Red, &Palette[Color].Green, &Palette[Color].Blue);
52 }
53}

Referenced by TuiFadeInBackdrop(), and TuiFadeOut().

◆ VideoSetAllColorsToBlack()

VOID VideoSetAllColorsToBlack ( ULONG  ColorCount)

Definition at line 68 of file video.c.

69{
71
73
74 for (Color = 0; Color < ColorCount; Color++)
75 {
77 }
78}

Referenced by TuiFadeInBackdrop().