Struct ClearRenderPass
pub struct ClearRenderPass(/* private fields */);Expand description
Use a Clear Render Pass to clear the color, depth, and stencil buffers of the current render context before passing the control to the descendants of this render pass.
When you create a Clear Render Pass using the API, it does not clear any buffers. However, when you create a Clear Render Pass in Kanzi Studio, the render pass clears the depth buffer.
You control which buffers a Clear Render Pass clears by setting in the render pass the properties for those buffers. To disable the clearing of a buffer, remove from that render pass the property for the buffer the clearing of which you want to disable.
§Clear values
To clear any of the four color buffers, set the ClearColor0Property, ClearColor1Property, ClearColor2Property, or ClearColor3Property to an RGBA color. Values for each color range from 0.0f to 1.0f. When using the Clear Render Pass in Kanzi Studio, the most common use cases include clearing to either transparent black or any given opaque color. ColorRGBA::transparentBlack() is synonymous to ColorRGBA(0.0f, 0.0f, 0.0f, 0.0f) and provided for convenience.
To clear the depth buffer, set the ClearDepthProperty to a value between 0.0f and 1.0f. 1.0f represents the largest possible value in the depth buffer and is the most commonly used value. Unless you want to achieve a very specific effect, set the value of the ClearDepthProperty to either 1.0f or do not set the value at all.
To clear the stencil buffer, set the ClearStencilProperty to a value between 0 and 255. Since the stencil buffer is usually 8 bits, this means any 8-bit unsigned integer. For example, use the ClearStencilProperty to reset the stencil buffer before masking areas in it.
§Examples
To create a Clear Render Pass and set it to clear buffers:
Implementations§
§impl ClearRenderPass
impl ClearRenderPass
§impl ClearRenderPass
impl ClearRenderPass
pub fn get_clear_color0(&self) -> Result<ColorRGBA, Error>
pub fn get_clear_color0(&self) -> Result<ColorRGBA, Error>
pub fn set_clear_color0(&self, value: ColorRGBA) -> Result<(), Error>
pub fn set_clear_color0(&self, value: ColorRGBA) -> Result<(), Error>
pub fn get_clear_color1(&self) -> Result<ColorRGBA, Error>
pub fn get_clear_color1(&self) -> Result<ColorRGBA, Error>
pub fn set_clear_color1(&self, value: ColorRGBA) -> Result<(), Error>
pub fn set_clear_color1(&self, value: ColorRGBA) -> Result<(), Error>
pub fn get_clear_color2(&self) -> Result<ColorRGBA, Error>
pub fn get_clear_color2(&self) -> Result<ColorRGBA, Error>
pub fn set_clear_color2(&self, value: ColorRGBA) -> Result<(), Error>
pub fn set_clear_color2(&self, value: ColorRGBA) -> Result<(), Error>
pub fn get_clear_color3(&self) -> Result<ColorRGBA, Error>
pub fn get_clear_color3(&self) -> Result<ColorRGBA, Error>
pub fn set_clear_color3(&self, value: ColorRGBA) -> Result<(), Error>
pub fn set_clear_color3(&self, value: ColorRGBA) -> Result<(), Error>
pub fn get_clear_depth(&self) -> Result<f32, Error>
pub fn get_clear_depth(&self) -> Result<f32, Error>
See: CLEAR_DEPTH_PROPERTY
pub fn set_clear_depth(&self, value: f32) -> Result<(), Error>
pub fn set_clear_depth(&self, value: f32) -> Result<(), Error>
See: CLEAR_DEPTH_PROPERTY
pub fn get_clear_stencil(&self) -> Result<i32, Error>
pub fn get_clear_stencil(&self) -> Result<i32, Error>
pub fn set_clear_stencil(&self, value: i32) -> Result<(), Error>
pub fn set_clear_stencil(&self, value: i32) -> Result<(), Error>
Methods from Deref<Target = RenderPass>§
pub fn get_enabled(&self) -> Result<bool, Error>
pub fn get_enabled(&self) -> Result<bool, Error>
See: ENABLED_PROPERTY
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
pub fn set_enabled(&self, value: bool) -> Result<(), Error>
See: ENABLED_PROPERTY
pub fn get_input_viewport_area(&self) -> Result<Vector4, Error>
pub fn get_input_viewport_area(&self) -> Result<Vector4, Error>
pub fn set_input_viewport_area(&self, value: Vector4) -> Result<(), Error>
pub fn set_input_viewport_area(&self, value: Vector4) -> Result<(), Error>
pub fn get_update_rate(&self) -> Result<i32, Error>
pub fn get_update_rate(&self) -> Result<i32, Error>
See: UPDATE_RATE_PROPERTY
pub fn set_update_rate(&self, value: i32) -> Result<(), Error>
pub fn set_update_rate(&self, value: i32) -> Result<(), Error>
See: UPDATE_RATE_PROPERTY
pub fn get_update_offset(&self) -> Result<i32, Error>
pub fn get_update_offset(&self) -> Result<i32, Error>
pub fn set_update_offset(&self, value: i32) -> Result<(), Error>
pub fn set_update_offset(&self, value: i32) -> Result<(), Error>
Methods from Deref<Target = Resource>§
pub fn get_name(&self) -> Result<KanziString, Error>
pub fn get_name(&self) -> Result<KanziString, Error>
Gets the resource name.
pub fn get_url(&self) -> Result<KanziString, Error>
pub fn get_url(&self) -> Result<KanziString, Error>
Gets the resource URL. Note that the URL is not necessarily in URL form if resource has been just created.
§Returns
URL string.
Methods from Deref<Target = Object>§
pub fn as_ptr(&self) -> *mut ObjectWrapper
pub fn as_wrapper(&self) -> &ObjectWrapper
pub fn as_object(&self) -> &Object
pub fn as_object(&self) -> &Object
Represents any type inheriting from Object as &Object.
This is useful for comparisions when PartialEq traits failed to compare objects of
different types.
let child = screen.get_child(0)?;
let parent = child.get_parent()?.into_error(ErrorKind::ObjectNotFound)?;
// assert_eq!(screen, parent); // <- Fails to compile!
assert_eq!(screen.as_object(), parent.as_object());pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
pub fn get_native(&self) -> Result<NonNull<c_void>, Error>
Gets a pointer to the backing C++ instance.
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
pub fn get_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<<T as VariantConstraint>::RetArg, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers.
Base value is affected by the following inputs where the highest entry in the list determines the base value:
- Local value set with setProperty or loaded from kzb
- Value set by a style affecting the property.
- Value defined by class metadata.
Modifiers are not applied, the highest-priority base value is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
pub fn get_optional_property<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<Option<<T as VariantConstraint>::RetArg>, Error>where
T: PropertyTypeConstraint,
Returns the current value of a property disregarding modifiers, but does not default to the value in property metadata if there are no inputs to the property value.
If there is no value sources, None is returned.
If no inputs to the property value can be established the system returns the value default value from property type metadata.
§Arguments
property_type- The property type identifying the property to retrieve.
§Returns
The evaluated property value.
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_property<T>(
&self,
property_type: &PropertyType<T>,
value: <T as VariantConstraint>::DataArg<'_>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the local value of a property type.
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
pub fn has_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<bool, Error>where
T: PropertyTypeConstraint,
Evaluates whether there are any inputs into the property value. Both value sources and modifiers are taken into account.
§Returns
Returns true if there are inputs into the property value, false otherwise.
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn remove_local_value<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Removes the local value associated with the property.
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
pub fn get_metaclass(&self) -> Result<Metaclass, Error>
Returns the metaclass of the dynamic type of the object.
pub fn get_domain(&self) -> Result<Domain, Error>
pub fn get_domain(&self) -> Result<Domain, Error>
Returns the domain the object belongs to.
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
pub fn set_flag_keep_during_patching<T>(
&self,
property_type: &PropertyType<T>,
) -> Result<(), Error>where
T: PropertyTypeConstraint,
Sets the flag to indicate that the property was loaded from KZB.
pub fn debug_string(&self) -> Result<String, Error>
pub fn debug_string(&self) -> Result<String, Error>
Builds a string representation of the object intended for debugging purposes.
Trait Implementations§
§impl Clone for ClearRenderPass
impl Clone for ClearRenderPass
§fn clone(&self) -> ClearRenderPass
fn clone(&self) -> ClearRenderPass
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more