[−][src]Struct screen_13::gpu::write::WriteOp
Writes an iterator of source textures onto a destination texture, using optional modes.
WriteOp is intended to provide high speed image splatting for tile maps, bitmap drawing,
filtered image stretching, etc... Although generic 3D transforms are offered, the main
use of this operation is 2D image composition.
NOTE: When no image filtering or resizing is required the CopyOp may provide higher
performance. TODO: We can specialize for this so the API is the same, round the edge.
Examples
Writing a nine-sliced UI graphic:
use screen_13::prelude_all::*; ... fn render_ui() { // We've already sliced up a UI box image (🔪 top left, 🔪 top, 🔪 top right, ...) let slices: [BitmapRef; 9] = ... let render: &Render = ... render.write(). .with_mode(WriteMode::Blend(0x7f, BlendMode::ColorDodge)) .with_preserve() .record(&mut [ // top left Write::tile_position(&slices[0], Area::new(0, 0, 32, 32), Coord::new(0, 0)), // top Write::tile_position(&slices[1], Area::new(32, 0, 384, 32), Coord::new(32, 0)), // top right Write::tile_position(&slices[2], Area::new(426, 0, 32, 32), Coord::new(426, 0)), ... ]); }
Implementations
impl WriteOp[src]
#[must_use]pub fn with_mode(&mut self, mode: Mode) -> &mut Self[src]
Sets the current write mode.
#[must_use]pub fn with_preserve(&mut self) -> &mut Self[src]
Preserves the contents of the destination texture. Without calling this function the existing contents of the destination texture will not be composited into the final result.
#[must_use]pub fn with_preserve_is(&mut self, val: bool) -> &mut Self[src]
Sets whether the destination texture will be composited into the final result or not.
pub fn record(&mut self, writes: &mut [Write<'_>])[src]
Submits the given writes for hardware processing.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for WriteOp[src]
impl !Send for WriteOp[src]
impl !Sync for WriteOp[src]
impl Unpin for WriteOp[src]
impl !UnwindSafe for WriteOp[src]
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> Pointable for T
pub const ALIGN: usize
type Init = T
The type for initializers.
pub unsafe fn init(init: <T as Pointable>::Init) -> usize
pub unsafe fn deref<'a>(ptr: usize) -> &'a T
pub unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T
pub unsafe fn drop(ptr: usize)
impl<T> Same<T> for T[src]
type Output = T
Should always be Self
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>,