package cairo

  1. Overview
  2. Docs
type status =
  1. | SUCCESS
  2. | NO_MEMORY
  3. | INVALID_RESTORE
  4. | INVALID_POP_GROUP
  5. | NO_CURRENT_POINT
  6. | INVALID_MATRIX
  7. | INVALID_STATUS
  8. | NULL_POINTER
  9. | INVALID_STRING
  10. | INVALID_PATH_DATA
  11. | READ_ERROR
  12. | WRITE_ERROR
  13. | SURFACE_FINISHED
  14. | SURFACE_TYPE_MISMATCH
  15. | PATTERN_TYPE_MISMATCH
  16. | INVALID_CONTENT
  17. | INVALID_FORMAT
  18. | INVALID_VISUAL
  19. | FILE_NOT_FOUND
  20. | INVALID_DASH
  21. | INVALID_DSC_COMMENT
  22. | INVALID_INDEX
  23. | CLIP_NOT_REPRESENTABLE
exception Error of status
val init : unit
val version_encode : int -> int -> int -> int
val run_time_version : unit -> int
val run_time_version_string : unit -> string
val compile_time_version : int
val compile_time_version_string : string
type t
type -'a surface
type -'a pattern
type -'a font_face
type surface_type = [
  1. | `BeOS
  2. | `DirectFB
  3. | `Glitz
  4. | `Image
  5. | `PDF
  6. | `PS
  7. | `Quartz
  8. | `SVG
  9. | `Win32
  10. | `XCB
  11. | `Xlib
]
type pattern_type = [
  1. | `Linear
  2. | `Radial
  3. | `Solid
  4. | `Surface
]
type font_type = [
  1. | `ATSUI
  2. | `FT
  3. | `TOY
  4. | `Win32
]
type content =
  1. | CONTENT_COLOR
  2. | CONTENT_ALPHA
  3. | CONTENT_COLOR_ALPHA
type point = {
  1. x : float;
  2. y : float;
}
type matrix = {
  1. xx : float;
  2. yx : float;
  3. xy : float;
  4. yy : float;
  5. x0 : float;
  6. y0 : float;
}
val create : [> `Any ] surface -> t
val save : t -> unit
val restore : t -> unit
val push_group : ?content:content -> t -> unit
val pop_group : t -> [ `Any ] pattern
val pop_group_to_source : t -> unit
val status : t -> status
val surface_status : [> `Any ] surface -> status
val pattern_status : [> `Any ] pattern -> status
val font_face_status : [> `Any ] font_face -> status
val string_of_status : status -> string
type operator =
  1. | OPERATOR_CLEAR
  2. | OPERATOR_SOURCE
  3. | OPERATOR_OVER
  4. | OPERATOR_IN
  5. | OPERATOR_OUT
  6. | OPERATOR_ATOP
  7. | OPERATOR_DEST
  8. | OPERATOR_DEST_OVER
  9. | OPERATOR_DEST_IN
  10. | OPERATOR_DEST_OUT
  11. | OPERATOR_DEST_ATOP
  12. | OPERATOR_XOR
  13. | OPERATOR_ADD
  14. | OPERATOR_SATURATE
val set_operator : t -> operator -> unit
val set_source : t -> [> `Any ] pattern -> unit
val set_source_rgb : t -> red:float -> green:float -> blue:float -> unit
val set_source_rgba : t -> red:float -> green:float -> blue:float -> alpha:float -> unit
val set_source_surface : t -> [> `Any ] surface -> float -> float -> unit
val set_tolerance : t -> float -> unit
type antialias =
  1. | ANTIALIAS_DEFAULT
  2. | ANTIALIAS_NONE
  3. | ANTIALIAS_GRAY
  4. | ANTIALIAS_SUBPIXEL
val set_antialias : t -> antialias -> unit
type fill_rule =
  1. | FILL_RULE_WINDING
  2. | FILL_RULE_EVEN_ODD
val set_fill_rule : t -> fill_rule -> unit
val set_line_width : t -> float -> unit
type line_cap =
  1. | LINE_CAP_BUTT
  2. | LINE_CAP_ROUND
  3. | LINE_CAP_SQUARE
