Struct core_graphics::context::CGContext
source · pub struct CGContext(_);
Implementations
sourceimpl CGContext
impl CGContext
pub fn type_id() -> CFTypeID
pub fn create_bitmap_context(
data: Option<*mut c_void>,
width: size_t,
height: size_t,
bits_per_component: size_t,
bytes_per_row: size_t,
space: &CGColorSpace,
bitmap_info: u32
) -> CGContext
pub fn data(&mut self) -> &mut [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Methods from Deref<Target = CGContextRef>
pub fn flush(&self)
pub fn width(&self) -> size_t
pub fn height(&self) -> size_t
pub fn bytes_per_row(&self) -> size_t
pub fn set_fill_color(&self, color: &CGColor)
pub fn set_rgb_fill_color(
&self,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat
)
pub fn set_gray_fill_color(&self, gray: CGFloat, alpha: CGFloat)
pub fn set_blend_mode(&self, blend_mode: CGBlendMode)
pub fn set_allows_font_smoothing(&self, allows_font_smoothing: bool)
pub fn set_font_smoothing_style(&self, style: i32)
pub fn set_should_smooth_fonts(&self, should_smooth_fonts: bool)
pub fn set_allows_antialiasing(&self, allows_antialiasing: bool)
pub fn set_should_antialias(&self, should_antialias: bool)
pub fn set_allows_font_subpixel_quantization(
&self,
allows_font_subpixel_quantization: bool
)
pub fn set_should_subpixel_quantize_fonts(
&self,
should_subpixel_quantize_fonts: bool
)
pub fn set_allows_font_subpixel_positioning(
&self,
allows_font_subpixel_positioning: bool
)
pub fn set_should_subpixel_position_fonts(
&self,
should_subpixel_position_fonts: bool
)
pub fn set_text_drawing_mode(&self, mode: CGTextDrawingMode)
pub fn add_path(&self, path: &CGPathRef)
pub fn close_path(&self)
pub fn fill_path(&self)
pub fn fill_rect(&self, rect: CGRect)
pub fn draw_image(&self, rect: CGRect, image: &CGImage)
pub fn create_image(&self) -> Option<CGImage>
pub fn set_font(&self, font: &CGFont)
pub fn set_font_size(&self, size: CGFloat)
pub fn set_text_matrix(&self, t: &CGAffineTransform)
pub fn show_glyphs_at_positions(&self, glyphs: &[CGGlyph], positions: &[CGPoint])
pub fn save(&self)
pub fn restore(&self)
pub fn translate(&self, tx: CGFloat, ty: CGFloat)
pub fn scale(&self, sx: CGFloat, sy: CGFloat)
Trait Implementations
sourceimpl AsRef<CGContextRef> for CGContext
impl AsRef<CGContextRef> for CGContext
sourcefn as_ref(&self) -> &CGContextRef
fn as_ref(&self) -> &CGContextRef
Converts this type into a shared reference of the (usually inferred) input type.
sourceimpl Borrow<CGContextRef> for CGContext
impl Borrow<CGContextRef> for CGContext
sourcefn borrow(&self) -> &CGContextRef
fn borrow(&self) -> &CGContextRef
Immutably borrows from an owned value. Read more
sourceimpl Deref for CGContext
impl Deref for CGContext
type Target = CGContextRef
type Target = CGContextRef
The resulting type after dereferencing.
sourcefn deref(&self) -> &CGContextRef
fn deref(&self) -> &CGContextRef
Dereferences the value.
Auto Trait Implementations
impl RefUnwindSafe for CGContext
impl !Send for CGContext
impl !Sync for CGContext
impl Unpin for CGContext
impl UnwindSafe for CGContext
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more