ReactOS  0.4.14-dev-358-gbef841c
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 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  {
25  }
26 
28 
30 
31  return VideoOffScreenBuffer;
32 }
#define MachVideoGetBufferSize()
Definition: machine.h:98
smooth NULL
Definition: ftsmooth.c:416
#define BufferSize
Definition: classpnp.h:419
PVOID MmAllocateMemoryWithType(SIZE_T MemorySize, TYPE_OF_MEMORY MemoryType)
Definition: mm.c:31
VOID MmFreeMemory(PVOID MemoryPointer)
Definition: mm.c:215
unsigned int ULONG
Definition: retypes.h:1
static PVOID VideoOffScreenBuffer
Definition: video.c:15

Referenced by TuiInitialize().

◆ VideoCopyOffScreenBufferToVRAM()

◆ VideoFadeIn()

VOID VideoFadeIn ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 75 of file video.c.

76 {
77  ULONG Index;
78  UCHAR Color;
79  PPALETTE_ENTRY PaletteColors;
80 
81  PaletteColors = FrLdrTempAlloc(sizeof(PALETTE_ENTRY) * ColorCount, TAG_PALETTE_COLORS);
82  if (!PaletteColors) return;
83 
84  for (Index = 0; Index < RGB_MAX; Index++)
85  {
86  for (Color = 0; Color < ColorCount; Color++)
87  {
88  MachVideoGetPaletteColor(Color, &PaletteColors[Color].Red, &PaletteColors[Color].Green, &PaletteColors[Color].Blue);
89 
90  // Increment each color so it approaches its real value
91  if (PaletteColors[Color].Red < Palette[Color].Red)
92  {
93  PaletteColors[Color].Red++;
94  }
95  if (PaletteColors[Color].Green < Palette[Color].Green)
96  {
97  PaletteColors[Color].Green++;
98  }
99  if (PaletteColors[Color].Blue < Palette[Color].Blue)
100  {
101  PaletteColors[Color].Blue++;
102  }
103 
104  // Make sure we haven't exceeded the real value
105  if (PaletteColors[Color].Red > Palette[Color].Red)
106  {
107  PaletteColors[Color].Red = Palette[Color].Red;
108  }
109  if (PaletteColors[Color].Green > Palette[Color].Green)
110  {
111  PaletteColors[Color].Green = Palette[Color].Green;
112  }
113  if (PaletteColors[Color].Blue > Palette[Color].Blue)
114  {
115  PaletteColors[Color].Blue = Palette[Color].Blue;
116  }
117  }
118 
119  // Set the colors
120  for (Color = 0; Color < ColorCount; Color++)
121  {
122  if ((Color % RGB_MAX_PER_ITERATION) == 0)
123  {
124  MachVideoSync();
125  }
126 
127  MachVideoSetPaletteColor(Color, PaletteColors[Color].Red, PaletteColors[Color].Green, PaletteColors[Color].Blue);
128  }
129  }
130 
131  FrLdrTempFree(PaletteColors, TAG_PALETTE_COLORS);
132 }
Definition: bl.h:202
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:199
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:177
Definition: video.h:11
#define TAG_PALETTE_COLORS
Definition: video.c:13
static const UCHAR Index[8]
Definition: usbohci.c:18
UCHAR Red
Definition: video.h:13
Definition: bl.h:200
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:186

Referenced by TuiFadeInBackdrop().

◆ VideoFadeOut()

VOID VideoFadeOut ( ULONG  ColorCount)

Definition at line 134 of file video.c.

135 {
136  ULONG Index;
137  UCHAR Color;
138  UCHAR Red;
139  UCHAR Green;
140  UCHAR Blue;
141 
142  for (Index = 0; Index < RGB_MAX; Index++)
143  {
144  for (Color = 0; Color < ColorCount; Color++)
145  {
146  if ((Color % RGB_MAX_PER_ITERATION) == 0)
147  {
148  MachVideoSync();
149  }
150 
152 
153  if (Red > 0)
154  {
155  Red--;
156  }
157  if (Green > 0)
158  {
159  Green--;
160  }
161  if (Blue > 0)
162  {
163  Blue--;
164  }
165 
167  }
168  }
169 }
Definition: bl.h:202
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:199
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
static const UCHAR Index[8]
Definition: usbohci.c:18
Definition: bl.h:200
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().

◆ VideoRestorePaletteState()

VOID VideoRestorePaletteState ( PPALETTE_ENTRY  Palette,
ULONG  ColorCount 
)

Definition at line 50 of file video.c.

51 {
52  ULONG Color;
53 
54  MachVideoSync();
55 
56  for (Color = 0; Color < ColorCount; Color++)
57  {
58  MachVideoSetPaletteColor((UCHAR)Color, Palette[Color].Red, Palette[Color].Green, Palette[Color].Blue);
59  }
60 }
Definition: bl.h:202
Definition: bl.h:199
#define MachVideoSetPaletteColor(Col, R, G, B)
Definition: machine.h:112
struct Color Color
#define MachVideoSync()
Definition: machine.h:116
Definition: bl.h:200
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 40 of file video.c.

41 {
42  ULONG Color;
43 
44  for (Color = 0; Color < ColorCount; Color++)
45  {
46  MachVideoGetPaletteColor((UCHAR)Color, &Palette[Color].Red, &Palette[Color].Green, &Palette[Color].Blue);
47  }
48 }
Definition: bl.h:202
#define MachVideoGetPaletteColor(Col, R, G, B)
Definition: machine.h:114
Definition: bl.h:199
struct Color Color
Definition: bl.h:200
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 63 of file video.c.

64 {
65  UCHAR Color;
66 
67  MachVideoSync();
68 
69  for (Color = 0; Color < ColorCount; Color++)
70  {
72  }
73 }
#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().