ReactOS  0.4.15-dev-5112-g22d8c0f
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 
27  return VideoOffScreenBuffer;
28 }
#define MachVideoGetBufferSize()
Definition: machine.h:98
PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType)
Definition: mm.c:31
VOID VideoFreeOffScreenBuffer(VOID)
Definition: video.c:30
unsigned int ULONG
Definition: retypes.h:1
#define BufferSize
Definition: mmc.h:75
_In_ WDFMEMORY _Out_opt_ size_t * BufferSize
Definition: wdfmemory.h:251
static PVOID VideoOffScreenBuffer
Definition: video.c:15

Referenced by TuiInitialize().

◆ VideoCopyOffScreenBufferToVRAM()

◆ VideoFadeIn()

VOID VideoFadeIn ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 80 of file video.c.

81 {
82  ULONG Index;
83  UCHAR Color;
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  {
129  MachVideoSync();
130  }
131 
132  MachVideoSetPaletteColor(Color, PaletteColors[Color].Red, PaletteColors[Color].Green, PaletteColors[Color].Blue);
133  }
134  }
135 
136  FrLdrTempFree(PaletteColors, TAG_PALETTE_COLORS);
137 }
Definition: bl.h:201
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:198
UCHAR Blue
Definition: video.h:15
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
FORCEINLINE PVOID FrLdrTempAlloc(_In_ SIZE_T Size, _In_ ULONG Tag)
Definition: mm.h:188
Definition: video.h:11
#define TAG_PALETTE_COLORS
Definition: video.c:13
_In_ WDFCOLLECTION _In_ ULONG Index
UCHAR Red
Definition: video.h:13
Definition: bl.h:199
unsigned char UCHAR
Definition: xmlstorage.h:181
#define RGB_MAX
Definition: video.c:11
unsigned int ULONG
Definition: retypes.h:1
UCHAR Green
Definition: video.h:14
#define RGB_MAX_PER_ITERATION
Definition: video.c:12
FORCEINLINE VOID FrLdrTempFree(PVOID Allocation, ULONG Tag)
Definition: mm.h:197

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  {
153  MachVideoSync();
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 }
Definition: bl.h:201
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:198
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
_In_ WDFCOLLECTION _In_ ULONG Index
Definition: bl.h:199
unsigned char UCHAR
Definition: xmlstorage.h:181
#define RGB_MAX
Definition: video.c:11
unsigned int ULONG
Definition: retypes.h:1
#define RGB_MAX_PER_ITERATION
Definition: video.c:12

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
static PVOID VideoOffScreenBuffer
Definition: video.c:15

Referenced by TuiUnInitialize(), and VideoAllocateOffScreenBuffer().

◆ VideoRestorePaletteState()

VOID VideoRestorePaletteState ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 55 of file video.c.

56 {
57  ULONG Color;
58 
59  MachVideoSync();
60 
61  for (Color = 0; Color < ColorCount; Color++)
62  {
63  MachVideoSetPaletteColor((UCHAR)Color, Palette[Color].Red, Palette[Color].Green, Palette[Color].Blue);
64  }
65 }
Definition: bl.h:201
Definition: bl.h:198
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
Definition: bl.h:199
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int ULONG
Definition: retypes.h:1

Referenced by TuiFadeOut().

◆ VideoSavePaletteState()

VOID VideoSavePaletteState ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 45 of file video.c.

46 {
47  ULONG Color;
48 
49  for (Color = 0; Color < ColorCount; Color++)
50  {
51  MachVideoGetPaletteColor((UCHAR)Color, &Palette[Color].Red, &Palette[Color].Green, &Palette[Color].Blue);
52  }
53 }
Definition: bl.h:201
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:198
struct Color Color
Definition: bl.h:199
unsigned char UCHAR
Definition: xmlstorage.h:181
unsigned int ULONG
Definition: retypes.h:1

Referenced by TuiFadeInBackdrop(), and TuiFadeOut().

◆ VideoSetAllColorsToBlack()

VOID VideoSetAllColorsToBlack ( ULONG  ColorCount)

Definition at line 68 of file video.c.

69 {
70  UCHAR Color;
71 
72  MachVideoSync();
73 
74  for (Color = 0; Color < ColorCount; Color++)
75  {
77  }
78 }
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
unsigned char UCHAR
Definition: xmlstorage.h:181

Referenced by TuiFadeInBackdrop().