Struct rerun::external::re_renderer::resource_managers::ImageDataDesc
source · pub struct ImageDataDesc<'a> {
pub label: DebugLabel,
pub data: Cow<'a, [u8]>,
pub format: SourceImageDataFormat,
pub width_height: [u32; 2],
}
Expand description
Describes image data for the purpose of creating a 2D texture.
Arbitrary (potentially gpu based) conversions may be performed to upload the data to the GPU.
Fields§
§label: DebugLabel
If this desc is not used for a texture update, this label is used for the target texture. Otherwise, it may still used for any intermediate resources that may be required during the conversion process.
data: Cow<'a, [u8]>
Data for the highest mipmap level.
Data is expected to be tightly packed. I.e. it is not padded according to wgpu buffer->texture transfer rules, padding will happen on the fly if necessary. TODO(andreas): This should be a kind of factory function/builder instead which gets target memory passed in.
format: SourceImageDataFormat
§width_height: [u32; 2]
The size of the resulting output texture / the semantic size of the image data.
The distinction is in particular important for planar formats. Which may be represented as a larger texture than the image they represent. With the output always being a (“mainstream” gpu readable) texture format, the output texture’s width/height is the semantic width/height of the image data!
Implementations§
source§impl<'a> ImageDataDesc<'a>
impl<'a> ImageDataDesc<'a>
sourcepub fn target_texture_usage_requirements(&self) -> TextureUsages
pub fn target_texture_usage_requirements(&self) -> TextureUsages
The texture usages required in order to store this image data.
sourcepub fn target_texture_format(&self) -> TextureFormat
pub fn target_texture_format(&self) -> TextureFormat
The texture format required in order to store this image data.
sourcepub fn create_target_texture(
&self,
ctx: &RenderContext,
texture_usages: TextureUsages
) -> Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
pub fn create_target_texture( &self, ctx: &RenderContext, texture_usages: TextureUsages ) -> Arc<DynamicResource<GpuTextureHandle, TextureDesc, GpuTextureInternal>>
Creates a texture that can hold the image data.
Auto Trait Implementations§
impl<'a> Freeze for ImageDataDesc<'a>
impl<'a> RefUnwindSafe for ImageDataDesc<'a>
impl<'a> Send for ImageDataDesc<'a>
impl<'a> Sync for ImageDataDesc<'a>
impl<'a> Unpin for ImageDataDesc<'a>
impl<'a> UnwindSafe for ImageDataDesc<'a>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request