val set_line_cap : t -> line_cap -> unit
type line_join =
  1. | LINE_JOIN_MITER
  2. | LINE_JOIN_ROUND
  3. | LINE_JOIN_BEVEL
val set_line_join : t -> line_join -> unit
val set_dash : t -> float array -> float -> unit
val set_miter_limit : t -> float -> unit
val translate : t -> tx:float -> ty:float -> unit
val scale : t -> sx:float -> sy:float -> unit
val rotate : t -> angle:float -> unit
val transform : t -> matrix -> unit
val set_matrix : t -> matrix -> unit
val identity_matrix : t -> unit
val user_to_device : t -> point -> point
val user_to_device_distance : t -> point -> point
val device_to_user : t -> point -> point
val device_to_user_distance : t -> point -> point
val new_path : t -> unit
val move_to : t -> x:float -> y:float -> unit
val move_to_point : t -> point -> unit
val new_sub_path : t -> unit
val line_to : t -> x:float -> y:float -> unit
val line_to_point : t -> point -> unit
val curve_to : t -> x1:float -> y1:float -> x2:float -> y2:float -> x3:float -> y3:float -> unit
val curve_to_point : t -> point -> point -> point -> unit
val arc : t -> xc:float -> yc:float -> radius:float -> angle1:float -> angle2:float -> unit
val arc_negative : t -> xc:float -> yc:float -> radius:float -> angle1:float -> angle2:float -> unit
val rel_move_to : t -> dx:float -> dy:float -> unit
val rel_line_to : t -> dx:float -> dy:float -> unit
val rel_curve_to : t -> dx1:float -> dy1:float -> dx2:float -> dy2:float -> dx3:float -> dy3:float -> unit
val rectangle : t -> x:float -> y:float -> width:float -> height:float -> unit
val close_path : t -> unit
val paint : t -> unit
val paint_with_alpha : t -> float -> unit
val mask : t -> [> `Any ] pattern -> unit
val mask_surface : t -> [> `Any ] surface -> surface_x:float -> surface_y:float -> unit
val stroke : t -> unit
val stroke_preserve : t -> unit
val fill : t -> unit
val fill_preserve : t -> unit
val copy_page : t -> unit
val show_page : t -> unit
val in_stroke : t -> point -> bool
val in_fill : t -> point -> bool
val stroke_extents : t -> float * float * float * float
val fill_extents : t -> float * float * float * float
val reset_clip : t -> unit
val clip : t -> unit
val clip_preserve : t -> unit
type glyph = {
  1. index : int;
  2. glyph_x : float;
  3. glyph_y : float;
}
type text_extents = {
  1. x_bearing : float;
  2. y_bearing : float;
  3. text_width : float;
  4. text_height : float;
  5. x_advance : float;
  6. y_advance : float;
}
type font_extents = {
  1. ascent : float;
  2. descent : float;
  3. font_height : float;
  4. max_x_advance : float;
  5. max_y_advance : float;
}
type font_slant =
  1. | FONT_SLANT_NORMAL
  2. | FONT_SLANT_ITALIC
  3. | FONT_SLANT_OBLIQUE
type font_weight =
  1. | FONT_WEIGHT_NORMAL
  2. | FONT_WEIGHT_BOLD
type subpixel_order =
  1. | SUBPIXEL_ORDER_DEFAULT
  2. | SUBPIXEL_ORDER_RGB
  3. | SUBPIXEL_ORDER_BGR
  4. | SUBPIXEL_ORDER_VRGB
  5. | SUBPIXEL_ORDER_VBGR
type hint_style =
  1. | HINT_STYLE_DEFAULT
  2. | HINT_STYLE_NONE
  3. | HINT_STYLE_SLIGHT
  4. | HINT_STYLE_MEDIUM
  5. | HINT_STYLE_FULL
type hint_metrics =
  1. | HINT_METRICS_DEFAULT
  2. | HINT_METRICS_OFF
  3. | HINT_METRICS_ON
