⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cairo.h

📁 按照官方的说法:Cairo is a vector graphics library with cross-device output support. 翻译过来
💻 H
📖 第 1 页 / 共 4 页
字号:
typedef enum _cairo_surface_type {    CAIRO_SURFACE_TYPE_IMAGE,    CAIRO_SURFACE_TYPE_PDF,    CAIRO_SURFACE_TYPE_PS,    CAIRO_SURFACE_TYPE_XLIB,    CAIRO_SURFACE_TYPE_XCB,    CAIRO_SURFACE_TYPE_GLITZ,    CAIRO_SURFACE_TYPE_QUARTZ,    CAIRO_SURFACE_TYPE_WIN32,    CAIRO_SURFACE_TYPE_BEOS,    CAIRO_SURFACE_TYPE_DIRECTFB,    CAIRO_SURFACE_TYPE_SVG} cairo_surface_type_t;cairo_public cairo_surface_type_tcairo_surface_get_type (cairo_surface_t *surface);cairo_public cairo_content_tcairo_surface_get_content (cairo_surface_t *surface);#if CAIRO_HAS_PNG_FUNCTIONScairo_public cairo_status_tcairo_surface_write_to_png (cairo_surface_t	*surface,			    const char		*filename);cairo_public cairo_status_tcairo_surface_write_to_png_stream (cairo_surface_t	*surface,				   cairo_write_func_t	write_func,				   void			*closure);#endifcairo_public void *cairo_surface_get_user_data (cairo_surface_t		 *surface,			     const cairo_user_data_key_t *key);cairo_public cairo_status_tcairo_surface_set_user_data (cairo_surface_t		 *surface,			     const cairo_user_data_key_t *key,			     void			 *user_data,			     cairo_destroy_func_t	 destroy);cairo_public voidcairo_surface_get_font_options (cairo_surface_t      *surface,				cairo_font_options_t *options);cairo_public voidcairo_surface_flush (cairo_surface_t *surface);cairo_public voidcairo_surface_mark_dirty (cairo_surface_t *surface);cairo_public voidcairo_surface_mark_dirty_rectangle (cairo_surface_t *surface,				    int              x,				    int              y,				    int              width,				    int              height);cairo_public voidcairo_surface_set_device_offset (cairo_surface_t *surface,				 double           x_offset,				 double           y_offset);cairo_public voidcairo_surface_get_device_offset (cairo_surface_t *surface,				 double          *x_offset,				 double          *y_offset);cairo_public voidcairo_surface_set_fallback_resolution (cairo_surface_t	*surface,				       double		 x_pixels_per_inch,				       double		 y_pixels_per_inch);/* Image-surface functions *//** * cairo_format_t * @CAIRO_FORMAT_ARGB32: each pixel is a 32-bit quantity, with *   alpha in the upper 8 bits, then red, then green, then blue. *   The 32-bit quantities are stored native-endian. Pre-multiplied *   alpha is used. (That is, 50% transparent red is 0x80800000, *   not 0x80ff0000.) * @CAIRO_FORMAT_RGB24: each pixel is a 32-bit quantity, with *   the upper 8 bits unused. Red, Green, and Blue are stored *   in the remaining 24 bits in that order. * @CAIRO_FORMAT_A8: each pixel is a 8-bit quantity holding *   an alpha value. * @CAIRO_FORMAT_A1: each pixel is a 1-bit quantity holding *   an alpha value. Pixels are packed together into 32-bit *   quantities. The ordering of the bits matches the *   endianess of the platform. On a big-endian machine, the *   first pixel is in the uppermost bit, on a little-endian *   machine the first pixel is in the least-significant bit. * @CAIRO_FORMAT_RGB16_565: each pixel is a 16-bit quantity, *   with red in the upper 5 bits, then green in the next 6, *   then blue in the lowest 5 bits. (Since 1.2) * * #cairo_format_t is used to identify the memory format of * image data. */typedef enum _cairo_format {    CAIRO_FORMAT_ARGB32,    CAIRO_FORMAT_RGB24,    CAIRO_FORMAT_A8,    CAIRO_FORMAT_A1,    CAIRO_FORMAT_RGB16_565} cairo_format_t;cairo_public cairo_surface_t *cairo_image_surface_create (cairo_format_t	format,			    int			width,			    int			height);cairo_public cairo_surface_t *cairo_image_surface_create_for_data (unsigned char	       *data,				     cairo_format_t		format,				     int			width,				     int			height,				     int			stride);cairo_public unsigned char *cairo_image_surface_get_data (cairo_surface_t *surface);cairo_public cairo_format_tcairo_image_surface_get_format (cairo_surface_t *surface);cairo_public intcairo_image_surface_get_width (cairo_surface_t *surface);cairo_public intcairo_image_surface_get_height (cairo_surface_t *surface);cairo_public intcairo_image_surface_get_stride (cairo_surface_t *surface);#if CAIRO_HAS_PNG_FUNCTIONScairo_public cairo_surface_t *cairo_image_surface_create_from_png (const char	*filename);cairo_public cairo_surface_t *cairo_image_surface_create_from_png_stream (cairo_read_func_t	read_func,					    void		*closure);#endif/* Pattern creation functions */cairo_public cairo_pattern_t *cairo_pattern_create_rgb (double red, double green, double blue);cairo_public cairo_pattern_t *cairo_pattern_create_rgba (double red, double green, double blue,			   double alpha);cairo_public cairo_pattern_t *cairo_pattern_create_for_surface (cairo_surface_t *surface);cairo_public cairo_pattern_t *cairo_pattern_create_linear (double x0, double y0,			     double x1, double y1);cairo_public cairo_pattern_t *cairo_pattern_create_radial (double cx0, double cy0, double radius0,			     double cx1, double cy1, double radius1);cairo_public cairo_pattern_t *cairo_pattern_reference (cairo_pattern_t *pattern);cairo_public voidcairo_pattern_destroy (cairo_pattern_t *pattern);cairo_public cairo_status_tcairo_pattern_status (cairo_pattern_t *pattern);/** * cairo_pattern_type_t * @CAIRO_PATTERN_TYPE_SOLID: The pattern is a solid (uniform) * color. It may be opaque or translucent. * @CAIRO_PATTERN_TYPE_SURFACE: The pattern is a based on a surface (an image). * @CAIRO_PATTERN_TYPE_LINEAR: The pattern is a linear gradient. * @CAIRO_PATTERN_TYPE_RADIAL: The pattern is a radial gradient. * * #cairo_pattern_type_t is used to describe the type of a given pattern. * * The type of a pattern is determined by the function used to create * it. The cairo_pattern_create_rgb() and cairo_pattern_create_rgba() * functions create SOLID patterns. The remaining * cairo_pattern_create functions map to pattern types in obvious * ways. * * The pattern type can be queried with cairo_pattern_get_type() * * Most cairo_pattern functions can be called with a pattern of any * type, (though trying to change the extend or filter for a solid * pattern will have no effect). A notable exception is * cairo_pattern_add_color_stop_rgb() and * cairo_pattern_add_color_stop_rgba() which must only be called with * gradient patterns (either LINEAR or RADIAL). Otherwise the pattern * will be shutdown and put into an error state. * * Since: 1.2 */typedef enum _cairo_pattern_type {    CAIRO_PATTERN_TYPE_SOLID,    CAIRO_PATTERN_TYPE_SURFACE,    CAIRO_PATTERN_TYPE_LINEAR,    CAIRO_PATTERN_TYPE_RADIAL} cairo_pattern_type_t;cairo_public cairo_pattern_type_tcairo_pattern_get_type (cairo_pattern_t *pattern);cairo_public voidcairo_pattern_add_color_stop_rgb (cairo_pattern_t *pattern,				  double offset,				  double red, double green, double blue);cairo_public voidcairo_pattern_add_color_stop_rgba (cairo_pattern_t *pattern,				   double offset,				   double red, double green, double blue,				   double alpha);cairo_public voidcairo_pattern_set_matrix (cairo_pattern_t      *pattern,			  const cairo_matrix_t *matrix);cairo_public voidcairo_pattern_get_matrix (cairo_pattern_t *pattern,			  cairo_matrix_t  *matrix);/** * cairo_extend_t * @CAIRO_EXTEND_NONE: pixels outside of the source pattern *   are fully transparent * @CAIRO_EXTEND_REPEAT: the pattern is tiled by repeating * @CAIRO_EXTEND_REFLECT: the pattern is tiled by reflecting *   at the edges (not implemented for surface patterns currently) * @CAIRO_EXTEND_PAD: pixels outside of the pattern copy *   the closest pixel from the source (Since 1.2; not implemented *   for surface patterns currently) * * #cairo_extend_t is used to describe how the area outside * of a pattern will be drawn. */typedef enum _cairo_extend {    CAIRO_EXTEND_NONE,    CAIRO_EXTEND_REPEAT,    CAIRO_EXTEND_REFLECT,    CAIRO_EXTEND_PAD} cairo_extend_t;cairo_public voidcairo_pattern_set_extend (cairo_pattern_t *pattern, cairo_extend_t extend);cairo_public cairo_extend_tcairo_pattern_get_extend (cairo_pattern_t *pattern);typedef enum _cairo_filter {    CAIRO_FILTER_FAST,    CAIRO_FILTER_GOOD,    CAIRO_FILTER_BEST,    CAIRO_FILTER_NEAREST,    CAIRO_FILTER_BILINEAR,    CAIRO_FILTER_GAUSSIAN} cairo_filter_t;cairo_public voidcairo_pattern_set_filter (cairo_pattern_t *pattern, cairo_filter_t filter);cairo_public cairo_filter_tcairo_pattern_get_filter (cairo_pattern_t *pattern);/* Matrix functions */cairo_public voidcairo_matrix_init (cairo_matrix_t *matrix,		   double  xx, double  yx,		   double  xy, double  yy,		   double  x0, double  y0);cairo_public voidcairo_matrix_init_identity (cairo_matrix_t *matrix);cairo_public voidcairo_matrix_init_translate (cairo_matrix_t *matrix,			     double tx, double ty);cairo_public voidcairo_matrix_init_scale (cairo_matrix_t *matrix,			 double sx, double sy);cairo_public voidcairo_matrix_init_rotate (cairo_matrix_t *matrix,			  double radians);cairo_public voidcairo_matrix_translate (cairo_matrix_t *matrix, double tx, double ty);cairo_public voidcairo_matrix_scale (cairo_matrix_t *matrix, double sx, double sy);cairo_public voidcairo_matrix_rotate (cairo_matrix_t *matrix, double radians);cairo_public cairo_status_tcairo_matrix_invert (cairo_matrix_t *matrix);cairo_public voidcairo_matrix_multiply (cairo_matrix_t	    *result,		       const cairo_matrix_t *a,		       const cairo_matrix_t *b);cairo_public voidcairo_matrix_transform_distance (const cairo_matrix_t *matrix,				 double *dx, double *dy);cairo_public voidcairo_matrix_transform_point (const cairo_matrix_t *matrix,			      double *x, double *y);/* Functions to be used while debugging (not intended for use in production code) */cairo_public voidcairo_debug_reset_static_data (void);#ifndef _CAIROINT_H_/* Obsolete functions. These definitions exist to coerce the compiler * into providing a little bit of guidance with its error * messages. The idea is to help users port their old code without * having to dig through lots of documentation. * * The first set of REPLACED_BY functions is for functions whose names * have just been changed. So fixing these up is mechanical, (and * automated by means of the cairo/util/cairo-api-update script. * * The second set of DEPRECATED_BY functions is for functions where * the replacement is used in a different way, (ie. different * arguments, multiple functions instead of one, etc). Fixing these up * will require a bit more work on the user's part, (and hopefully we * can get cairo-api-update to find these and print some guiding * information). */#define cairo_current_font_extents   cairo_current_font_extents_REPLACED_BY_cairo_font_extents#define cairo_get_font_extents       cairo_get_font_extents_REPLACED_BY_cairo_font_extents#define cairo_current_operator       cairo_current_operator_REPLACED_BY_cairo_get_operator#define cairo_current_tolerance	     cairo_current_tolerance_REPLACED_BY_cairo_get_tolerance#define cairo_current_point	     cairo_current_point_REPLACED_BY_cairo_get_current_point#define cairo_current_fill_rule	     cairo_current_fill_rule_REPLACED_BY_cairo_get_fill_rule#define cairo_current_line_width     cairo_current_line_width_REPLACED_BY_cairo_get_line_width#define cairo_current_line_cap       cairo_current_line_cap_REPLACED_BY_cairo_get_line_cap#define cairo_current_line_join      cairo_current_line_join_REPLACED_BY_cairo_get_line_join#define cairo_current_miter_limit    cairo_current_miter_limit_REPLACED_BY_cairo_get_miter_limit#define cairo_current_matrix         cairo_current_matrix_REPLACED_BY_cairo_get_matrix#define cairo_current_target_surface cairo_current_target_surface_REPLACED_BY_cairo_get_target#define cairo_get_status             cairo_get_status_REPLACED_BY_cairo_status#define cairo_concat_matrix		 cairo_concat_matrix_REPLACED_BY_cairo_transform#define cairo_scale_font                 cairo_scale_font_REPLACED_BY_cairo_set_font_size#define cairo_select_font                cairo_select_font_REPLACED_BY_cairo_select_font_face#define cairo_transform_font             cairo_transform_font_REPLACED_BY_cairo_set_font_matrix#define cairo_transform_point		 cairo_transform_point_REPLACED_BY_cairo_user_to_device#define cairo_transform_distance	 cairo_transform_distance_REPLACED_BY_cairo_user_to_device_distance#define cairo_inverse_transform_point	 cairo_inverse_transform_point_REPLACED_BY_cairo_device_to_user#define cairo_inverse_transform_distance cairo_inverse_transform_distance_REPLACED_BY_cairo_device_to_user_distance#define cairo_init_clip			 cairo_init_clip_REPLACED_BY_cairo_reset_clip#define cairo_surface_create_for_image	 cairo_surface_create_for_image_REPLACED_BY_cairo_image_surface_create_for_data#define cairo_default_matrix		 cairo_default_matrix_REPLACED_BY_cairo_identity_matrix#define cairo_matrix_set_affine		 cairo_matrix_set_affine_REPLACED_BY_cairo_matrix_init#define cairo_matrix_set_identity	 cairo_matrix_set_identity_REPLACED_BY_cairo_matrix_init_identity#define cairo_pattern_add_color_stop	 cairo_pattern_add_color_stop_REPLACED_BY_cairo_pattern_add_color_stop_rgba#define cairo_set_rgb_color		 cairo_set_rgb_color_REPLACED_BY_cairo_set_source_rgb#define cairo_set_pattern		 cairo_set_pattern_REPLACED_BY_cairo_set_source#define cairo_xlib_surface_create_for_pixmap_with_visual	cairo_xlib_surface_create_for_pixmap_with_visual_REPLACED_BY_cairo_xlib_surface_create#define cairo_xlib_surface_create_for_window_with_visual	cairo_xlib_surface_create_for_window_with_visual_REPLACED_BY_cairo_xlib_surface_create#define cairo_xcb_surface_create_for_pixmap_with_visual	cairo_xcb_surface_create_for_pixmap_with_visual_REPLACED_BY_cairo_xcb_surface_create#define cairo_xcb_surface_create_for_window_with_visual	cairo_xcb_surface_create_for_window_with_visual_REPLACED_BY_cairo_xcb_surface_create#define cairo_ps_surface_set_dpi	cairo_ps_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution#define cairo_pdf_surface_set_dpi	cairo_pdf_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution#define cairo_svg_surface_set_dpi	cairo_svg_surface_set_dpi_REPLACED_BY_cairo_surface_set_fallback_resolution#define cairo_current_path	     cairo_current_path_DEPRECATED_BY_cairo_copy_path#define cairo_current_path_flat	     cairo_current_path_flat_DEPRECATED_BY_cairo_copy_path_flat#define cairo_get_path		     cairo_get_path_DEPRECATED_BY_cairo_copy_path#define cairo_get_path_flat	     cairo_get_path_flat_DEPRECATED_BY_cairo_get_path_flat#define cairo_set_alpha		     cairo_set_alpha_DEPRECATED_BY_cairo_set_source_rgba_OR_cairo_paint_with_alpha#define cairo_show_surface	     cairo_show_surface_DEPRECATED_BY_cairo_set_source_surface_AND_cairo_paint#define cairo_copy		     cairo_copy_DEPRECATED_BY_cairo_create_AND_MANY_INDIVIDUAL_FUNCTIONS#define cairo_surface_set_repeat	cairo_surface_set_repeat_DEPRECATED_BY_cairo_pattern_set_extend#define cairo_surface_set_matrix	cairo_surface_set_matrix_DEPRECATED_BY_cairo_pattern_set_matrix#define cairo_surface_get_matrix	cairo_surface_get_matrix_DEPRECATED_BY_cairo_pattern_get_matrix#define cairo_surface_set_filter	cairo_surface_set_filter_DEPRECATED_BY_cairo_pattern_set_filter#define cairo_surface_get_filter	cairo_surface_get_filter_DEPRECATED_BY_cairo_pattern_get_filter#define cairo_matrix_create		cairo_matrix_create_DEPRECATED_BY_cairo_matrix_t#define cairo_matrix_destroy		cairo_matrix_destroy_DEPRECATED_BY_cairo_matrix_t#define cairo_matrix_copy		cairo_matrix_copy_DEPRECATED_BY_cairo_matrix_t#define cairo_matrix_get_affine		cairo_matrix_get_affine_DEPRECATED_BY_cairo_matrix_t#define cairo_set_target_surface	cairo_set_target_surface_DEPRECATED_BY_cairo_create#define cairo_set_target_glitz		cairo_set_target_glitz_DEPRECATED_BY_cairo_glitz_surface_create#define cairo_set_target_image		cairo_set_target_image_DEPRECATED_BY_cairo_image_surface_create_for_data#define cairo_set_target_pdf		cairo_set_target_pdf_DEPRECATED_BY_cairo_pdf_surface_create#define cairo_set_target_png		cairo_set_target_png_DEPRECATED_BY_cairo_surface_write_to_png#define cairo_set_target_ps		cairo_set_target_ps_DEPRECATED_BY_cairo_ps_surface_create#define cairo_set_target_quartz		cairo_set_target_quartz_DEPRECATED_BY_cairo_quartz_surface_create#define cairo_set_target_win32		cairo_set_target_win32_DEPRECATED_BY_cairo_win32_surface_create#define cairo_set_target_xcb		cairo_set_target_xcb_DEPRECATED_BY_cairo_xcb_surface_create#define cairo_set_target_drawable	cairo_set_target_drawable_DEPRECATED_BY_cairo_xlib_surface_create#define cairo_get_status_string		cairo_get_status_string_DEPRECATED_BY_cairo_status_AND_cairo_status_to_string#define cairo_status_string		cairo_status_string_DEPRECATED_BY_cairo_status_AND_cairo_status_to_string#endifCAIRO_END_DECLS#endif /* CAIRO_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -