💻 TermColor User Manual
Public Member Functions | Properties | List of all members
TermColor.AnsiTermBuffer< TColor > Class Template Reference
Inheritance diagram for TermColor.AnsiTermBuffer< TColor >:
Inheritance graph
[legend]
Collaboration diagram for TermColor.AnsiTermBuffer< TColor >:
Collaboration graph
[legend]

Public Member Functions

 AnsiTermBuffer (int width, int height)
 
void Clear ()
 
void Clear< TColorValue > (char ch, in TColorValue foreground, in TColorValue background)
 
void SetChar (int x, int y, char ch)
 
void SetForeground< TColorValue > (int x, int y, in TColorValue color)
 
void SetBackground< TColorValue > (int x, int y, in TColorValue color)
 
void Flush (TextWriter output)
 
void Flush (TextWriter output, int offsetX, int offsetY)
 
- Public Member Functions inherited from TermColor.ITerminalBuffer
void SetPoint< TColorValue > (int x, int y, char ch, in TColorValue foreground, in TColorValue background)
 

Properties

int Width [get]
 
int Height [get]
 
- Properties inherited from TermColor.ITerminalBuffer
int Width [get]
 
int Height [get]
 

Detailed Description

Text buffer capable of storing color data. Outputs text formatted with ANSI escape codes.

Template Parameters
TColorInternal representation of color.
Type Constraints
TColor :struct 
TColor :ANSIColor 

Constructor & Destructor Documentation

◆ AnsiTermBuffer()

TermColor.AnsiTermBuffer< TColor >.AnsiTermBuffer ( int  width,
int  height 
)
inline

Create a new buffer with the given dimensions.

Parameters
widthNumber of columns of the buffer.
heightNumber of rows of the buffer.

Member Function Documentation

◆ Clear()

void TermColor.AnsiTermBuffer< TColor >.Clear ( )

Fill the buffer with empty characters and default colors.

Implements TermColor.ITerminalBuffer.

◆ Clear< TColorValue >()

void TermColor.AnsiTermBuffer< TColor >.Clear< TColorValue > ( char  ch,
in TColorValue  foreground,
in TColorValue  background 
)
inline

Fill the buffer with given (char, IColor, IColor) tuple.

Template Parameters
TColorValueType of the color.
Parameters
cThe character to clear with.
foregroundForeground color.
backgroundBackground color.

Implements TermColor.ITerminalBuffer.

Type Constraints
TColorValue :IColor 

◆ Flush() [1/2]

void TermColor.AnsiTermBuffer< TColor >.Flush ( TextWriter  output)
inline

Forward the contents of the buffer to an output device.

Parameters
outputThe output device.

Implements TermColor.ITerminalBuffer.

◆ Flush() [2/2]

void TermColor.AnsiTermBuffer< TColor >.Flush ( TextWriter  output,
int  offsetLeft,
int  offsetTop 
)
inline

Forward the contents of the buffer to an output device at a specific offset.

Parameters
outputThe output device.

Implements TermColor.ITerminalBuffer.

◆ SetBackground< TColorValue >()

void TermColor.AnsiTermBuffer< TColor >.SetBackground< TColorValue > ( int  x,
int  y,
in TColorValue  color 
)
inline

Write background color to one point in the buffer. Rows and columns are numbered from the top left starting at zero.

Parameters
xColumn number.
yRow number.
backgroundBackground color of the character.

Implements TermColor.ITerminalBuffer.

Type Constraints
TColorValue :IColor 

◆ SetChar()

void TermColor.AnsiTermBuffer< TColor >.SetChar ( int  x,
int  y,
char  ch 
)
inline

Write a character to one point in the buffer. Rows and columns are numbered from the top left starting at zero.

Parameters
xColumn number.
yRow number.
chThe character to write.

Implements TermColor.ITerminalBuffer.

◆ SetForeground< TColorValue >()

void TermColor.AnsiTermBuffer< TColor >.SetForeground< TColorValue > ( int  x,
int  y,
in TColorValue  color 
)
inline

Write foreground color to one point in the buffer. Rows and columns are numbered from the top left starting at zero.

Parameters
xColumn number.
yRow number.
foregroundForeground color of the character.

Implements TermColor.ITerminalBuffer.

Type Constraints
TColorValue :IColor 

The documentation for this class was generated from the following file: