pub struct Surf(/* private fields */);Implementations§
Source§impl Surf
impl Surf
Sourcepub fn type_id() -> TypeId
pub fn type_id() -> TypeId
use cidre::io;
let type_id = io::Surf::type_id();
assert_ne!(type_id, 0);Sourcepub fn create(properties: &Dictionary) -> Option<R<Surf>>
pub fn create(properties: &Dictionary) -> Option<R<Surf>>
use cidre::{cf, io};
let width = cf::Number::from_i32(100);
let height = cf::Number::from_i32(200);
let properties = cf::Dictionary::with_keys_values(
&[
io::surface::key::width(),
io::surface::key::height()
],
&[
&width,
&height
]
).unwrap();
let surf = io::Surf::create(&properties).unwrap();
assert_eq!(100, surf.width());
assert_eq!(200, surf.height());
assert_eq!(0, surf.plane_count());
assert_ne!(0, surf.id());
let props = surf.all_values().unwrap();
props.show();
assert!(props.len() >= 1);pub fn id(&self) -> SurfId
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn plane_count(&self) -> usize
pub fn plane_width(&self, plane_index: usize) -> usize
pub fn plane_height(&self, plane_index: usize) -> usize
Sourcepub fn lookup(csid: SurfId) -> Option<R<Surf>>
pub fn lookup(csid: SurfId) -> Option<R<Surf>>
use cidre::io;
let surf = io::Surf::lookup(0);
assert!(surf.is_none());pub fn all_values(&self) -> Option<R<DictionaryOf<String, Type>>>
pub fn remove_all_values(&mut self)
pub fn create_mach_port(&self) -> MachPort
Sourcepub fn from_mach_port(port: MachPort) -> Option<R<Surf>>
pub fn from_mach_port(port: MachPort) -> Option<R<Surf>>
This call takes a mach_port_t created via io::Surface::create_mach_port() and recreates an io::Surface from it.
This call does NOT destroy the port.
Sourcepub fn is_in_use(&self) -> bool
pub fn is_in_use(&self) -> bool
Returns true of an io::Surface is in use by any process in the system, otherwise false.
pub fn use_count(&self) -> i32
pub fn inc_use_count(&mut self)
pub fn dec_use_count(&mut self)
pub fn allows_pixel_size_casting(&self) -> bool
Sourcepub fn seed(&self) -> u32
pub fn seed(&self) -> u32
This will return the current seed value of the buffer and is a cheap call to make to see if the contents of the buffer have changed since the last lock/unlock.
Sourcepub fn alloc_size(&self) -> usize
pub fn alloc_size(&self) -> usize
Returns the total allocation size of the buffer including all planes.
pub unsafe fn from_raw(ptr: *mut u8) -> R<Self>
pub fn bytes_per_row(&self) -> usize
pub fn pixel_format(&self) -> Type
pub unsafe fn lock(&mut self, opts: LockOpts, seed: *mut u32) -> Result
pub unsafe fn unlock(&mut self, opts: LockOpts, seed: *mut u32) -> Result
Methods from Deref<Target = Type>§
pub fn get_type_id(&self) -> TypeId
pub unsafe fn as_type_ptr(&self) -> *const c_void
pub fn as_type_ref(&self) -> &Type
pub fn is_tagged_ptr(&self) -> bool
pub fn try_as_number(&self) -> Option<&Number>
pub fn try_as_string(&self) -> Option<&String>
pub fn show(&self)
pub fn allocator(&self) -> Option<&Allocator>
pub fn retain_count(&self) -> isize
Sourcepub fn equal(&self, other: &Type) -> bool
pub fn equal(&self, other: &Type) -> bool
use cidre::cf;
let n1 = cf::Number::from_i8(4);
let n2 = cf::Number::from_i32(4);
let n3 = cf::Number::from_f64(3.0);
assert!(n1.equal(&n2));
assert_eq!(false, n1.equal(&n3));pub fn hash(&self) -> usize
pub fn desc(&self) -> R<String>
Trait Implementations§
impl Send for Surf
Auto Trait Implementations§
impl !Sync for Surf
impl Freeze for Surf
impl RefUnwindSafe for Surf
impl Unpin for Surf
impl UnsafeUnpin for Surf
impl UnwindSafe for Surf
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