pub struct ConversionParams {
pub scale: f32,
pub offset: f32,
pub out_min: f32,
pub out_max: f32,
pub nodata_in: f32,
pub nodata_out: f32,
pub use_nodata: u32,
/* private fields */
}Expand description
Parameters for data type conversion with scaling and offset.
Fields§
§scale: f32Scale factor applied to input values.
offset: f32Offset added after scaling.
out_min: f32Minimum output value (clamp).
out_max: f32Maximum output value (clamp).
nodata_in: f32NoData input value (if any).
nodata_out: f32NoData output value.
use_nodata: u32Whether to use nodata handling.
Implementations§
Source§impl ConversionParams
impl ConversionParams
Sourcepub fn new(scale: f32, offset: f32) -> Self
pub fn new(scale: f32, offset: f32) -> Self
Create new conversion parameters with scale and offset.
Sourcepub fn for_type_conversion(src: GpuDataType, dst: GpuDataType) -> Self
pub fn for_type_conversion(src: GpuDataType, dst: GpuDataType) -> Self
Create parameters for converting between specific data types.
Sourcepub fn with_clamp(self, min: f32, max: f32) -> Self
pub fn with_clamp(self, min: f32, max: f32) -> Self
Set output clamp range.
Sourcepub fn with_nodata(self, input_nodata: f32, output_nodata: f32) -> Self
pub fn with_nodata(self, input_nodata: f32, output_nodata: f32) -> Self
Set nodata handling.
Sourcepub fn u8_to_normalized() -> Self
pub fn u8_to_normalized() -> Self
Create parameters for normalizing u8 to [0, 1] range.
Sourcepub fn normalized_to_u8() -> Self
pub fn normalized_to_u8() -> Self
Create parameters for denormalizing [0, 1] to u8.
Sourcepub fn u16_to_normalized() -> Self
pub fn u16_to_normalized() -> Self
Create parameters for normalizing u16 to [0, 1] range.
Trait Implementations§
Source§impl Clone for ConversionParams
impl Clone for ConversionParams
Source§fn clone(&self) -> ConversionParams
fn clone(&self) -> ConversionParams
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConversionParams
impl Debug for ConversionParams
Source§impl Default for ConversionParams
impl Default for ConversionParams
impl Copy for ConversionParams
impl Pod for ConversionParams
Auto Trait Implementations§
impl Freeze for ConversionParams
impl RefUnwindSafe for ConversionParams
impl Send for ConversionParams
impl Sync for ConversionParams
impl Unpin for ConversionParams
impl UnsafeUnpin for ConversionParams
impl UnwindSafe for ConversionParams
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
Mutably borrows from an owned value. Read more
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.