pub struct FeatureParameters(/* private fields */);Expand description
Feature parameters is a collection of parameters of a feature (ha!).
Implementations§
Source§impl FeatureParameters
impl FeatureParameters
Sourcepub fn new(&self) -> Result<Self>
pub fn new(&self) -> Result<Self>
Create a new feature parameter set.
§NVIDIA documentation
This interface allows allocating a simple parameter setup using named fields, whose lifetime the app must manage. For example one can set width by calling Set(NVSDK_NGX_Parameter_Denoiser_Width,100) or provide CUDA buffer pointer by calling Set(NVSDK_NGX_Parameter_Denoiser_Color,cudaBuffer) For more details please see sample code. Parameter maps output by NVSDK_NGX_AllocateParameters must NOT be freed using the free/delete operator; to free a parameter map output by NVSDK_NGX_AllocateParameters, NVSDK_NGX_DestroyParameters should be used. Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_AllocateParameters must be destroyed by the app using NVSDK_NGX_DestroyParameters. Also unlike with NVSDK_NGX_GetParameters, parameter maps output by NVSDK_NGX_AllocateParameters do not come pre-populated with NGX capabilities and available features. To create a new parameter map pre-populated with such information, NVSDK_NGX_GetCapabilityParameters should be used. This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which does not support this API call is being used. In such a case, NVSDK_NGX_GetParameters may be used as a fallback. This function may only be called after a successful call into NVSDK_NGX_Init.
Sourcepub fn get_capability_parameters() -> Result<Self>
pub fn get_capability_parameters() -> Result<Self>
Get a feature parameter set populated with NGX and feature capabilities.
§NVIDIA documentation
This interface allows the app to create a new parameter map pre-populated with NGX capabilities and available features. The output parameter map can also be used for any purpose parameter maps output by NVSDK_NGX_AllocateParameters can be used for but it is not recommended to use NVSDK_NGX_GetCapabilityParameters unless querying NGX capabilities and available features due to the overhead associated with pre-populating the parameter map. Parameter maps output by NVSDK_NGX_GetCapabilityParameters must NOT be freed using the free/delete operator; to free a parameter map output by NVSDK_NGX_GetCapabilityParameters, NVSDK_NGX_DestroyParameters should be used. Unlike with NVSDK_NGX_GetParameters, parameter maps allocated with NVSDK_NGX_GetCapabilityParameters must be destroyed by the app using NVSDK_NGX_DestroyParameters. This function may return NVSDK_NGX_Result_FAIL_OutOfDate if an older driver, which does not support this API call is being used. This function may only be called after a successful call into NVSDK_NGX_Init. If NVSDK_NGX_GetCapabilityParameters fails with NVSDK_NGX_Result_FAIL_OutOfDate, NVSDK_NGX_GetParameters may be used as a fallback, to get a parameter map pre-populated with NGX capabilities and available features.
Sourcepub fn set_ptr<T>(&self, name: &FeatureParameterName, ptr: *mut T)
pub fn set_ptr<T>(&self, name: &FeatureParameterName, ptr: *mut T)
Sets the value for the parameter named name to be a
type-erased (void *) pointer.
Sourcepub fn get_ptr(&self, name: &FeatureParameterName) -> Result<*mut c_void>
pub fn get_ptr(&self, name: &FeatureParameterName) -> Result<*mut c_void>
Returns a type-erased pointer associated with the provided
name.
Sourcepub fn set_bool(&self, name: &FeatureParameterName, value: bool)
pub fn set_bool(&self, name: &FeatureParameterName, value: bool)
Sourcepub fn get_bool(&self, name: &FeatureParameterName) -> Result<bool>
pub fn get_bool(&self, name: &FeatureParameterName) -> Result<bool>
Sourcepub fn set_f32(&self, name: &FeatureParameterName, value: f32)
pub fn set_f32(&self, name: &FeatureParameterName, value: f32)
Sets an f32 value for the parameter named name.
Sourcepub fn get_f32(&self, name: &FeatureParameterName) -> Result<f32>
pub fn get_f32(&self, name: &FeatureParameterName) -> Result<f32>
Returns a f32 value of a parameter named name.
Sourcepub fn set_u32(&self, name: &FeatureParameterName, value: u32)
pub fn set_u32(&self, name: &FeatureParameterName, value: u32)
Sets an u32 value for the parameter named name.
Sourcepub fn get_u32(&self, name: &FeatureParameterName) -> Result<u32>
pub fn get_u32(&self, name: &FeatureParameterName) -> Result<u32>
Returns a u32 value of a parameter named name.
Sourcepub fn set_f64(&self, name: &FeatureParameterName, value: f64)
pub fn set_f64(&self, name: &FeatureParameterName, value: f64)
Sets an f64 value for the parameter named name.
Sourcepub fn get_f64(&self, name: &FeatureParameterName) -> Result<f64>
pub fn get_f64(&self, name: &FeatureParameterName) -> Result<f64>
Returns a f64 value of a parameter named name.
Sourcepub fn set_i32(&self, name: &FeatureParameterName, value: i32)
pub fn set_i32(&self, name: &FeatureParameterName, value: i32)
Sets an i32 value for the parameter named name.
Sourcepub fn get_i32(&self, name: &FeatureParameterName) -> Result<i32>
pub fn get_i32(&self, name: &FeatureParameterName) -> Result<i32>
Returns a i32 value of a parameter named name.
Sourcepub fn set_u64(&self, name: &FeatureParameterName, value: u64)
pub fn set_u64(&self, name: &FeatureParameterName, value: u64)
Sets an u64 value for the parameter named name.
Sourcepub fn get_u64(&self, name: &FeatureParameterName) -> Result<u64>
pub fn get_u64(&self, name: &FeatureParameterName) -> Result<u64>
Returns a u64 value of a parameter named name.
Sourcepub fn supports_super_sampling(&self) -> Result<()>
pub fn supports_super_sampling(&self) -> Result<()>
Returns Ok if the parameters claim to support the
super sampling feature (nvngx_sys::NVSDK_NGX_Parameter_SuperSampling_Available).
Sourcepub fn supports_ray_reconstruction(&self) -> Result<()>
pub fn supports_ray_reconstruction(&self) -> Result<()>
Returns Ok if the parameters claim to support the
ray reconstruction feature ([nvngx_sys::NVSDK_NGX_Feature_RayReconstruction]).
Sourcepub fn supports_super_sampling_static() -> Result<()>
pub fn supports_super_sampling_static() -> Result<()>
Returns Ok if the parameters claim to support the
super sampling feature (nvngx_sys::NVSDK_NGX_Parameter_SuperSampling_Available).
Sourcepub fn supports_ray_reconstruction_static() -> Result<()>
pub fn supports_ray_reconstruction_static() -> Result<()>
Returns Ok if the parameters claim to support the
super sampling feature (nvngx_sys::NVSDK_NGX_Parameter_SuperSampling_Available).
Sourcepub fn is_super_sampling_initialised(&self) -> bool
pub fn is_super_sampling_initialised(&self) -> bool
Returns true if the SuperSampling feature is initialised
correctly.
Sourcepub fn is_ray_reconstruction_initialised(&self) -> bool
pub fn is_ray_reconstruction_initialised(&self) -> bool
Returns true if the Ray Reconstruction feature is initialised
correctly.