ResolutionCalculator class

Pure, heavily-tested resolution math — mirrors HandBrake's picture sizing (sanitize_filter_list_pre/post + hb_geometry_t handling).

Preserves aspect, respects rotation, snaps to even dimensions (modulus 2).

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

applyRotation(int width, int height, int rotationDegrees) → ({int height, int width})
Correct width/height for rotation metadata (HandBrake's title->geometry + rotation fix). Rotation 90/270 swaps dimensions.
calculate({required int srcWidth, required int srcHeight, int? maxWidth, int? maxHeight, int? targetWidth, int? targetHeight, double? scale, bool preserveAspectRatio = true, bool allowStretch = false, int modulus = 2}) → ({int height, int width})
Compute output dimensions from source + constraints. srcWidth/srcHeight are rotation-corrected (like job->width/height after HandBrake's geometry fix). Returns even (modulo=2) dimensions, never 0.
estimatedRemaining({required double progress, required Duration elapsed}) → Duration?
Remaining wall-clock estimate — like HandBrake's estimatedRemaining derived from fps.
estimateTotalFrames({required int durationMs, required double fps}) → int
Estimate total frames for progress denominator (like job->frame_count from duration×fps).
progress({required int encodedFrames, required int totalFrames}) → double
Progress math matching sync.c: progress = frame_count / est_frame_count, clamped.