OpenSheetMusicDisplay
    Preparing search index...

    Class SkyBottomLineCalculator

    This class calculates and holds the skyline and bottom line information. It also has functions to update areas of the two lines if new elements are added to the staffline (e.g. measure number, annotations, ...)

    Index

    Constructors

    Accessors

    Methods

    • Replay the geometric skyline calc's per-measure side effects WITHOUT the expensive extent measurement, so lazy rendering can reuse cached sky/bottom lines while leaving the measures in the exact state a normal render would. (calculateLinesGeometric does correctNotePositions inside measure.draw; here we call it directly since the draw is skipped.) No-op for the non-default raster skyline path. lastMeasureFormats: see calculateLines().

      Parameters

      Returns void

    • Returns the BottomLine's maximum for a label's box, e.g. a dynamic's, from its left to its right margin (relative to the staffline): in every sample the box touches. See getSkyLineMinForLabel().

      Parameters

      • left: number

        Left margin of the box

      • right: number

        Right margin of the box

      Returns number

    • This method returns the maximum value of the bottom line around a specific bounding box. Will return undefined if the bounding box is not valid or inside staffline

      Parameters

      • boundingBox: BoundingBox

        Bounding box where the maximum should be retrieved from

      Returns number

      Maximum value inside bounding box boundaries or undefined if not possible

    • This method finds the BottomLine's maximum value within a given range.

      Parameters

      • startIndex: number

        Start index of the range

      • endIndex: number

        End index of the range (excluding)

      Returns number

    • This method finds the minimum value of the SkyLine, ignoring NaN values. A loop of Math.min(min, value) gives the same result as Math.min(...this.SkyLine.filter(s => !isNaN(s))) (including -0 before 0, and Infinity for no values), without copying the line and spreading it into the arguments of a call, which is slow for lines of thousands of values and fails for very long ones.

      Returns number

      the minimum

    • Returns the SkyLine's minimum for a label's box, e.g. a dynamic's, from its left to its right margin (relative to the staffline): in every sample the box touches. Unlike getSkyLineMinInRange(), not also in the sample after the box. See updateSkyLineWithLabel().

      Parameters

      • left: number

        Left margin of the box

      • right: number

        Right margin of the box

      Returns number

    • This method finds the SkyLine's minimum value within a given range.

      Parameters

      • startIndex: number

        Starting index

      • endIndex: number

        End index (including)

      Returns number

    • This method merges a line (e.g. the bottom edge of a tremolo stroke between two notes) into the BottomLine, updating the BottomLine only where the line lies below it (preserving more extreme existing values), unlike updateBottomLineWithWedge, which overwrites the existing values.

      Parameters

      • start: PointF2D

        Start point of the line, relative to the staffline (like the BottomLine values), in units

      • end: PointF2D

        End point of the line

      Returns void

    • This method merges a line (e.g. the top edge of a tremolo stroke between two notes) into the SkyLine, updating the SkyLine only where the line lies above it (preserving more extreme existing values), unlike updateSkyLineWithWedge, which overwrites the existing values.

      Parameters

      • start: PointF2D

        Start point of the line, relative to the staffline (like the SkyLine values), in units

      • end: PointF2D

        End point of the line

      Returns void

    • Resets a bottom line in a range to its original value

      Parameters

      • startIndex: number

        Start index of the range

      • endIndex: number

        End index of the range

      Returns void

    • Resets a SkyLine in a range to its original value

      Parameters

      • startIndex: number

        Start index of the range

      • endIndex: number

        End index of the range (excluding)

      Returns void

    • Replace the sky- and bottom-line arrays directly (lazy rendering reuses the previously-computed lines of stable interior systems instead of re-measuring them; see VexFlowMusicSheetCalculator.calculateSkyBottomLines).

      Parameters

      • skyLine: number[]
      • bottomLine: number[]

      Returns void

    • This method updates the BottomLine for a given range with a given value

      Parameters

      • startIndex: number

        Start index of the range

      • endIndex: number

        End index of the range (excluding)

      • value: number

        ??

      Returns void

    • Updates the BottomLine with a label's box, e.g. a dynamic's, from its left to its right margin (relative to the staffline): only in the samples the box covers completely. See updateSkyLineWithLabel().

      Parameters

      • left: number

        Left margin of the box

      • right: number

        Right margin of the box

      • value: number

        Bottom margin of the box

      Returns void

    • This method updates the skylines and bottomlines for mStaffLineParent.

      Parameters

      • calculationResults: SkyBottomLineCalculationResult[]

        the skylines and bottomlines of mStaffLineParent's measures calculated by SkyBottomLineBatchCalculator

      Returns void

    • This method updates the SkyLine for a given range with a given value //param to update the SkyLine for

      Parameters

      • startIndex: number

        Start index of the range

      • endIndex: number

        End index of the range

      • value: number

        ??

      Returns void

    • Updates the SkyLine with a label's box, e.g. a dynamic's, from its left to its right margin (relative to the staffline): only in the samples the box covers completely. A label placed later reads every sample its box touches (getSkyLineMinForLabel()), so labels whose boxes don't overlap don't read each other. With updateSkyLineInRange() and getSkyLineMinInRange(), which round outward to the samples (1 / SamplingUnit wide), a label next to another one, e.g. a p right after "dim.", was placed further from the staff than it when both touched the same sample. The margins keep a label clear of what is in a sample it covers only partially.

      Parameters

      • left: number

        Left margin of the box

      • right: number

        Right margin of the box

      • value: number

        Top margin of the box

      Returns void