pub struct CGContextRef(/* private fields */);
Expand description

A borrowed reference to a CGContext.

Implementations§

source§

impl CGContextRef

source

pub fn flush(&self)

source

pub fn width(&self) -> size_t

source

pub fn height(&self) -> size_t

source

pub fn bytes_per_row(&self) -> size_t

source

pub fn clip_bounding_box(&self) -> CGRect

source

pub fn set_fill_color(&self, color: &CGColor)

source

pub fn set_rgb_fill_color( &self, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat )

source

pub fn set_rgb_stroke_color( &self, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat )

source

pub fn set_gray_fill_color(&self, gray: CGFloat, alpha: CGFloat)

source

pub fn set_blend_mode(&self, blend_mode: CGBlendMode)

source

pub fn set_allows_font_smoothing(&self, allows_font_smoothing: bool)

source

pub fn set_font_smoothing_style(&self, style: i32)

source

pub fn set_should_smooth_fonts(&self, should_smooth_fonts: bool)

source

pub fn set_allows_antialiasing(&self, allows_antialiasing: bool)

source

pub fn set_should_antialias(&self, should_antialias: bool)

source

pub fn set_allows_font_subpixel_quantization( &self, allows_font_subpixel_quantization: bool )

source

pub fn set_should_subpixel_quantize_fonts( &self, should_subpixel_quantize_fonts: bool )

source

pub fn set_allows_font_subpixel_positioning( &self, allows_font_subpixel_positioning: bool )

source

pub fn set_should_subpixel_position_fonts( &self, should_subpixel_position_fonts: bool )

source

pub fn set_text_drawing_mode(&self, mode: CGTextDrawingMode)

source

pub fn set_line_cap(&self, cap: CGLineCap)

source

pub fn set_line_dash(&self, phase: CGFloat, lengths: &[CGFloat])

source

pub fn set_line_join(&self, join: CGLineJoin)

source

pub fn set_line_width(&self, width: CGFloat)

source

pub fn set_miter_limit(&self, limit: CGFloat)

source

pub fn add_path(&self, path: &CGPathRef)

source

pub fn add_curve_to_point( &self, cp1x: CGFloat, cp1y: CGFloat, cp2x: CGFloat, cp2y: CGFloat, x: CGFloat, y: CGFloat )

source

pub fn add_quad_curve_to_point( &self, cpx: CGFloat, cpy: CGFloat, x: CGFloat, y: CGFloat )

source

pub fn add_line_to_point(&self, x: CGFloat, y: CGFloat)

source

pub fn begin_path(&self)

source

pub fn close_path(&self)

source

pub fn move_to_point(&self, x: CGFloat, y: CGFloat)

source

pub fn clip(&self)

source

pub fn eo_clip(&self)

source

pub fn reset_clip(&self)

source

pub fn draw_path(&self, mode: CGPathDrawingMode)

source

pub fn fill_path(&self)

source

pub fn eo_fill_path(&self)

source

pub fn stroke_path(&self)

source

pub fn fill_rect(&self, rect: CGRect)

source

pub fn fill_rects(&self, rects: &[CGRect])

source

pub fn clear_rect(&self, rect: CGRect)

source

pub fn stroke_rect(&self, rect: CGRect)

source

pub fn stroke_rect_with_width(&self, rect: CGRect, width: CGFloat)

source

pub fn clip_to_rect(&self, rect: CGRect)

source

pub fn clip_to_rects(&self, rects: &[CGRect])

source

pub fn clip_to_mask(&self, rect: CGRect, image: &CGImage)

source

pub fn replace_path_with_stroked_path(&self)

source

pub fn fill_ellipse_in_rect(&self, rect: CGRect)

source

pub fn stroke_ellipse_in_rect(&self, rect: CGRect)

source

pub fn stroke_line_segments(&self, points: &[CGPoint])

source

pub fn set_interpolation_quality(&self, quality: CGInterpolationQuality)

source

pub fn get_interpolation_quality(&self) -> CGInterpolationQuality

source

pub fn draw_image(&self, rect: CGRect, image: &CGImage)

source

pub fn create_image(&self) -> Option<CGImage>

source

pub fn set_font(&self, font: &CGFont)

source

pub fn set_font_size(&self, size: CGFloat)

source

pub fn set_text_matrix(&self, t: &CGAffineTransform)

source

pub fn set_text_position(&self, x: CGFloat, y: CGFloat)

source

pub fn show_glyphs_at_positions( &self, glyphs: &[CGGlyph], positions: &[CGPoint] )

source

pub fn save(&self)

source

pub fn restore(&self)

source

pub fn translate(&self, tx: CGFloat, ty: CGFloat)

source

pub fn scale(&self, sx: CGFloat, sy: CGFloat)

source

pub fn rotate(&self, angle: CGFloat)

source

pub fn get_ctm(&self) -> CGAffineTransform

source

pub fn concat_ctm(&self, transform: CGAffineTransform)

source

pub fn draw_linear_gradient( &self, gradient: &CGGradient, start_point: CGPoint, end_point: CGPoint, options: CGGradientDrawingOptions )

source

pub fn draw_radial_gradient( &self, gradient: &CGGradient, start_center: CGPoint, start_radius: CGFloat, end_center: CGPoint, end_radius: CGFloat, options: CGGradientDrawingOptions )

source

pub fn set_shadow(&self, offset: CGSize, blur: CGFloat)

source

pub fn set_shadow_with_color( &self, offset: CGSize, blur: CGFloat, color: &CGColor )

source

pub fn set_alpha(&self, alpha: CGFloat)

Trait Implementations§

source§

impl ForeignTypeRef for CGContextRef

§

type CType = CGContext

The raw C type.
source§

unsafe fn from_ptr<'a>(ptr: *mut Self::CType) -> &'a Self

Constructs a shared instance of this type from its raw type. Read more
source§

unsafe fn from_ptr_mut<'a>(ptr: *mut Self::CType) -> &'a mut Self

Constructs a mutable reference of this type from its raw type. Read more
source§

fn as_ptr(&self) -> *mut Self::CType

Returns a raw pointer to the wrapped value.
source§

impl ToOwned for CGContextRef

§

type Owned = CGContext

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> CGContext

Creates owned data from borrowed data, usually by cloning. Read more
1.63.0 · source§

fn clone_into(&self, target: &mut Self::Owned)

Uses borrowed data to replace owned data, usually by cloning. 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>,

§

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>,

§

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.