Trait zng_view::extensions::PxToWr

source ·
pub trait PxToWr {
    type AsLayout;
    type AsDevice;
    type AsWorld;

    // Required methods
    fn to_wr_device(self) -> Self::AsDevice;
    fn to_wr_world(self) -> Self::AsWorld;
    fn to_wr(self) -> Self::AsLayout;
}
Expand description

Conversion from Px to webrender units.

All conversions are 1 to 1.

Required Associated Types§

source

type AsLayout

Self equivalent in webrender::units::LayoutPixel units.

source

type AsDevice

Self equivalent in webrender::units::DevicePixel units.

source

type AsWorld

Self equivalent in `webrender::units::WorldPixel units.

Required Methods§

source

fn to_wr_device(self) -> Self::AsDevice

Returns self in webrender::units::DevicePixel units.

source

fn to_wr_world(self) -> Self::AsWorld

Returns self in webrender::units::WorldPixel units.

source

fn to_wr(self) -> Self::AsLayout

Returns self in webrender::units::LayoutPixel units.

Implementations on Foreign Types§

source§

impl PxToWr for PxTransform

source§

type AsDevice = Transform3D<f32, DevicePixel, DevicePixel>

source§

type AsLayout = Transform3D<f32, LayoutPixel, LayoutPixel>

source§

type AsWorld = Transform3D<f32, WorldPixel, WorldPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for FilterOp

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = FilterOp

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for AlphaType

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = AlphaType

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for BorderStyle

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = BorderStyle

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for ExtendMode

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = ExtendMode

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for ImageRendering

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = ImageRendering

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for LineOrientation

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = LineOrientation

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for LineStyle

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = (LineStyle, f32)

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for MixBlendMode

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = MixBlendMode

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for RepeatMode

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = RepeatMode

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for TransformStyle

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = TransformStyle

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for f32

source§

impl PxToWr for Rgba

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = ColorF

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for Px

source§

type AsDevice = Length<i32, DevicePixel>

source§

type AsWorld = Length<f32, WorldPixel>

source§

type AsLayout = Length<f32, LayoutPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for FrameValueId

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = PropertyBindingId

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for FontOptions

source§

type AsDevice = ()

source§

type AsWorld = Option<GlyphOptions>

source§

type AsLayout = Option<FontInstanceOptions>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for BorderSide

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = BorderSide

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for ReferenceFrameId

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = SpatialTreeItemKey

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxBox

source§

type AsDevice = Box2D<f32, DevicePixel>

source§

type AsLayout = Box2D<f32, LayoutPixel>

source§

type AsWorld = Box2D<f32, WorldPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxCornerRadius

source§

fn to_wr(self) -> BorderRadius

Convert to webrender border radius.

source§

type AsLayout = BorderRadius

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

impl PxToWr for PxPoint

source§

type AsDevice = Point2D<i32, DevicePixel>

source§

type AsWorld = Point2D<f32, WorldPixel>

source§

type AsLayout = Point2D<f32, LayoutPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxRect

source§

type AsDevice = Box2D<i32, DevicePixel>

source§

type AsWorld = Box2D<f32, WorldPixel>

source§

type AsLayout = Box2D<f32, LayoutPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxSideOffsets

source§

type AsDevice = SideOffsets2D<i32, DevicePixel>

source§

type AsLayout = SideOffsets2D<f32, LayoutPixel>

source§

type AsWorld = SideOffsets2D<f32, WorldPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxSize

source§

type AsDevice = Size2D<i32, DevicePixel>

source§

type AsWorld = Size2D<f32, WorldPixel>

source§

type AsLayout = Size2D<f32, LayoutPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl PxToWr for PxVector

source§

type AsDevice = Vector2D<f32, DevicePixel>

source§

type AsLayout = Vector2D<f32, LayoutPixel>

source§

type AsWorld = Vector2D<f32, WorldPixel>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl<T: PxToWr> PxToWr for FrameValue<T>

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = PropertyBinding<<T as PxToWr>::AsLayout>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout

source§

impl<T: PxToWr> PxToWr for FrameValueUpdate<T>

source§

type AsDevice = ()

source§

type AsWorld = ()

source§

type AsLayout = Option<PropertyValue<<T as PxToWr>::AsLayout>>

source§

fn to_wr_device(self) -> Self::AsDevice

source§

fn to_wr_world(self) -> Self::AsWorld

source§

fn to_wr(self) -> Self::AsLayout
where T: PxToWr,

Implementors§