Scylla Framework
  • API Reference
Search Results for

    Show / Hide Table of Contents
    • Scylla.Console.TextMode
      • IConsoleScreen
      • TextModeDebugConsoleDisplay
      • TicTacToeCommand
      • TicTacToeScreen
    • Scylla.TextMode
      • ANSIAttributeParser
      • ANSIColor
      • ANSISGRAttributes
      • AmbientEffectBase
      • BackgroundBlendMode
      • BoxStyle
      • BoxStyleCharacters
      • BoxStyleCharacters.BoxChars
      • CRTSettings
      • Cell
      • CellAttributes
      • CellAttributesExtensions
      • CellBuffer
      • CellBufferRenderer
      • CellGrid
      • CellMask
      • CellPosition
      • CellRange
      • CellRect
      • ColorCycleEffect
      • ColorCycleEffectPreset
      • CrossFadeEffect
      • CursorStyle
      • DecodeEffect
      • DecodeEffectPreset
      • DigitalRainEffect
      • DigitalRainEffectPreset
      • EffectsSettings
      • FadeEffect
      • FadeEffectPreset
      • FlickerEffect
      • FlickerEffectPreset
      • GlitchEffect
      • GlitchEffectPreset
      • GlyphAtlasCache
      • GridSettings
      • IAutoCompleter
      • IInputHistory
      • ITextEffect
      • ITextEffectContext
      • ITextModeGridProvider
      • ITextModePointerMapper
      • ITextModeRenderSource
      • ITextModeViewHost
      • IVTParserHandler
      • InputHistory
      • MaskTransitionEffect
      • MouseEncodingMode
      • MouseTrackingMode
      • PackedGlyphData
      • PulseEffect
      • PulseEffectPreset
      • PushEffect
      • PushEffectPreset
      • SDFSettings
      • ScrollbackAttributeRun
      • ScrollbackLine
      • ScyllaTextMode
      • ScyllaTextMode.Meta
      • ScyllaTextModeConfiguration
      • SlideInEffect
      • SlideInEffectPreset
      • StaticTuneInEffect
      • StaticTuneInEffectPreset
      • TerminalCLI
      • TerminalEmulator
      • TerminalGridRenderer
      • TerminalInputEncoder
      • TerminalMouseButton
      • TerminalScrollbackBuffer
      • TerminalSettings
      • TextAlignment
      • TextEffectBase
      • TextEffectCompletedEvent
      • TextEffectDirection
      • TextEffectExtensions
      • TextEffectMaskPattern
      • TextEffectPreset
      • TextEffectPushMode
      • TextEffectSequencer
      • TextEffectStartedEvent
      • TextEffectState
      • TextEffectTimeMode
      • TextEffects
      • TextModeCellBorder
      • TextModeColorDefaults
      • TextModeColorScheme
      • TextModeColorSet
      • TextModeConfigurationChangedEvent
      • TextModeConsole
      • TextModeConstants
      • TextModeEffectPlayer
      • TextModeGridCapture
      • TextModeLayoutUtil
      • TextModeMaterials
      • TextModeMouseReporter
      • TextModeMouseReportingEvent
      • TextModeSelectionChangedEvent
      • TextModeSelectionEndedEvent
      • TextModeSelectionManager
      • TextModeSelectionStartedEvent
      • TextModeTerminal
      • TextModeTerminalColorTheme
      • TextModeTerminalHost
      • TextModeTerminalSettings
      • TextModeTerminalStartMode
      • TextModeThemeBackground
      • TextModeThemeChangedEvent
      • TextModeThemeRemapper
      • TextModeThemes
      • TextModeView
      • TextWrapMode
      • ThemeSettings
      • TransitionEffectBase
      • TransitionEffectPreset
      • TwinkleEffect
      • TwinkleEffectPreset
      • TypewriterCharacterRevealedEvent
      • TypewriterEffect
      • TypewriterEffectPreset
      • UITextModeView
      • VTParser
      • WaveEffect
      • WaveEffectPreset
    • Scylla.TextMode.CRT
      • CRTBeam
      • CRTBeamClock
      • CRTBeamScanDirection
      • CRTBeamStatus
      • CRTCalibrationPattern
      • CRTCurvatureShape
      • CRTGeometry
      • CRTHDR
      • CRTHDRDisplay
      • CRTHDRTarget
      • CRTHorizontalKernel
      • CRTImageRegion
      • CRTMaskType
      • CRTQualityTier
      • CRTScaleMode
      • CRTSignalStandard
      • CRTSignalType
      • ITextModeCRTCameraEffect
      • ITextModeCRTHDRDisplaySource
      • TextModeCRTBeam
      • TextModeCRTCalibration
      • TextModeCRTCameraEffects
      • TextModeCRTConstants
      • TextModeCRTDriver
      • TextModeCRTHDR
      • TextModeCRTImageRenderer
      • TextModeCRTMonitor
      • TextModeCRTPreset
      • TextModeCRTPresetRegistry
      • TextModeCRTScreen
      • TextModeCRTSettings
      • TextModeCRTTube
    • Scylla.TextMode.Editor
      • CellGridPreviewWidget
      • ColorPaletteWidget
      • ITextModeCRTCameraSetupProvider
      • ScyllaTextModeConfigurationEditor
      • ScyllaTextModeDependencyProvider
      • ScyllaTextModeEditor
      • ScyllaTextModeMenuItems
      • ScyllaTextModeShaderProvider
      • TextModeCRTCameraSetup
      • TextModeCRTCameraStatus
      • TextModeCRTDriverEditor
      • TextModeCRTMonitorEditor
      • TextModeCRTPresetEditor
      • TextModeCRTPresetGenerator
      • TextModeColorAssetGenerator
      • TextModeColorPaletteDefaults
      • TextModeTerminalHostEditor
      • TextModeThemeField
      • TextModeViewEditor
      • TextModeViewEditorBase
      • UITextModeViewEditor
    • Scylla.TextMode.URP
      • CRTQualityTierParameter
      • TextModeCRTInjectionPoint
      • TextModeCRTPresetParameter
      • TextModeCRTRendererFeature
      • TextModeCRTVolume

    Class CellBuffer

    A detached copy of a rectangular block of cells, used by effects that need to remember what a region looked like before they started writing to it.

    Inheritance
    object
    CellBuffer
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Scylla.TextMode
    Assembly: ScyllaTextMode.dll
    Syntax
    public sealed class CellBuffer
    Remarks

    Buffers are rented from and returned to a TextModeEffectPlayer rather than allocated per effect, because effects are started and restarted often and a full-screen region is a few thousand cells. A rented buffer keeps whatever capacity it grew to, so repeated use of the same region size stops allocating entirely.

    Cells are copied whole, including the packed atlas and metrics fields that GlyphAtlasCache stamped into them. An effect that only moves or recolors existing content therefore needs no glyph cache at all: it can copy captured cells straight back into the grid.

    Properties

    Capacity

    Gets the allocated capacity in cells, which may exceed CellCount after the buffer has been reused for a smaller region.

    Declaration
    public int Capacity { get; }
    Property Value
    Type Description
    int

    CellCount

    Gets the number of cells currently held.

    Declaration
    public int CellCount { get; }
    Property Value
    Type Description
    int

    Columns

    Gets the number of columns currently held.

    Declaration
    public int Columns { get; }
    Property Value
    Type Description
    int

    Rows

    Gets the number of rows currently held.

    Declaration
    public int Rows { get; }
    Property Value
    Type Description
    int

    Methods

    Blit(CellGrid, int, int)

    Copies this buffer back into a grid at the given position, marking the affected rows dirty.

    Declaration
    public void Blit(CellGrid grid, int row, int column)
    Parameters
    Type Name Description
    CellGrid grid

    The grid to write into.

    int row

    Row index the buffer's top edge lands on.

    int column

    Column index the buffer's left edge lands on.

    Remarks

    Rows and columns that fall outside the grid are skipped, so a buffer may be written at a position that only partly overlaps the grid without further bounds checks.

    Capture(CellGrid, in CellRect)

    Copies a region of a grid into this buffer, resizing it to match.

    Declaration
    public CellRect Capture(CellGrid grid, in CellRect region)
    Parameters
    Type Name Description
    CellGrid grid

    The grid to read from.

    CellRect region

    The block of cells to copy.

    Returns
    Type Description
    CellRect

    The clamped region that was actually captured.

    Remarks

    The region is clamped to the grid first, so the buffer ends up holding only cells that actually exist. Check Rows and Columns afterwards to learn what was captured.

    Clear()

    Marks the buffer as holding nothing, without releasing its capacity.

    Declaration
    public void Clear()

    GetCell(int, int)

    Reads a single cell from the buffer by its position within the captured region.

    Declaration
    public Cell GetCell(int localRow, int localColumn)
    Parameters
    Type Name Description
    int localRow

    Row index relative to the buffer's top edge.

    int localColumn

    Column index relative to the buffer's left edge.

    Returns
    Type Description
    Cell

    The cell, or a default cell when the coordinate lies outside the buffer.

    Resize(int, int)

    Grows the buffer if needed so it can hold a region of the given size, and adopts that size.

    Declaration
    public void Resize(int rows, int columns)
    Parameters
    Type Name Description
    int rows

    Number of rows required.

    int columns

    Number of columns required.

    Remarks

    Existing contents are not preserved. Call Capture(CellGrid, in CellRect) after resizing.

    SetCell(int, int, in Cell)

    Writes a single cell into the buffer by its position within the captured region.

    Declaration
    public void SetCell(int localRow, int localColumn, in Cell cell)
    Parameters
    Type Name Description
    int localRow

    Row index relative to the buffer's top edge.

    int localColumn

    Column index relative to the buffer's left edge.

    Cell cell

    The cell to store.

    TrimCapacity()

    Releases the backing storage so a pathologically large buffer does not stay resident.

    Declaration
    public void TrimCapacity()
    In this article
    Back to top Scylla Framework - TextMode Module API Documentation