pub struct RenderState {Show 29 fields
pub alpha_mul: f32,
pub transform: Transform2D,
pub rotate_radians: f32,
pub rotate_x_radians: f32,
pub rotate_y_radians: f32,
pub scale: (f32, f32),
pub translate: Option<(f32, f32)>,
pub blur_sigma: f32,
pub clip_rect: Option<ClipRect>,
pub clip_drawing: Option<String>,
pub primary_color: Option<(u8, u8, u8)>,
pub font_size: Option<f32>,
pub pivot: Option<(f32, f32)>,
pub border: Option<(f32, f32)>,
pub shadow: Option<(f32, f32)>,
pub be_strength: u8,
pub shear: (f32, f32),
pub iclip_rect: Option<ClipRect>,
pub iclip_drawing: Option<String>,
pub secondary_color: Option<(u8, u8, u8)>,
pub outline_color: Option<(u8, u8, u8)>,
pub shadow_color: Option<(u8, u8, u8)>,
pub primary_alpha: Option<u8>,
pub secondary_alpha: Option<u8>,
pub outline_alpha: Option<u8>,
pub shadow_alpha: Option<u8>,
pub letter_spacing: Option<f32>,
pub wrap_style: Option<u8>,
pub alignment: Option<u8>,
}Expand description
Resolved state of the cue at a particular timestamp.
All quantities are expressed in the cue’s local coordinate space
(the same space \pos / \move use). transform composes
move ∘ scale ∘ rotate so the rotation pivot is the
translation point.
Fields§
§alpha_mul: f321.0 = fully opaque, 0.0 = fully transparent.
transform: Transform2DCombined affine transform to apply to the rendered text glyph group.
rotate_radians: f32\frz rotation in radians (also baked into transform but
exposed for renderers that compose their own matrix).
rotate_x_radians: f32\frx rotation in radians (X axis, 3D). Renderers project
this to 2D via a perspective camera anchored at pivot.
rotate_y_radians: f32\fry rotation in radians (Y axis, 3D).
scale: (f32, f32)(sx, sy) scale factors, where 1.0 = 100%.
translate: Option<(f32, f32)>(tx, ty) translation. None when neither \pos nor \move
applied, in which case the renderer falls back to the cue’s
style margins.
blur_sigma: f32Gaussian blur sigma in pixels. 0.0 = no blur.
clip_rect: Option<ClipRect>Active rectangular clip in cue local coordinates, if any.
clip_drawing: Option<String>\clip(drawing) raw drawing string, if active. Parse through
crate::drawing::parse_drawing for a vector path mask.
primary_color: Option<(u8, u8, u8)>\c primary-colour override, if active.
font_size: Option<f32>\fs size override, if active.
pivot: Option<(f32, f32)>\org(x, y) pivot point for \frz / \frx / \fry. None
means “use the alignment point” (the renderer fills it in).
border: Option<(f32, f32)>(x_border, y_border) per-axis text border width in px from
\bord / \xbord / \ybord. None = fall back to style.
shadow: Option<(f32, f32)>(x_shadow, y_shadow) per-axis shadow distance in px from
\shad / \xshad / \yshad. None = fall back to style.
Per-axis values may be negative; \shad itself is clamped to
non-negative per spec.
be_strength: u8\be(N) iterative box-blur strength (0 = off). Distinct from
blur_sigma (\blur).
shear: (f32, f32)(fax, fay) shear factors applied after rotation. (0.0, 0.0)
= no shear.
iclip_rect: Option<ClipRect>Active inverse rectangular clip from \iclip(x1,y1,x2,y2).
Renderers should hide pixels inside this rectangle.
iclip_drawing: Option<String>\iclip(drawing) raw drawing string; renderer parses to a
path and masks against its inverse.
secondary_color: Option<(u8, u8, u8)>\2c secondary fill colour override, if active.
outline_color: Option<(u8, u8, u8)>\3c border / outline colour override, if active.
shadow_color: Option<(u8, u8, u8)>\4c shadow colour override, if active.
primary_alpha: Option<u8>\1a primary fill alpha (0 = opaque, 255 = transparent), if
set. None means “fall back to style alpha”. Independent of
Self::alpha_mul, which is the \fad / \fade cue-level
envelope. Renderers compose:
final_primary_alpha = primary_alpha.unwrap_or(style) * alpha_mul.
secondary_alpha: Option<u8>\2a secondary fill alpha, if set.
outline_alpha: Option<u8>\3a border / outline alpha, if set.
shadow_alpha: Option<u8>\4a shadow alpha, if set.
letter_spacing: Option<f32>\fsp additional letter-spacing in script-resolution pixels,
if set. None = use the style’s Spacing field. May be
negative or decimal.
wrap_style: Option<u8>\q wrap-style override for the line, if set. None = use
the script’s WrapStyle header. Values per SSA spec:
0 smart-top / 1 EOL / 2 no-wrap / 3 smart-bottom.
Not animatable per spec.
alignment: Option<u8>\an<pos> (or its legacy \a<pos> form, converted to numpad)
alignment override for the line, if set. None = fall back to
the cue’s style Alignment. Values are the Aegisub numpad
codes 1..=9:
1/2/3— bottom-left / bottom-center / bottom-right4/5/6— middle-left / middle-center / middle-right7/8/9— top-left / top-center / top-right
The alignment doubles as the anchor point for \pos / \move
translation per the Aegisub spec, so renderers should look here
to decide which glyph corner sits on the translate point.
Static, not animatable.
Implementations§
Source§impl RenderState
impl RenderState
Trait Implementations§
Source§impl Clone for RenderState
impl Clone for RenderState
Source§fn clone(&self) -> RenderState
fn clone(&self) -> RenderState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RenderState
impl Debug for RenderState
Source§impl Default for RenderState
impl Default for RenderState
Source§impl PartialEq for RenderState
impl PartialEq for RenderState
Source§fn eq(&self, other: &RenderState) -> bool
fn eq(&self, other: &RenderState) -> bool
self and other values to be equal, and is used by ==.