class

ACurvePreview

A small read-only plot of one or more curves: the inline preview a details row hosts next to a curve asset picker, and the picture the content browser's .curve thumbnail is rasterised from. Both go through the same series and the same fit, so the tile and the row never disagree about what the curve looks like.

Module
Arc
Header
#include "Arc/Widgets/ACurvePreview.h"
Namespace
Arcf

Type aliases

AliasDescription
using FSampler = std::function<float(float)>

Properties

TypeNameDescription
static constexpr int32_tkSampleCountDefault 64.

Public functions

ReturnsNameDescription
ARC_WIDGET_ARGS
voidSetCurveReplaces every series with one curve drawn in LineColor.
voidAddCurveAdds a curve in its own colour; channels of one asset stack this way.
voidSetSeries
voidClearCurves
boolHasCurve
const std::vector<FCurvePreviewSeries>&GetSeries
std::vector<float>Sample
voidFitValueRangeThe value range every series shares, padded so the line never touches the frame and widened when the curve is flat — a constant curve still has to read as a line, not as a collapsed axis.
voidRasterizeRgbaThe CPU twin of OnPaint for thumbnails: straight RGBA8, row-major, top row first.
ArcVec2ComputeDesiredSize
int32_tOnPaint
boolCanCacheDesiredSize
boolCanRetainPaintPure function of the stored samples and the colour attributes; every setter invalidates, so a replay can never show a curve that was replaced underneath it.
const char*GetTypeName

Function details

ARC_WIDGET_ARGS

C++
ARC_WIDGET_ARGS(ACurvePreview) ARC_ATTR(ArcColor, BackgroundColor) ARC_ATTR(ArcColor, GridColor) ARC_ATTR(ArcColor, LineColor) ARC_ATTR(float, CornerRadius) ARC_ATTR(ArcVec2, DesiredSize) ARC_WIDGET_ARGS_END() void Construct(const CArguments& args)

SetCurve

C++
void SetCurve(const FSampler& sampler, float minTime, float maxTime)

Replaces every series with one curve drawn in LineColor.

AddCurve

C++
void AddCurve(const FSampler& sampler, float minTime, float maxTime, const ArcColor& color)

Adds a curve in its own colour; channels of one asset stack this way.

SetSeries

C++
void SetSeries(std::vector<FCurvePreviewSeries> series)

ClearCurves

C++
void ClearCurves()

HasCurve

C++
bool HasCurve() const

GetSeries

C++
const std::vector<FCurvePreviewSeries>& GetSeries() const

Sample

C++
static std::vector<float> Sample(const FSampler& sampler, float minTime, float maxTime, int32_t count = kSampleCount)

FitValueRange

C++
static void FitValueRange(const std::vector<FCurvePreviewSeries>& series, float& outMinValue, float& outMaxValue)

The value range every series shares, padded so the line never touches the frame and widened when the curve is flat — a constant curve still has to read as a line, not as a collapsed axis.

RasterizeRgba

C++
static void RasterizeRgba(const std::vector<FCurvePreviewSeries>& series, uint32_t width, uint32_t height, const ArcColor& background, const ArcColor& grid, std::vector<uint8_t>& outRgba)

The CPU twin of OnPaint for thumbnails: straight RGBA8, row-major, top row first. Background, quarter grid, then every series.

ComputeDesiredSize

C++
ArcVec2 ComputeDesiredSize(float scale) const override

OnPaint

C++
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const override

CanCacheDesiredSize

C++
bool CanCacheDesiredSize() const override

CanRetainPaint

C++
bool CanRetainPaint() const override

Pure function of the stored samples and the colour attributes; every setter invalidates, so a replay can never show a curve that was replaced underneath it.

GetTypeName

C++
const char* GetTypeName() const override
Generated from Arc/Widgets/ACurvePreview.h via arc.json · Nov 5, 2026Version 1.0.0