val font_face_get_type : [> `Any ] font_face -> [ `ATSUI | `Any | `FT | `TOY | `Win32 ]
val font_face_downcast_to_toy : [> `Any ] font_face -> [ `Any | `TOY ] font_face
module Font_Options : sig ... end
module Scaled_Font : sig ... end
val select_font_face : t -> string -> font_slant -> font_weight -> unit
val set_font_size : t -> float -> unit
val set_font_matrix : t -> matrix -> unit
val get_font_matrix : t -> matrix
val set_font_options : t -> Font_Options.t -> unit
val merge_font_options : t -> Font_Options.t -> unit
val get_font_options : t -> Font_Options.t
val set_scaled_font : t -> [> `Any ] Scaled_Font.t -> unit
val show_text : t -> string -> unit
val show_glyphs : t -> glyph array -> unit
val get_font_face : t -> [ `Any ] font_face
val font_extents : t -> font_extents
val set_font_face : t -> [> `Any ] font_face -> unit
val text_extents : t -> string -> text_extents
val glyph_extents : t -> glyph array -> text_extents
val text_path : t -> string -> unit
val glyph_path : t -> glyph array -> unit
val get_operator : t -> operator
val get_source : t -> [ `Any ] pattern
val get_tolerance : t -> float
val get_antialias : t -> antialias
val get_current_point : t -> point
val get_fill_rule : t -> fill_rule
val get_line_width : t -> float
val get_line_cap : t -> line_cap
val get_line_join : t -> line_join
val get_miter_limit : t -> float
val get_matrix : t -> matrix
val get_target : t -> [ `Any ] surface
val get_group_target : t -> [ `Any ] surface
type flat_path = [
  1. | `CLOSE
  2. | `LINE_TO of point
  3. | `MOVE_TO of point
]
type path = [
  1. | `CLOSE
  2. | `CURVE_TO of point * point * point
  3. | `LINE_TO of point
  4. | `MOVE_TO of point
]
val fold_path : t -> ('a -> [> path ] -> 'a) -> 'a -> 'a
val fold_path_flat : t -> ('a -> [> flat_path ] -> 'a) -> 'a -> 'a
val append_path : t -> [< path ] -> unit
val surface_create_similar : [> `Any ] surface -> content -> width:int -> height:int -> [ `Any ] surface
val surface_finish : [> `Any ] surface -> unit
val surface_get_type : [> `Any ] surface -> [ `Any | `BeOS | `DirectFB | `Glitz | `Image | `PDF | `PS | `Quartz | `SVG | `Win32 | `XCB | `Xlib ]
val surface_get_content : [> `Any ] surface -> content
val surface_get_font_options : [> `Any ] surface -> Font_Options.t
val surface_flush : [> `Any ] surface -> unit
val mark_dirty : [> `Any ] surface -> unit
val mark_dirty_rectangle : [> `Any ] surface -> int -> int -> int -> int -> unit
val surface_set_device_offset : [> `Any ] surface -> float -> float -> unit
val surface_get_device_offset : [> `Any ] surface -> float * float
val surface_set_fallback_resolution : [> `Any ] surface -> float -> float -> unit
type image_surface = [ `Any | `Image ] surface
type format =
  1. | FORMAT_ARGB32
  2. | FORMAT_RGB24
  3. | FORMAT_A8
  4. | FORMAT_A1
val image_surface_create : format -> width:int -> height:int -> image_surface
val image_surface_get_format : [> `Image ] surface -> format
val image_surface_get_width : [> `Image ] surface -> int
val image_surface_get_height : [> `Image ] surface -> int
val image_surface_get_stride : [> `Image ] surface -> int
type solid_pattern = [ `Any | `Solid ] pattern
type surface_pattern = [ `Any | `Surface ] pattern
type gradient_pattern = [ `Any | `Gradient ] pattern
type extend =
  1. | EXTEND_NONE
  2. | EXTEND_REPEAT
  3. | EXTEND_REFLECT
type filter =
  1. | FILTER_FAST
  2. | FILTER_GOOD
  3. | FILTER_BEST
  4. | FILTER_NEAREST
  5. | FILTER_BILINEAR
  6. | FILTER_GAUSSIAN
module Pattern : sig ... end
module Matrix : sig ... end
OCaml

Innovation. Community. Security.