RenderConfig class final
Everything one render needs to know: output size, frame rate, the frame window to capture, encode quality, and whether the frame cache may serve repeated frames.
Hand-written immutable value class (no codegen). Validation happens at construction: width and height must be even (yuv420p chroma subsampling halves them), fps and frameCount positive, startFrame non-negative — violations are programming errors (ArgumentError).
toJson/RenderConfig.fromJson round-trip the full config; the JSON form
feeds the render digest that keys the frame cache, so field names and the
Quality.name spelling are stable.
- Annotations
Constructors
- RenderConfig({required int width, required int height, required int frameCount, int fps = VideoDefaults.fps, int startFrame = 0, Quality quality = Quality.high, bool cacheEnabled = true})
- Creates a validated render configuration.
-
RenderConfig.fromJson(Map<
String, Object?> json) -
Reads a config from its toJson form (validating as the constructor).
factory
Properties
- cacheEnabled → bool
-
Whether the frame cache may serve frames captured by an earlier run
with the same render digest.
final
- fps → int
-
Frames per second of the output video.
final
- frameCount → int
-
How many frames to capture and encode.
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- height → int
-
Output height in pixels (even, for yuv420p).
final
- quality → Quality
-
Encode quality level (mapped to CRF by the argument builder).
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- startFrame → int
-
The first frame to capture (the loop runs
startFrame .. startFrame + frameCount - 1).final - width → int
-
Output width in pixels (even, for yuv420p).
final
Methods
-
copyWith(
{int? width, int? height, int? fps, int? frameCount, int? startFrame, Quality? quality, bool? cacheEnabled}) → RenderConfig - A copy with the given fields replaced (re-validated on construction).
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, Object?> - The JSON form (stable field order; Quality by name).
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override