[−][src]Struct core_graphics::context::CGContext
Implementations
impl CGContext
[src]
pub fn type_id() -> CFTypeID
[src]
pub unsafe fn from_existing_context_ptr(ctx: *mut CGContext) -> CGContext
[src]
Creates a CGContext
instance from an existing CGContextRef
pointer.
This funtion will internally call CGRetain
and hence there is no need to call it explicitly.
This function is particularly useful for cases when the context is not instantiated/managed
by the caller, but it's retrieve via other means (e.g., by calling the method NSGraphicsContext::CGContext
in a cocoa application).
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
[src]
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]
[src]
Methods from Deref<Target = CGContextRef>
pub fn flush(&self)
[src]
pub fn width(&self) -> size_t
[src]
pub fn height(&self) -> size_t
[src]
pub fn bytes_per_row(&self) -> size_t
[src]
pub fn clip_bounding_box(&self) -> CGRect
[src]
pub fn set_fill_color(&self, color: &CGColor)
[src]
pub fn set_rgb_fill_color(
&self,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat
)
[src]
&self,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat
)
pub fn set_rgb_stroke_color(
&self,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat
)
[src]
&self,
red: CGFloat,
green: CGFloat,
blue: CGFloat,
alpha: CGFloat
)
pub fn set_gray_fill_color(&self, gray: CGFloat, alpha: CGFloat)
[src]
pub fn set_blend_mode(&self, blend_mode: CGBlendMode)
[src]
pub fn set_allows_font_smoothing(&self, allows_font_smoothing: bool)
[src]
pub fn set_font_smoothing_style(&self, style: i32)
[src]
pub fn set_should_smooth_fonts(&self, should_smooth_fonts: bool)
[src]
pub fn set_allows_antialiasing(&self, allows_antialiasing: bool)
[src]
pub fn set_should_antialias(&self, should_antialias: bool)
[src]
pub fn set_allows_font_subpixel_quantization(
&self,
allows_font_subpixel_quantization: bool
)
[src]
&self,
allows_font_subpixel_quantization: bool
)
pub fn set_should_subpixel_quantize_fonts(
&self,
should_subpixel_quantize_fonts: bool
)
[src]
&self,
should_subpixel_quantize_fonts: bool
)
pub fn set_allows_font_subpixel_positioning(
&self,
allows_font_subpixel_positioning: bool
)
[src]
&self,
allows_font_subpixel_positioning: bool
)
pub fn set_should_subpixel_position_fonts(
&self,
should_subpixel_position_fonts: bool
)
[src]
&self,
should_subpixel_position_fonts: bool
)
pub fn set_text_drawing_mode(&self, mode: CGTextDrawingMode)
[src]
pub fn set_line_cap(&self, cap: CGLineCap)
[src]
pub fn set_line_dash(&self, phase: CGFloat, lengths: &[CGFloat])
[src]
pub fn set_line_join(&self, join: CGLineJoin)
[src]
pub fn set_line_width(&self, width: CGFloat)
[src]
pub fn set_miter_limit(&self, limit: CGFloat)
[src]
pub fn add_path(&self, path: &CGPathRef)
[src]
pub fn add_curve_to_point(
&self,
cp1x: CGFloat,
cp1y: CGFloat,
cp2x: CGFloat,
cp2y: CGFloat,
x: CGFloat,
y: CGFloat
)
[src]
&self,
cp1x: CGFloat,
cp1y: CGFloat,
cp2x: CGFloat,
cp2y: CGFloat,
x: CGFloat,
y: CGFloat
)
pub fn add_quad_curve_to_point(
&self,
cpx: CGFloat,
cpy: CGFloat,
x: CGFloat,
y: CGFloat
)
[src]
&self,
cpx: CGFloat,
cpy: CGFloat,
x: CGFloat,
y: CGFloat
)
pub fn add_line_to_point(&self, x: CGFloat, y: CGFloat)
[src]
pub fn begin_path(&self)
[src]
pub fn close_path(&self)
[src]
pub fn move_to_point(&self, x: CGFloat, y: CGFloat)
[src]
pub fn clip(&self)
[src]
pub fn eo_clip(&self)
[src]
pub fn draw_path(&self, mode: CGPathDrawingMode)
[src]
pub fn fill_path(&self)
[src]
pub fn eo_fill_path(&self)
[src]
pub fn stroke_path(&self)
[src]
pub fn fill_rect(&self, rect: CGRect)
[src]
pub fn fill_rects(&self, rects: &[CGRect])
[src]
pub fn clear_rect(&self, rect: CGRect)
[src]
pub fn stroke_rect(&self, rect: CGRect)
[src]
pub fn stroke_rect_with_width(&self, rect: CGRect, width: CGFloat)
[src]
pub fn clip_to_rect(&self, rect: CGRect)
[src]
pub fn clip_to_rects(&self, rects: &[CGRect])
[src]
pub fn clip_to_mask(&self, rect: CGRect, image: &CGImage)
[src]
pub fn replace_path_with_stroked_path(&self)
[src]
pub fn fill_ellipse_in_rect(&self, rect: CGRect)
[src]
pub fn stroke_ellipse_in_rect(&self, rect: CGRect)
[src]
pub fn stroke_line_segments(&self, points: &[CGPoint])
[src]
pub fn set_interpolation_quality(&self, quality: CGInterpolationQuality)
[src]
pub fn get_interpolation_quality(&self) -> CGInterpolationQuality
[src]
pub fn draw_image(&self, rect: CGRect, image: &CGImage)
[src]
pub fn create_image(&self) -> Option<CGImage>
[src]
pub fn set_font(&self, font: &CGFont)
[src]
pub fn set_font_size(&self, size: CGFloat)
[src]
pub fn set_text_matrix(&self, t: &CGAffineTransform)
[src]
pub fn set_text_position(&self, x: CGFloat, y: CGFloat)
[src]
pub fn show_glyphs_at_positions(
&self,
glyphs: &[CGGlyph],
positions: &[CGPoint]
)
[src]
&self,
glyphs: &[CGGlyph],
positions: &[CGPoint]
)
pub fn save(&self)
[src]
pub fn restore(&self)
[src]
pub fn translate(&self, tx: CGFloat, ty: CGFloat)
[src]
pub fn scale(&self, sx: CGFloat, sy: CGFloat)
[src]
pub fn rotate(&self, angle: CGFloat)
[src]
pub fn get_ctm(&self) -> CGAffineTransform
[src]
pub fn concat_ctm(&self, transform: CGAffineTransform)
[src]
pub fn draw_linear_gradient(
&self,
gradient: &CGGradient,
start_point: CGPoint,
end_point: CGPoint,
options: CGGradientDrawingOptions
)
[src]
&self,
gradient: &CGGradient,
start_point: CGPoint,
end_point: CGPoint,
options: CGGradientDrawingOptions
)
pub fn draw_radial_gradient(
&self,
gradient: &CGGradient,
start_center: CGPoint,
start_radius: CGFloat,
end_center: CGPoint,
end_radius: CGFloat,
options: CGGradientDrawingOptions
)
[src]
&self,
gradient: &CGGradient,
start_center: CGPoint,
start_radius: CGFloat,
end_center: CGPoint,
end_radius: CGFloat,
options: CGGradientDrawingOptions
)
pub fn set_shadow(&self, offset: CGSize, blur: CGFloat)
[src]
pub fn set_shadow_with_color(
&self,
offset: CGSize,
blur: CGFloat,
color: &CGColor
)
[src]
&self,
offset: CGSize,
blur: CGFloat,
color: &CGColor
)
Trait Implementations
impl AsRef<CGContextRef> for CGContext
[src]
fn as_ref(&self) -> &CGContextRef
[src]
impl Borrow<CGContextRef> for CGContext
[src]
fn borrow(&self) -> &CGContextRef
[src]
impl Clone for CGContext
[src]
impl Deref for CGContext
[src]
type Target = CGContextRef
The resulting type after dereferencing.
fn deref(&self) -> &CGContextRef
[src]
impl DerefMut for CGContext
[src]
fn deref_mut(&mut self) -> &mut CGContextRef
[src]
impl Drop for CGContext
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,