Struct script::dom::webgltexture::WebGLTexture
source · #[repr(C)]pub struct WebGLTexture {
webgl_object: WebGLObject,
id: WebGLTextureId,
target: Cell<Option<u32>>,
is_deleted: Cell<bool>,
owner: WebGLTextureOwner,
image_info_array: DomRefCell<[Option<ImageInfo>; 186]>,
face_count: Cell<u8>,
base_mipmap_level: u32,
min_filter: Cell<u32>,
mag_filter: Cell<u32>,
attached_framebuffer: MutNullableDom<WebGLFramebuffer>,
immutable_levels: Cell<Option<u32>>,
}
Fields§
§webgl_object: WebGLObject
§id: WebGLTextureId
§target: Cell<Option<u32>>
The target to which this texture was bound the first time
is_deleted: Cell<bool>
§owner: WebGLTextureOwner
§image_info_array: DomRefCell<[Option<ImageInfo>; 186]>
Stores information about mipmap levels and cubemap faces.
face_count: Cell<u8>
Face count can only be 1 or 6
base_mipmap_level: u32
§min_filter: Cell<u32>
§mag_filter: Cell<u32>
§attached_framebuffer: MutNullableDom<WebGLFramebuffer>
Framebuffer that this texture is attached to.
immutable_levels: Cell<Option<u32>>
Number of immutable levels.
Implementations§
source§impl WebGLTexture
impl WebGLTexture
fn __assert_parent_type(&self)
source§impl WebGLTexture
impl WebGLTexture
fn new_inherited(
context: &WebGLRenderingContext,
id: WebGLTextureId,
owner: Option<&XRSession>
) -> Self
pub fn maybe_new(context: &WebGLRenderingContext) -> Option<Root<Dom<Self>>>
pub fn new(
context: &WebGLRenderingContext,
id: WebGLTextureId
) -> Root<Dom<Self>>
pub fn new_webxr(
context: &WebGLRenderingContext,
id: WebGLTextureId,
session: &XRSession
) -> Root<Dom<Self>>
source§impl WebGLTexture
impl WebGLTexture
pub fn id(&self) -> WebGLTextureId
pub fn bind(&self, target: u32) -> WebGLResult<()>
pub fn initialize(
&self,
target: TexImageTarget,
width: u32,
height: u32,
depth: u32,
internal_format: TexFormat,
level: u32,
data_type: Option<TexDataType>
) -> WebGLResult<()>
pub fn generate_mipmap(&self) -> WebGLResult<()>
pub fn delete(&self, operation_fallibility: Operation)
pub fn is_invalid(&self) -> bool
pub fn is_immutable(&self) -> bool
pub fn target(&self) -> Option<u32>
pub fn maybe_get_tex_parameter(
&self,
param: TexParameter
) -> Option<TexParameterValue>
sourcepub fn tex_parameter(
&self,
param: u32,
value: TexParameterValue
) -> WebGLResult<()>
pub fn tex_parameter(
&self,
param: u32,
value: TexParameterValue
) -> WebGLResult<()>
We have to follow the conversion rules for GLES 2.0. See: https://www.khronos.org/webgl/public-mailing-list/archives/1008/msg00014.html
pub fn min_filter(&self) -> u32
pub fn mag_filter(&self) -> u32
pub fn is_using_linear_filtering(&self) -> bool
pub fn populate_mip_chain(
&self,
first_level: u32,
last_level: u32
) -> WebGLResult<()>
fn is_cube_complete(&self) -> bool
fn face_index_for_target(&self, target: &TexImageTarget) -> u8
pub fn image_info_for_target(
&self,
target: &TexImageTarget,
level: u32
) -> Option<ImageInfo>
pub fn image_info_at_face(&self, face: u8, level: u32) -> Option<ImageInfo>
fn set_image_infos_at_level(&self, level: u32, image_info: ImageInfo)
fn set_image_infos_at_level_and_face(
&self,
level: u32,
face: u8,
image_info: ImageInfo
)
fn base_image_info(&self) -> Option<ImageInfo>
pub fn attach_to_framebuffer(&self, fb: &WebGLFramebuffer)
pub fn detach_from_framebuffer(&self)
pub fn storage(
&self,
target: TexImageTarget,
levels: u32,
internal_format: TexFormat,
width: u32,
height: u32,
depth: u32
) -> WebGLResult<()>
Trait Implementations§
source§impl Castable for WebGLTexture
impl Castable for WebGLTexture
source§impl DomObject for WebGLTexture
impl DomObject for WebGLTexture
source§impl DomObjectWrap for WebGLTexture
impl DomObjectWrap for WebGLTexture
source§const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::WebGLTextureBinding::WebGLTextureBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::webgltexture::WebGLTexture>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webgltexture::WebGLTexture>>}
const WRAP: unsafe fn(_: SafeJSContext, _: &GlobalScope, _: Option<HandleObject<'_>>, _: Box<Self>) -> Root<Dom<Self>> = {dom::bindings::codegen::Bindings::WebGLTextureBinding::WebGLTextureBinding::Wrap as for<'a, 'b> unsafe fn(script_runtime::JSContext, &'a dom::globalscope::GlobalScope, std::option::Option<js::rust::Handle<'b, *mut js::jsapi::JSObject>>, std::boxed::Box<dom::webgltexture::WebGLTexture>) -> dom::bindings::root::Root<dom::bindings::root::Dom<dom::webgltexture::WebGLTexture>>}
Function pointer to the general wrap function type
source§impl Drop for WebGLTexture
impl Drop for WebGLTexture
source§impl HasParent for WebGLTexture
impl HasParent for WebGLTexture
source§fn as_parent(&self) -> &WebGLObject
fn as_parent(&self) -> &WebGLObject
This is used in a type assertion to ensure that the source and webidls agree as to what the parent type is
type Parent = WebGLObject
source§impl IDLInterface for WebGLTexture
impl IDLInterface for WebGLTexture
source§impl MallocSizeOf for WebGLTexture
impl MallocSizeOf for WebGLTexture
source§fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
fn size_of(&self, ops: &mut MallocSizeOfOps) -> usize
Measure the heap usage of all descendant heap-allocated structures, but
not the space taken up by the value itself.
source§impl MutDomObject for WebGLTexture
impl MutDomObject for WebGLTexture
source§unsafe fn init_reflector(&self, obj: *mut JSObject)
unsafe fn init_reflector(&self, obj: *mut JSObject)
Initializes the Reflector
source§impl PartialEq<WebGLTexture> for WebGLTexture
impl PartialEq<WebGLTexture> for WebGLTexture
source§fn eq(&self, other: &WebGLTexture) -> bool
fn eq(&self, other: &WebGLTexture) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl ToJSValConvertible for WebGLTexture
impl ToJSValConvertible for WebGLTexture
source§impl Traceable for WebGLTexture
impl Traceable for WebGLTexture
impl DerivedFrom<WebGLObject> for WebGLTexture
Auto Trait Implementations§
impl !RefUnwindSafe for WebGLTexture
impl !Send for WebGLTexture
impl !Sync for WebGLTexture
impl Unpin for WebGLTexture
impl !UnwindSafe for WebGLTexture
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> MaybeBoxed<Box<T, Global>> for T
impl<T> MaybeBoxed<Box<T, Global>> for T
source§fn maybe_boxed(self) -> Box<T, Global>
fn maybe_boxed(self) -> Box<T, Global>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert