pub struct StreamShading<'a> { /* private fields */ }
Expand description
Writer for a embedded file stream.
This struct is created by Chunk::stream_shading
.
Implementations§
source§impl<'a> StreamShading<'a>
impl<'a> StreamShading<'a>
sourcepub fn shading_type(&mut self, kind: StreamShadingType) -> &mut Self
pub fn shading_type(&mut self, kind: StreamShadingType) -> &mut Self
Write the /ShadingType
attribute.
Sets the type of shading. The available and required attributes change depending on this. Required.
sourcepub fn color_space(&mut self) -> ColorSpace<'_>
pub fn color_space(&mut self) -> ColorSpace<'_>
Start writing the /ColorSpace
attribute.
Sets the color space of the shading function. May not be a Pattern
space. Required.
sourcepub fn background(
&mut self,
background: impl IntoIterator<Item = f32>,
) -> &mut Self
pub fn background( &mut self, background: impl IntoIterator<Item = f32>, ) -> &mut Self
Write the /Background
attribute.
Sets the background color of the area to be shaded. The background
iterator must contain exactly as many elements as the current
color space has dimensions.
sourcepub fn bbox(&mut self, bbox: Rect) -> &mut Self
pub fn bbox(&mut self, bbox: Rect) -> &mut Self
Write the /BBox
attribute.
Sets the bounding box of the shading in the target coordinate system.
sourcepub fn anti_alias(&mut self, anti_alias: bool) -> &mut Self
pub fn anti_alias(&mut self, anti_alias: bool) -> &mut Self
Write the /AntiAlias
attribute.
Sets whether to anti-alias the shading.
sourcepub fn function(&mut self, function: Ref) -> &mut Self
pub fn function(&mut self, function: Ref) -> &mut Self
Write the /Function
attribute.
Sets the function to use for shading. Number of in- and outputs depends on shading type. Optional.
sourcepub fn bits_per_coordinate(&mut self, bits: i32) -> &mut Self
pub fn bits_per_coordinate(&mut self, bits: i32) -> &mut Self
Write the /BitsPerCoordinate
attribute.
Sets how many bits are used to represent each vertex coordinate. Can be any power of 2 between 1 and 32. Required.
sourcepub fn bits_per_component(&mut self, bits: i32) -> &mut Self
pub fn bits_per_component(&mut self, bits: i32) -> &mut Self
Write the /BitsPerComponent
attribute.
Sets how many bits are used to represent each color component. Can be any power of 2 between 1 and 16. Required.
sourcepub fn bits_per_flag(&mut self, bits: i32) -> &mut Self
pub fn bits_per_flag(&mut self, bits: i32) -> &mut Self
Write the /BitsPerFlag
attribute.
Sets how many bits are used to represent the vertices’ edge flags. Can be 0, 1, or 2. Required for type 4, 6, and 7.
sourcepub fn decode(&mut self, decode: impl IntoIterator<Item = f32>) -> &mut Self
pub fn decode(&mut self, decode: impl IntoIterator<Item = f32>) -> &mut Self
Write the /Decode
attribute.
Sets the ranges of the vertices’ coordinates. Required.
sourcepub fn vertices_per_row(&mut self, vertices: i32) -> &mut Self
pub fn vertices_per_row(&mut self, vertices: i32) -> &mut Self
Write the /VerticesPerRow
attribute.
Sets how many vertices are in each row of the lattice. Must be greater than 2. Required for type 5.
Methods from Deref<Target = Stream<'a>>§
sourcepub fn decode_parms(&mut self) -> DecodeParms<'_>
pub fn decode_parms(&mut self) -> DecodeParms<'_>
Start writing the /DecodeParms
attribute.
This is a dictionary that specifies parameters to be used in decoding
the stream data using the filter specified by the
/Filter
attribute.
Methods from Deref<Target = Dict<'a>>§
sourcepub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
pub fn insert(&mut self, key: Name<'_>) -> Obj<'_>
Start writing a pair with an arbitrary value.
sourcepub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
pub fn pair<T: Primitive>(&mut self, key: Name<'_>, value: T) -> &mut Self
Write a pair with a primitive value.
This is a shorthand for dict.insert(key).primitive(value)
.
sourcepub fn pairs<'n, T: Primitive>(
&mut self,
pairs: impl IntoIterator<Item = (Name<'n>, T)>,
) -> &mut Self
pub fn pairs<'n, T: Primitive>( &mut self, pairs: impl IntoIterator<Item = (Name<'n>, T)>, ) -> &mut Self
Write a sequence of pairs with primitive values.