Struct CGContext

Source
#[repr(C)]
pub struct CGContext { /* private fields */ }
Available on crate feature CGContext only.
Expand description

Implementations§

Source§

impl CGContext

Source

pub unsafe fn save_g_state(c: Option<&CGContext>)

Graphics state functions. *

Source

pub unsafe fn restore_g_state(c: Option<&CGContext>)

Source

pub unsafe fn scale_ctm(c: Option<&CGContext>, sx: CGFloat, sy: CGFloat)

Coordinate space transformations. *

Source

pub unsafe fn translate_ctm(c: Option<&CGContext>, tx: CGFloat, ty: CGFloat)

Source

pub unsafe fn rotate_ctm(c: Option<&CGContext>, angle: CGFloat)

Source

pub unsafe fn concat_ctm(c: Option<&CGContext>, transform: CGAffineTransform)

Source

pub unsafe fn ctm(c: Option<&CGContext>) -> CGAffineTransform

Source

pub unsafe fn set_line_width(c: Option<&CGContext>, width: CGFloat)

Drawing attribute functions. *

Source

pub unsafe fn set_line_cap(c: Option<&CGContext>, cap: CGLineCap)

Available on crate feature CGPath only.
Source

pub unsafe fn set_line_join(c: Option<&CGContext>, join: CGLineJoin)

Available on crate feature CGPath only.
Source

pub unsafe fn set_miter_limit(c: Option<&CGContext>, limit: CGFloat)

Source

pub unsafe fn set_line_dash( c: Option<&CGContext>, phase: CGFloat, lengths: *const CGFloat, count: usize, )

Source

pub unsafe fn set_flatness(c: Option<&CGContext>, flatness: CGFloat)

Source

pub unsafe fn set_alpha(c: Option<&CGContext>, alpha: CGFloat)

Source

pub unsafe fn set_blend_mode(c: Option<&CGContext>, mode: CGBlendMode)

Source

pub unsafe fn begin_path(c: Option<&CGContext>)

Path construction functions. *

Source

pub unsafe fn move_to_point(c: Option<&CGContext>, x: CGFloat, y: CGFloat)

Source

pub unsafe fn add_line_to_point(c: Option<&CGContext>, x: CGFloat, y: CGFloat)

Source

pub unsafe fn add_curve_to_point( c: Option<&CGContext>, cp1x: CGFloat, cp1y: CGFloat, cp2x: CGFloat, cp2y: CGFloat, x: CGFloat, y: CGFloat, )

Source

pub unsafe fn add_quad_curve_to_point( c: Option<&CGContext>, cpx: CGFloat, cpy: CGFloat, x: CGFloat, y: CGFloat, )

Source

pub unsafe fn close_path(c: Option<&CGContext>)

Source

pub unsafe fn add_rect(c: Option<&CGContext>, rect: CGRect)

Path construction convenience functions. *

Source

pub unsafe fn add_rects( c: Option<&CGContext>, rects: *const CGRect, count: usize, )

Source

pub unsafe fn add_lines( c: Option<&CGContext>, points: *const CGPoint, count: usize, )

Source

pub unsafe fn add_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn add_arc( c: Option<&CGContext>, x: CGFloat, y: CGFloat, radius: CGFloat, start_angle: CGFloat, end_angle: CGFloat, clockwise: c_int, )

Source

pub unsafe fn add_arc_to_point( c: Option<&CGContext>, x1: CGFloat, y1: CGFloat, x2: CGFloat, y2: CGFloat, radius: CGFloat, )

Source

pub unsafe fn add_path(c: Option<&CGContext>, path: Option<&CGPath>)

Available on crate feature CGPath only.
Source

pub unsafe fn replace_path_with_stroked_path(c: Option<&CGContext>)

Source

pub unsafe fn is_path_empty(c: Option<&CGContext>) -> bool

Path information functions. *

Source

pub unsafe fn path_current_point(c: Option<&CGContext>) -> CGPoint

Source

pub unsafe fn path_bounding_box(c: Option<&CGContext>) -> CGRect

Source

pub unsafe fn path(c: Option<&CGContext>) -> Option<CFRetained<CGPath>>

Available on crate feature CGPath only.
Source

pub unsafe fn path_contains_point( c: Option<&CGContext>, point: CGPoint, mode: CGPathDrawingMode, ) -> bool

Source

pub unsafe fn draw_path(c: Option<&CGContext>, mode: CGPathDrawingMode)

Path drawing functions. *

Source

pub unsafe fn fill_path(c: Option<&CGContext>)

Path drawing convenience functions. *

Source

pub unsafe fn eo_fill_path(c: Option<&CGContext>)

Source

pub unsafe fn stroke_path(c: Option<&CGContext>)

Source

pub unsafe fn fill_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn fill_rects( c: Option<&CGContext>, rects: *const CGRect, count: usize, )

Source

pub unsafe fn stroke_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn stroke_rect_with_width( c: Option<&CGContext>, rect: CGRect, width: CGFloat, )

Source

pub unsafe fn clear_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn fill_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn stroke_ellipse_in_rect(c: Option<&CGContext>, rect: CGRect)

Source

pub unsafe fn stroke_line_segments( c: Option<&CGContext>, points: *const CGPoint, count: usize, )

Source

pub unsafe fn clip(c: Option<&CGContext>)

Clipping functions. *

Source

pub unsafe fn eo_clip(c: Option<&CGContext>)

Source

pub unsafe fn reset_clip(self: &CGContext)

Source

pub unsafe fn clip_to_mask( c: Option<&CGContext>, rect: CGRect, mask: Option<&CGImage>, )

Available on crate feature CGImage only.
Source

pub unsafe fn clip_bounding_box(c: Option<&CGContext>) -> CGRect

Source

pub unsafe fn clip_to_rect(c: Option<&CGContext>, rect: CGRect)

Clipping convenience functions. *

Source

pub unsafe fn clip_to_rects( c: Option<&CGContext>, rects: NonNull<CGRect>, count: usize, )

Source

pub unsafe fn set_fill_color_with_color( c: Option<&CGContext>, color: Option<&CGColor>, )

Available on crate feature CGColor only.

Primitive color functions. *

Source

pub unsafe fn set_stroke_color_with_color( c: Option<&CGContext>, color: Option<&CGColor>, )

Available on crate feature CGColor only.
Source

pub unsafe fn set_fill_color_space( c: Option<&CGContext>, space: Option<&CGColorSpace>, )

Available on crate feature CGColorSpace only.

Color space functions. *

Source

pub unsafe fn set_stroke_color_space( c: Option<&CGContext>, space: Option<&CGColorSpace>, )

Available on crate feature CGColorSpace only.
Source

pub unsafe fn set_fill_color(c: Option<&CGContext>, components: *const CGFloat)

Color functions. *

Source

pub unsafe fn set_stroke_color( c: Option<&CGContext>, components: *const CGFloat, )

Source

pub unsafe fn set_fill_pattern( c: Option<&CGContext>, pattern: Option<&CGPattern>, components: *const CGFloat, )

Available on crate feature CGPattern only.

Pattern functions. *

Source

pub unsafe fn set_stroke_pattern( c: Option<&CGContext>, pattern: Option<&CGPattern>, components: *const CGFloat, )

Available on crate feature CGPattern only.
Source

pub unsafe fn set_pattern_phase(c: Option<&CGContext>, phase: CGSize)

Source

pub unsafe fn set_gray_fill_color( c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat, )

Color convenience functions. *

Source

pub unsafe fn set_gray_stroke_color( c: Option<&CGContext>, gray: CGFloat, alpha: CGFloat, )

Source

pub unsafe fn set_rgb_fill_color( c: Option<&CGContext>, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat, )

Source

pub unsafe fn set_rgb_stroke_color( c: Option<&CGContext>, red: CGFloat, green: CGFloat, blue: CGFloat, alpha: CGFloat, )

Source

pub unsafe fn set_cmyk_fill_color( c: Option<&CGContext>, cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat, )

Source

pub unsafe fn set_cmyk_stroke_color( c: Option<&CGContext>, cyan: CGFloat, magenta: CGFloat, yellow: CGFloat, black: CGFloat, alpha: CGFloat, )

Source

pub unsafe fn set_rendering_intent( c: Option<&CGContext>, intent: CGColorRenderingIntent, )

Available on crate feature CGColorSpace only.

Rendering intent. *

Source

pub unsafe fn set_edr_target_headroom( self: &CGContext, headroom: c_float, ) -> bool

Source

pub unsafe fn edr_target_headroom(self: &CGContext) -> c_float

Source

pub unsafe fn draw_image( c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>, )

Available on crate feature CGImage only.

Image functions. *

Source

pub unsafe fn draw_tiled_image( c: Option<&CGContext>, rect: CGRect, image: Option<&CGImage>, )

Available on crate feature CGImage only.
Source

pub unsafe fn draw_image_applying_tone_mapping( self: &CGContext, r: CGRect, image: &CGImage, method: CGToneMapping, options: Option<&CFDictionary>, ) -> bool

Available on crate features CGImage and CGToneMapping only.
Source

pub unsafe fn interpolation_quality( c: Option<&CGContext>, ) -> CGInterpolationQuality

Source

pub unsafe fn set_interpolation_quality( c: Option<&CGContext>, quality: CGInterpolationQuality, )

Source

pub unsafe fn set_shadow_with_color( c: Option<&CGContext>, offset: CGSize, blur: CGFloat, color: Option<&CGColor>, )

