Skip to main content

FeatureParameters

Struct FeatureParameters 

Source
pub struct FeatureParameters(/* private fields */);
Expand description

Feature parameters is a collection of parameters of a feature (ha!).

Implementations§

Source§

impl FeatureParameters

Source

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.

Source

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.

Source

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.

Source

pub fn get_ptr(&self, name: &FeatureParameterName) -> Result<*mut c_void>

Returns a type-erased pointer associated with the provided name.

Source

pub fn set_bool(&self, name: &FeatureParameterName, value: bool)

Sets an bool value for the parameter named name. The bool type isn’t supported in NGX, but the semantics - are. The boolean values are stored as integers with value 1 being true and 0 being false.

Source

pub fn get_bool(&self, name: &FeatureParameterName) -> Result<bool>

Returns a bool value of a parameter named name. The bool type isn’t supported in NGX, but the semantics - are. The boolean values are stored as integers with value 1 being true and 0 being false.

Source

pub fn set_f32(&self, name: &FeatureParameterName, value: f32)

Sets an f32 value for the parameter named name.

Source

pub fn get_f32(&self, name: &FeatureParameterName) -> Result<f32>

Returns a f32 value of a parameter named name.

Source

pub fn set_u32(&self, name: &FeatureParameterName, value: u32)

Sets an u32 value for the parameter named name.

Source

pub fn get_u32(&self, name: &FeatureParameterName) -> Result<u32>

Returns a u32 value of a parameter named name.

Source

pub fn set_f64(&self, name: &FeatureParameterName, value: f64)

Sets an f64 value for the parameter named name.

Source

pub fn get_f64(&self, name: &FeatureParameterName) -> Result<f64>

Returns a f64 value of a parameter named name.

Source

pub fn set_i32(&self, name: &FeatureParameterName, value: i32)

Sets an i32 value for the parameter named name.

Source

pub fn get_i32(&self, name: &FeatureParameterName) -> Result<i32>

Returns a i32 value of a parameter named name.

Source

pub fn set_u64(&self, name: &FeatureParameterName, value: u64)

Sets an u64 value for the parameter named name.

Source

pub fn get_u64(&self, name: &FeatureParameterName) -> Result<u64>

Returns a u64 value of a parameter named name.

Source

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).

Source

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]).

Source

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).

Source

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).

Source

pub fn is_super_sampling_initialised(&self) -> bool

Returns true if the SuperSampling feature is initialised correctly.

Source

pub fn is_ray_reconstruction_initialised(&self) -> bool

Returns true if the Ray Reconstruction feature is initialised correctly.

Trait Implementations§

Source§

impl Debug for FeatureParameters

Source§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Drop for FeatureParameters

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.