[−][src]Trait spectrusty::video::Video
An interface for rendering Spectrum's pixel data to frame buffers.
Associated Types
type VideoFrame: VideoFrame
[src]
The type implementing VideoFrame, that is being used by the chipset emulator.
type Contention: MemoryContention
[src]
The type implementing MemoryContention, that is being used by the chipset emulator.
Associated Constants
pub const PIXEL_DENSITY: u32
[src]
The horizontal pixel density.
This is: 1 for chipsets that can render only low-resolution modes, and 2 for chipsets that are capable of displaying high-resolution screen modes.
Required methods
pub fn border_color(&self) -> BorderColor
[src]
Returns the current border color.
pub fn set_border_color(&mut self, border: BorderColor)
[src]
Force sets the border area to the given color.
pub fn render_video_frame<'a, B, P>(
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
) where
B: PixelBuffer<'a>,
P: Palette<Pixel = <B as PixelBuffer<'a>>::Pixel>,
[src]
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
) where
B: PixelBuffer<'a>,
P: Palette<Pixel = <B as PixelBuffer<'a>>::Pixel>,
Renders last emulated frame's video data into the provided pixel buffer
.
pitch
is the number of bytes in a single row of pixel data, including padding between lines.border_size
determines the size of the border rendered around the INK and PAPER area.
Note that different BorderSizes will result in different sizes of the rendered buffer
area.
To predetermine the size of the rendered buffer area use Video::render_size_pixels. To get the size of the video screen in low-resolution pixels only, call VideoFrame::screen_size_pixels e.g. for an aspect ratio calculation.
- PixelBuffer implementation is used to write pixels into the
buffer
. - Palette implementation is used to create colors from the Spectrum colors.
NOTE: Currently this is a one-time action (per frame), as internal data will be drained during the rendering. Calling it twice will succeed but the image rendered the second time will be most probably incorrect due to the missing data.
pub fn current_video_ts(&self) -> VideoTs
[src]
Returns the current value of the video T-state counter.
pub fn set_video_ts(&mut self, vts: VideoTs)
[src]
Modifies the current value of the video T-state counter.
pub fn current_video_clock(
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
[src]
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
Returns the current value of the video T-state clock.
pub fn flash_state(&self) -> bool
[src]
Returns the temporary video flash attribute state.
Provided methods
pub fn render_size_pixels(border_size: BorderSize) -> (u32, u32)
[src]
Returns rendered screen pixel size (horizontal, vertical), including the border area, measured in pixels depending on Video::PIXEL_DENSITY.
The size depends on the given border_size
.
pub fn pixel_density() -> u32
[src]
Returns the horizontal pixel density.
pub fn visible_screen_bank(&self) -> usize
[src]
Returns the screen bank index of the currently visible screen.
The screen banks are different from memory banks.
E.g. Spectrum 128k returns 0
for the screen bank which resides in a memory bank 5 and 1
for the screen bank which resides in a memory bank 7. For 16k/48k Spectrum, this method always
returns 0
.
Implementors
impl<D, X> Video for Ula3<D, X>
[src]
type VideoFrame = Ula3VidFrame
type Contention = Ula3MemContention
pub fn border_color(&self) -> BorderColor
[src]
pub fn set_border_color(&mut self, border: BorderColor)
[src]
pub fn render_video_frame<'a, B: PixelBuffer<'a>, P: Palette<Pixel = B::Pixel>>(
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
[src]
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
pub fn visible_screen_bank(&self) -> usize
[src]
pub fn current_video_ts(&self) -> VideoTs
[src]
pub fn current_video_clock(
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
[src]
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
pub fn set_video_ts(&mut self, vts: VideoTs)
[src]
pub fn flash_state(&self) -> bool
[src]
impl<D, X> Video for Ula128<D, X>
[src]
type VideoFrame = Ula128VidFrame
type Contention = Ula128MemContention
pub fn border_color(&self) -> BorderColor
[src]
pub fn set_border_color(&mut self, border: BorderColor)
[src]
pub fn render_video_frame<'a, B: PixelBuffer<'a>, P: Palette<Pixel = B::Pixel>>(
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
[src]
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
pub fn visible_screen_bank(&self) -> usize
[src]
pub fn current_video_ts(&self) -> VideoTs
[src]
pub fn current_video_clock(
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
[src]
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
pub fn set_video_ts(&mut self, vts: VideoTs)
[src]
pub fn flash_state(&self) -> bool
[src]
impl<M, D, X, V> Video for Scld<M, D, X, V> where
M: PagedMemory8k,
V: VideoFrame,
[src]
M: PagedMemory8k,
V: VideoFrame,
pub const PIXEL_DENSITY: u32
[src]
type VideoFrame = V
type Contention = UlaMemoryContention
pub fn border_color(&self) -> BorderColor
[src]
pub fn set_border_color(&mut self, border: BorderColor)
[src]
pub fn render_video_frame<'a, B: PixelBuffer<'a>, P: Palette<Pixel = B::Pixel>>(
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
[src]
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
pub fn current_video_ts(&self) -> VideoTs
[src]
pub fn current_video_clock(
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
[src]
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
pub fn set_video_ts(&mut self, vts: VideoTs)
[src]
pub fn flash_state(&self) -> bool
[src]
impl<M: ZxMemory, D, X, V: VideoFrame> Video for Ula<M, D, X, V>
[src]
type VideoFrame = V
type Contention = UlaMemoryContention
pub fn border_color(&self) -> BorderColor
[src]
pub fn set_border_color(&mut self, border: BorderColor)
[src]
pub fn render_video_frame<'a, B: PixelBuffer<'a>, P: Palette<Pixel = B::Pixel>>(
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
[src]
&mut self,
buffer: &'a mut [u8],
pitch: usize,
border_size: BorderSize
)
pub fn current_video_ts(&self) -> VideoTs
[src]
pub fn current_video_clock(&self) -> VFrameTsCounter<V, UlaMemoryContention>
[src]
pub fn set_video_ts(&mut self, vts: VideoTs)
[src]
pub fn flash_state(&self) -> bool
[src]
impl<U> Video for UlaPlus<U> where
U: for<'a> UlaPlusInner<'a>,
[src]
U: for<'a> UlaPlusInner<'a>,
pub const PIXEL_DENSITY: u32
[src]
type VideoFrame = U::VideoFrame
type Contention = U::Contention
pub fn border_color(&self) -> BorderColor
[src]
pub fn set_border_color(&mut self, border: BorderColor)
[src]
pub fn render_video_frame<'b, B: PixelBuffer<'b>, P: Palette<Pixel = B::Pixel>>(
&mut self,
buffer: &'b mut [u8],
pitch: usize,
border_size: BorderSize
)
[src]
&mut self,
buffer: &'b mut [u8],
pitch: usize,
border_size: BorderSize
)
pub fn current_video_ts(&self) -> VideoTs
[src]
pub fn visible_screen_bank(&self) -> usize
[src]
pub fn current_video_clock(
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>
[src]
&self
) -> VFrameTsCounter<Self::VideoFrame, Self::Contention>