Available on crate feature CGColor only.
Source

pub unsafe fn set_shadow(c: Option<&CGContext>, offset: CGSize, blur: CGFloat)

Source

pub unsafe fn draw_linear_gradient( c: Option<&CGContext>, gradient: Option<&CGGradient>, start_point: CGPoint, end_point: CGPoint, options: CGGradientDrawingOptions, )

Available on crate feature CGGradient only.
Source

pub unsafe fn draw_radial_gradient( c: Option<&CGContext>, gradient: Option<&CGGradient>, start_center: CGPoint, start_radius: CGFloat, end_center: CGPoint, end_radius: CGFloat, options: CGGradientDrawingOptions, )

Available on crate feature CGGradient only.
Source

pub unsafe fn draw_conic_gradient( self: &CGContext, gradient: Option<&CGGradient>, center: CGPoint, angle: CGFloat, )

Available on crate feature CGGradient only.
Source

pub unsafe fn draw_shading(c: Option<&CGContext>, shading: Option<&CGShading>)

Available on crate feature CGShading only.
Source

pub unsafe fn set_character_spacing(c: Option<&CGContext>, spacing: CGFloat)

Text functions. *

Source

pub unsafe fn set_text_position(c: Option<&CGContext>, x: CGFloat, y: CGFloat)

Source

pub unsafe fn text_position(c: Option<&CGContext>) -> CGPoint

Source

pub unsafe fn set_text_matrix(c: Option<&CGContext>, t: CGAffineTransform)

Source

pub unsafe fn text_matrix(c: Option<&CGContext>) -> CGAffineTransform

Source

pub unsafe fn set_text_drawing_mode( c: Option<&CGContext>, mode: CGTextDrawingMode, )

Source

pub unsafe fn set_font(c: Option<&CGContext>, font: Option<&CGFont>)

Available on crate feature CGFont only.
Source

pub unsafe fn set_font_size(c: Option<&CGContext>, size: CGFloat)

Source

pub unsafe fn show_glyphs_at_positions( c: Option<&CGContext>, glyphs: *const CGGlyph, lpositions: *const CGPoint, count: usize, )

Available on crate feature CGFont only.
Source

pub unsafe fn draw_pdf_page(c: Option<&CGContext>, page: Option<&CGPDFPage>)

Available on crate feature CGPDFPage only.

PDF functions. *

Source

pub unsafe fn begin_page(c: Option<&CGContext>, media_box: *const CGRect)

Output page functions. *

Source

pub unsafe fn end_page(c: Option<&CGContext>)

Source

pub unsafe fn flush(c: Option<&CGContext>)

Source

pub unsafe fn synchronize(c: Option<&CGContext>)

Source

pub unsafe fn set_should_antialias( c: Option<&CGContext>, should_antialias: bool, )

Source

pub unsafe fn set_allows_antialiasing( c: Option<&CGContext>, allows_antialiasing: bool, )

Source

pub unsafe fn set_should_smooth_fonts( c: Option<&CGContext>, should_smooth_fonts: bool, )

Source

pub unsafe fn set_allows_font_smoothing( c: Option<&CGContext>, allows_font_smoothing: bool, )

Source

pub unsafe fn set_should_subpixel_position_fonts( c: Option<&CGContext>, should_subpixel_position_fonts: bool, )

Source

pub unsafe fn set_allows_font_subpixel_positioning( c: Option<&CGContext>, allows_font_subpixel_positioning: bool, )

Source

pub unsafe fn set_should_subpixel_quantize_fonts( c: Option<&CGContext>, should_subpixel_quantize_fonts: bool, )

Source

pub unsafe fn set_allows_font_subpixel_quantization( c: Option<&CGContext>, allows_font_subpixel_quantization: bool, )

Source

pub unsafe fn begin_transparency_layer( c: Option<&CGContext>, auxiliary_info: Option<&CFDictionary>, )

Transparency layer support. *

Source

pub unsafe fn begin_transparency_layer_with_rect( c: Option<&CGContext>, rect: CGRect, aux_info: Option<&CFDictionary>, )

Source

pub unsafe fn end_transparency_layer(c: Option<&CGContext>)

Source

pub unsafe fn user_space_to_device_space_transform( c: Option<&CGContext>, ) -> CGAffineTransform

User space to device space tranformations. *

Source

pub unsafe fn convert_point_to_device_space( c: Option<&CGContext>, point: CGPoint, ) -> CGPoint

Source

pub unsafe fn convert_point_to_user_space( c: Option<&CGContext>, point: CGPoint, ) -> CGPoint

Source

pub unsafe fn convert_size_to_device_space( c: Option<&CGContext>, size: CGSize, ) -> CGSize

Source

pub unsafe fn convert_size_to_user_space( c: Option<&CGContext>, size: CGSize, ) -> CGSize

Source

pub unsafe fn convert_rect_to_device_space( c: Option<&CGContext>, rect: CGRect, ) -> CGRect

Source

pub unsafe fn convert_rect_to_user_space( c: Option<&CGContext>, rect: CGRect, ) -> CGRect

Source

pub unsafe fn select_font( c: Option<&CGContext>, name: *const c_char, size: CGFloat, text_encoding: CGTextEncoding, )

👎Deprecated: No longer supported
Source

pub unsafe fn show_text( c: Option<&CGContext>, string: *const c_char, length: usize, )

👎Deprecated: No longer supported
Source

pub unsafe fn show_text_at_point( c: Option<&CGContext>, x: CGFloat, y: CGFloat, string: *const c_char, length: usize, )

👎Deprecated: No longer supported
Source

pub unsafe fn show_glyphs( c: Option<&CGContext>, g: *const CGGlyph, count: usize, )

👎Deprecated: No longer supported
Available on crate feature CGFont only.
Source

pub unsafe fn show_glyphs_at_point( c: Option<&CGContext>, x: CGFloat, y: CGFloat, glyphs: *const CGGlyph, count: usize, )

👎Deprecated: No longer supported
Available on crate feature CGFont only.
Source

pub unsafe fn show_glyphs_with_advances( c: Option<&CGContext>, glyphs: *const CGGlyph, advances: *const CGSize, count: usize, )

👎Deprecated: No longer supported
Available on crate feature CGFont only.
Source

pub unsafe fn draw_pdf_document( c: Option<&CGContext>, rect: CGRect, document: Option<&CGPDFDocument>, page: c_int, )

👎Deprecated: No longer supported
Available on crate feature CGPDFDocument only.
Source§

impl CGContext

Source

pub unsafe fn draw_layer_in_rect( context: Option<&CGContext>, rect: CGRect, layer: Option<&CGLayer>, )

Available on crate feature CGLayer only.
Source

pub unsafe fn draw_layer_at_point( context: Option<&CGContext>, point: CGPoint, layer: Option<&CGLayer>, )

Available on crate feature CGLayer only.

Methods from Deref<Target = CFType>§

Source

pub fn downcast_ref<T>(&self) -> Option<&T>
where T: ConcreteType,

Attempt to downcast the type to that of type T.

This is the reference-variant. Use CFRetained::downcast if you want to convert a retained type. See also ConcreteType for more details on which types support being converted to.

Source

pub fn retain_count(&self) -> usize

Get the reference count of the object.

This function may be useful for debugging. You normally do not use this function otherwise.

Beware that some things (like CFNumbers, small CFStrings etc.) may not have a normal retain count for optimization purposes, and can return usize::MAX in that case.

Trait Implementations§

Source§

impl AsRef<AnyObject> for CGContext

Source§

fn as_ref(&self) -> &AnyObject

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CFType> for CGContext

Source§

fn as_ref(&self) -> &CFType

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<CGContext> for CGContext

Source§

fn as_ref(&self) -> &Self

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Borrow<AnyObject> for CGContext

Source§

fn borrow(&self) -> &AnyObject

Immutably borrows from an owned value. Read more
Source§

impl Borrow<CFType> for CGContext

Source§

fn borrow(&self) -> &CFType

Immutably borrows from an owned value. Read more
Source§

impl ConcreteType for CGContext

Source§

fn type_id() -> CFTypeID

Get the unique CFTypeID identifier for the type. Read more
Source§

impl Debug for CGContext

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Deref for CGContext

Source§

type Target = CFType

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Hash for CGContext

Source§

fn hash<H: Hasher>(&self, state: &mut H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl Message for CGContext

Source§

fn retain(&self) -> Retained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

impl PartialEq for CGContext

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl RefEncode for CGContext

Source§

const ENCODING_REF: Encoding

The Objective-C type-encoding for a reference of this type. Read more
Source§

impl Type for CGContext

Source§

fn retain(&self) -> CFRetained<Self>
where Self: Sized,

Increment the reference count of the receiver. Read more
Source§

fn as_concrete_TypeRef(&self) -> &Self

👎Deprecated: this is redundant
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_get_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::retain
Helper for easier transition from the core-foundation crate. Read more
Source§

fn as_CFTypeRef(&self) -> &CFType
where Self: AsRef<CFType>,

👎Deprecated: this is redundant (CF types deref to CFType)
Helper for easier transition from the core-foundation crate.
Source§

unsafe fn wrap_under_create_rule(ptr: *const Self) -> CFRetained<Self>
where Self: Sized,

👎Deprecated: use CFRetained::from_raw
Helper for easier transition from the core-foundation crate. Read more
Source§

impl Eq for CGContext

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

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

Source§

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.
Source§

impl<T> AutoreleaseSafe for T
where T: ?Sized,