Skip to content
Snippets Groups Projects
Commit 8aa3a7f8 authored by Kornel Lesiński's avatar Kornel Lesiński
Browse files

MaybeUninit

parent 683ee517
No related branches found
No related tags found
No related merge requests found
use super::*; use super::*;
use std::ptr; use std::ptr;
use std::mem; use std::mem::MaybeUninit;
/// CIE CAM02 /// CIE CAM02
pub struct CIECAM02 { pub struct CIECAM02 {
...@@ -28,18 +28,18 @@ impl CIECAM02 { ...@@ -28,18 +28,18 @@ impl CIECAM02 {
/// Evaluates the CAM02 model in the forward direction /// Evaluates the CAM02 model in the forward direction
pub fn forward(&mut self, input: &CIEXYZ) -> JCh { pub fn forward(&mut self, input: &CIEXYZ) -> JCh {
unsafe { unsafe {
let mut out = mem::uninitialized(); let mut out = MaybeUninit::uninit();
ffi::cmsCIECAM02Forward(self.handle, input, &mut out); ffi::cmsCIECAM02Forward(self.handle, input, out.as_mut_ptr());
out out.assume_init()
} }
} }
/// Evaluates the CAM02 model in the reverse direction /// Evaluates the CAM02 model in the reverse direction
pub fn reverse(&mut self, input: &JCh) -> CIEXYZ { pub fn reverse(&mut self, input: &JCh) -> CIEXYZ {
unsafe { unsafe {
let mut out = mem::uninitialized(); let mut out = MaybeUninit::uninit();
ffi::cmsCIECAM02Reverse(self.handle, input, &mut out); ffi::cmsCIECAM02Reverse(self.handle, input, out.as_mut_ptr());
out out.assume_init()
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment