[−][src]Struct luminance::framebuffer::Framebuffer
Typed framebuffers.
Parametricity
B
is the backend type. It must implement backend::framebuffer::Framebuffer.D
is the dimension type. It must implementDimensionable
.CS
is the color slot type. It must implementColorSlot
.DS
is the depth slot type. It must implementDepthSlot
.
Implementations
impl<B: ?Sized, D, CS, DS> Framebuffer<B, D, CS, DS> where
B: FramebufferBackend<D>,
D: Dimensionable,
CS: ColorSlot<B, D>,
DS: DepthSlot<B, D>,
[src]
B: FramebufferBackend<D>,
D: Dimensionable,
CS: ColorSlot<B, D>,
DS: DepthSlot<B, D>,
pub fn new<C>(
ctx: &mut C,
size: D::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Self, FramebufferError> where
C: GraphicsContext<Backend = B>,
[src]
ctx: &mut C,
size: D::Size,
mipmaps: usize,
sampler: Sampler
) -> Result<Self, FramebufferError> where
C: GraphicsContext<Backend = B>,
Create a new Framebuffer
.
The mipmaps
argument allows to pass the number of extra precision layers the texture will
be created with. A precision layer contains the same image as the base layer but in a lower
resolution. Currently, the way the resolution is computed depends on the backend, but it is
safe to assume that it’s logarithmic in base 2 — i.e. at each layer depth, the resolution
is divided by 2 on each axis.
Errors
It is possible that the Framebuffer
cannot be created. The FramebufferError
provides
the reason why.
Notes
You might be interested in the GraphicsContext::new_framebuffer
function instead, which
is the exact same function, but benefits from more type inference (based on &mut C
).
pub fn size(&self) -> D::Size
[src]
Get the size of the framebuffer.
pub fn color_slot(&mut self) -> &mut CS::ColorTextures
[src]
Access the carried ColorSlot
.
pub fn depth_slot(&mut self) -> &mut DS::DepthTexture
[src]
Access the carried DepthSlot
.
pub fn into_slots(self) -> (CS::ColorTextures, DS::DepthTexture)
[src]
Consume this framebuffer and return the carried slots.
pub fn into_color_slot(self) -> CS::ColorTextures
[src]
Consume this framebuffer and return the carried ColorSlot
.
pub fn into_depth_slot(self) -> DS::DepthTexture
[src]
Consume this framebuffer and return the carried DepthSlot
.
impl<B: ?Sized> Framebuffer<B, Dim2, (), ()> where
B: FramebufferBackend<Dim2> + FramebufferBackBuffer,
[src]
B: FramebufferBackend<Dim2> + FramebufferBackBuffer,
pub fn back_buffer<C>(
ctx: &mut C,
size: <Dim2 as Dimensionable>::Size
) -> Result<Self, FramebufferError> where
C: GraphicsContext<Backend = B>,
[src]
ctx: &mut C,
size: <Dim2 as Dimensionable>::Size
) -> Result<Self, FramebufferError> where
C: GraphicsContext<Backend = B>,
Get the back buffer from the input context and the required resolution.
Auto Trait Implementations
impl<B: ?Sized, D, CS, DS> RefUnwindSafe for Framebuffer<B, D, CS, DS> where
<CS as ColorSlot<B, D>>::ColorTextures: RefUnwindSafe,
<DS as DepthSlot<B, D>>::DepthTexture: RefUnwindSafe,
<B as Framebuffer<D>>::FramebufferRepr: RefUnwindSafe,
<CS as ColorSlot<B, D>>::ColorTextures: RefUnwindSafe,
<DS as DepthSlot<B, D>>::DepthTexture: RefUnwindSafe,
<B as Framebuffer<D>>::FramebufferRepr: RefUnwindSafe,
impl<B: ?Sized, D, CS, DS> Send for Framebuffer<B, D, CS, DS> where
<CS as ColorSlot<B, D>>::ColorTextures: Send,
<DS as DepthSlot<B, D>>::DepthTexture: Send,
<B as Framebuffer<D>>::FramebufferRepr: Send,
<CS as ColorSlot<B, D>>::ColorTextures: Send,
<DS as DepthSlot<B, D>>::DepthTexture: Send,
<B as Framebuffer<D>>::FramebufferRepr: Send,
impl<B: ?Sized, D, CS, DS> Sync for Framebuffer<B, D, CS, DS> where
<CS as ColorSlot<B, D>>::ColorTextures: Sync,
<DS as DepthSlot<B, D>>::DepthTexture: Sync,
<B as Framebuffer<D>>::FramebufferRepr: Sync,
<CS as ColorSlot<B, D>>::ColorTextures: Sync,
<DS as DepthSlot<B, D>>::DepthTexture: Sync,
<B as Framebuffer<D>>::FramebufferRepr: Sync,
impl<B: ?Sized, D, CS, DS> Unpin for Framebuffer<B, D, CS, DS> where
<CS as ColorSlot<B, D>>::ColorTextures: Unpin,
<DS as DepthSlot<B, D>>::DepthTexture: Unpin,
<B as Framebuffer<D>>::FramebufferRepr: Unpin,
<CS as ColorSlot<B, D>>::ColorTextures: Unpin,
<DS as DepthSlot<B, D>>::DepthTexture: Unpin,
<B as Framebuffer<D>>::FramebufferRepr: Unpin,
impl<B: ?Sized, D, CS, DS> UnwindSafe for Framebuffer<B, D, CS, DS> where
<CS as ColorSlot<B, D>>::ColorTextures: UnwindSafe,
<DS as DepthSlot<B, D>>::DepthTexture: UnwindSafe,
<B as Framebuffer<D>>::FramebufferRepr: UnwindSafe,
<CS as ColorSlot<B, D>>::ColorTextures: UnwindSafe,
<DS as DepthSlot<B, D>>::DepthTexture: UnwindSafe,
<B as Framebuffer<D>>::FramebufferRepr: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,