#[repr(C)]pub struct Raster { /* private fields */ }
Expand description
Raster attributes
The " (2/2)
character is the set raster attributes command.
This command selects the raster attributes for the sixel data string that follows it.
You must use the command before any sixel data string.
The "
command overrides any raster attributes set by the macro parameter described above.
You use the following format for the "
command:
“ | Pan | ; | Pad; | Ph; | Pv |
---|---|---|---|---|---|
2/2 | ** | 3/11 | ** | ** | ** |
where:
Pan and Pad define the pixel aspect ratio for the following sixel data string. Pan is the numerator, and Pad is the denominator.
Pan
--- = pixel aspect ratio
Pad
The pixel aspect ratio defines the shape of the pixels the terminal uses to draw the sixel image.
Pan defines the vertical shape of the pixel. Pad defines the horizontal shape of the pixel. For example, to define a pixel that is twice as high as it is wide, you use a value of 2 for Pan and 1 for Pad.
If you use the set raster attributes command (“) in a sixel data string, you must specify a pixel aspect ratio. You can only use integer values for Pan and Pad. The VT300 rounds the pixel aspect ratio to the nearest integer.
Ph and Pv define the horizontal and vertical size of the image (in pixels), respectively.
Ph
and Pv
do not limit the size of the image defined by the sixel data. However, Ph
and Pv
let you omit background sixel data from the image definition and still have a color background. They also provide a concise way for the application or terminal to encode the size of an image.
NOTE: The VT300 uses Ph and Pv to erase the background when P2 is set to 0 or 2.
Implementations§
Source§impl Raster
impl Raster
Sourcepub const fn create(pan: usize, pad: usize, h: usize, v: usize) -> Self
pub const fn create(pan: usize, pad: usize, h: usize, v: usize) -> Self
Creates a new Raster with the provided parameters.
Sourcepub fn with_pan(self, val: usize) -> Self
pub fn with_pan(self, val: usize) -> Self
Builder function that sets the pan
numerator for the pixel aspect ratio.
Sourcepub fn with_pad(self, val: usize) -> Self
pub fn with_pad(self, val: usize) -> Self
Builder function that sets the pad
denominator for the pixel aspect ratio.