use crate::effect::{HostCapabilities, InvocationBase};
pub struct PassContext<'a, F> {
frame_data: &'a F,
base: &'a InvocationBase,
}
impl<'a, F> PassContext<'a, F> {
pub(crate) fn new(frame_data: &'a F, base: &'a InvocationBase) -> Self {
Self { frame_data, base }
}
#[inline]
pub fn frame_data(&self) -> &F {
self.frame_data
}
#[inline]
pub fn capabilities(&self) -> HostCapabilities {
self.base.capabilities()
}
#[inline]
pub fn output_width(&self) -> u32 {
self.base.output.width
}
#[inline]
pub fn output_height(&self) -> u32 {
self.base.output.height
}
#[inline]
pub fn frame_index(&self) -> u32 {
self.base.render_generation as u32
}
}
pub struct MipPyramidCtx<'a, F> {
frame_data: &'a F,
base: &'a InvocationBase,
}
impl<'a, F> MipPyramidCtx<'a, F> {
pub(crate) fn new(frame_data: &'a F, base: &'a InvocationBase) -> Self {
Self { frame_data, base }
}
#[inline]
pub fn frame_data(&self) -> &F {
self.frame_data
}
#[inline]
pub fn output_width(&self) -> u32 {
self.base.output.width
}
#[inline]
pub fn output_height(&self) -> u32 {
self.base.output.height
}
#[inline]
pub fn bytes_per_pixel(&self) -> u32 {
self.base.bytes_per_pixel
}
}