Skip to content

图像生成和处理 - Cairo

维基介绍 官方网站

cairo (http://cairographics.org/) 是一个免费的矢量绘图软件库,它可以绘制多种输出格式。cairo 支持许多平台,包括 Linux、BSD、Microsoft® Windows® 和 OSX(BeOS 和 OS2 后端也正在开发)。Linux 绘图可以通过 X Window 系统、Quartz、图像缓冲格式或 OpenGL 上下文来实现。另外,cairo 还支持生成 PostScript 或 PDF 输出,从而产生高质量的打印结果。在理想情况下,cairo 的用户可以在打印机和屏幕上获得非常接近的输出效果。 目前,cairo 可以呈现以下输出格式: * X Window System(如果可能的话,会利用 Render 扩展) * OpenGL(使用 glitz 后端) * In-Memory Images(pixbuffs 等等) * PostScript(适用于打印) * PDF(Portable Document Format)文件 * SVG(Scalable Vector Graphics)格式 cairo用C实现。并有多种语言的绑定(Bindings)。目前可用的 cairo 绑定包括:

一些界面//图形库也为 cairo 提供了绑定,这使 cairo 开发更加简便了。2.8 之后的 Gtk+ 版本包含对 cairo 的完整支持,而且以后的 GTK 版本一直选用 cairo 作为基本绘图系统。另外,GNUstep 和 FLTK 等工具集已经开始支持用 cairo 来满足图形呈现需求。

安装

http://pecl.php.net/package/cairo

http://www.cairographics.org/cairo-php/‎

配置

定义常量

函数

Cairo::availableFonts() Cairo::availableSurfaces() Cairo::statusToString() Cairo::version() Cairo::versionString() cairo_append_path() cairo_arc() cairo_arc_negative() cairo_available_fonts() cairo_available_surfaces() cairo_clip() cairo_clip_extents() cairo_clip_preserve() cairo_clip_rectangle_list() cairo_close_path() cairo_copy_page() cairo_copy_path() cairo_copy_path_flat() cairo_create() cairo_curve_to() cairo_device_to_user() cairo_device_to_user_distance() cairo_fill() cairo_fill_extents() cairo_fill_preserve() cairo_font_extents() cairo_font_face_get_type() cairo_font_face_status() cairo_font_options_create() cairo_font_options_equal() cairo_font_options_get_antialias() cairo_font_options_get_hint_metrics() cairo_font_options_get_hint_style() cairo_font_options_get_subpixel_order() cairo_font_options_hash() cairo_font_options_merge() cairo_font_options_set_antialias() cairo_font_options_set_hint_metrics() cairo_font_options_set_hint_style() cairo_font_options_set_subpixel_order() cairo_font_options_status() cairo_format_stride_for_width() cairo_get_antialias() cairo_get_current_point() cairo_get_dash() cairo_get_dash_count() cairo_get_fill_rule() cairo_get_font_face() cairo_get_font_matrix() cairo_get_font_options() cairo_get_group_target() cairo_get_line_cap() cairo_get_line_join() cairo_get_line_width() cairo_get_matrix() cairo_get_miter_limit() cairo_get_operator() cairo_get_scaled_font() cairo_get_source() cairo_get_target() cairo_get_tolerance() cairo_glyph_path() cairo_has_current_point() cairo_identity_matrix() cairo_image_surface_create() cairo_image_surface_create_for_data() cairo_image_surface_create_from_png() cairo_image_surface_get_data() cairo_image_surface_get_format() cairo_image_surface_get_height() cairo_image_surface_get_stride() cairo_image_surface_get_width() cairo_in_fill() cairo_in_stroke() cairo_line_to() cairo_mask() cairo_mask_surface() cairo_matrix_create_scale() cairo_matrix_create_translate() cairo_matrix_init() cairo_matrix_init_identity() cairo_matrix_init_rotate() cairo_matrix_init_scale() cairo_matrix_init_translate() cairo_matrix_invert() cairo_matrix_multiply() cairo_matrix_rotate() cairo_matrix_scale() cairo_matrix_transform_distance() cairo_matrix_transform_point() cairo_matrix_translate() cairo_move_to() cairo_new_path() cairo_new_sub_path() cairo_paint() cairo_paint_with_alpha() cairo_path_extents() cairo_pattern_add_color_stop_rgb() cairo_pattern_add_color_stop_rgba() cairo_pattern_create_for_surface() cairo_pattern_create_linear() cairo_pattern_create_radial() cairo_pattern_create_rgb() cairo_pattern_create_rgba() cairo_pattern_get_color_stop_count() cairo_pattern_get_color_stop_rgba() cairo_pattern_get_extend() cairo_pattern_get_filter() cairo_pattern_get_linear_points() cairo_pattern_get_matrix() cairo_pattern_get_radial_circles() cairo_pattern_get_rgba() cairo_pattern_get_surface() cairo_pattern_get_type() cairo_pattern_set_extend() cairo_pattern_set_filter() cairo_pattern_set_matrix() cairo_pattern_status() cairo_pdf_surface_create() cairo_pdf_surface_set_size() cairo_pop_group() cairo_pop_group_to_source() cairo_ps_get_levels() cairo_ps_level_to_string() cairo_ps_surface_create() cairo_ps_surface_dsc_begin_page_setup() cairo_ps_surface_dsc_begin_setup() cairo_ps_surface_dsc_comment() cairo_ps_surface_get_eps() cairo_ps_surface_restrict_to_level() cairo_ps_surface_set_eps() cairo_ps_surface_set_size() cairo_push_group() cairo_push_group_with_content() cairo_rectangle() cairo_rel_curve_to() cairo_rel_line_to() cairo_rel_move_to() cairo_reset_clip() cairo_restore() cairo_rotate() cairo_save() cairo_scale() cairo_scaled_font_create() cairo_scaled_font_extents() cairo_scaled_font_get_ctm() cairo_scaled_font_get_font_face() cairo_scaled_font_get_font_matrix() cairo_scaled_font_get_font_options() cairo_scaled_font_get_scale_matrix() cairo_scaled_font_get_type() cairo_scaled_font_glyph_extents() cairo_scaled_font_status() cairo_scaled_font_text_extents() cairo_select_font_face() cairo_set_antialias() cairo_set_dash() cairo_set_fill_rule() cairo_set_font_face() cairo_set_font_matrix() cairo_set_font_options() cairo_set_font_size() cairo_set_line_cap() cairo_set_line_join() cairo_set_line_width() cairo_set_matrix() cairo_set_miter_limit() cairo_set_operator() cairo_set_scaled_font() cairo_set_source() cairo_set_source_surface() cairo_set_tolerance() cairo_show_page() cairo_show_text() cairo_status() cairo_status_to_string() cairo_stroke() cairo_stroke_extents() cairo_stroke_preserve() cairo_surface_copy_page() cairo_surface_create_similar() cairo_surface_finish() cairo_surface_flush() cairo_surface_get_content() cairo_surface_get_device_offset() cairo_surface_get_font_options() cairo_surface_get_type() cairo_surface_mark_dirty() cairo_surface_mark_dirty_rectangle() cairo_surface_set_device_offset() cairo_surface_set_fallback_resolution() cairo_surface_show_page() cairo_surface_status() cairo_surface_write_to_png() cairo_svg_surface_create() cairo_svg_surface_get_versions() cairo_svg_surface_restrict_to_version() cairo_svg_version_to_string() cairo_text_extents() cairo_text_path() cairo_transform() cairo_translate() cairo_user_to_device() cairo_user_to_device_distance() cairo_version() cairo_version_string() CairoContext::__construct() CairoContext::appendPath() CairoContext::arc() CairoContext::arcNegative() CairoContext::clip() CairoContext::clipExtents() CairoContext::clipPreserve() CairoContext::clipRectangleList() CairoContext::closePath() CairoContext::copyPage() CairoContext::copyPath() CairoContext::copyPathFlat() CairoContext::curveTo() CairoContext::deviceToUser() CairoContext::deviceToUserDistance() CairoContext::fill() CairoContext::fillExtents() CairoContext::fillPreserve() CairoContext::fontExtents() CairoContext::getAntialias() CairoContext::getCurrentPoint() CairoContext::getDash() CairoContext::getDashCount() CairoContext::getFillRule() CairoContext::getFontFace() CairoContext::getFontMatrix() CairoContext::getFontOptions() CairoContext::getGroupTarget() CairoContext::getLineCap() CairoContext::getLineJoin() CairoContext::getLineWidth() CairoContext::getMatrix() CairoContext::getMiterLimit() CairoContext::getOperator() CairoContext::getScaledFont() CairoContext::getSource() CairoContext::getTarget() CairoContext::getTolerance() CairoContext::glyphPath() CairoContext::hasCurrentPoint() CairoContext::identityMatrix() CairoContext::inFill() CairoContext::inStroke() CairoContext::lineTo() CairoContext::mask() CairoContext::maskSurface() CairoContext::moveTo() CairoContext::newPath() CairoContext::newSubPath() CairoContext::paint() CairoContext::paintWithAlpha() CairoContext::pathExtents() CairoContext::popGroup() CairoContext::popGroupToSource() CairoContext::pushGroup() CairoContext::pushGroupWithContent() CairoContext::rectangle() CairoContext::relCurveTo() CairoContext::relLineTo() CairoContext::relMoveTo() CairoContext::resetClip() CairoContext::restore() CairoContext::rotate() CairoContext::save() CairoContext::scale() CairoContext::selectFontFace() CairoContext::setAntialias() CairoContext::setDash() CairoContext::setFillRule() CairoContext::setFontFace() CairoContext::setFontMatrix() CairoContext::setFontOptions() CairoContext::setFontSize() CairoContext::setLineCap() CairoContext::setLineJoin() CairoContext::setLineWidth() CairoContext::setMatrix() CairoContext::setMiterLimit() CairoContext::setOperator() CairoContext::setScaledFont() CairoContext::setSource() CairoContext::setSourceRGB() CairoContext::setSourceRGBA() CairoContext::setSourceSurface() CairoContext::setTolerance() CairoContext::showPage() CairoContext::showText() CairoContext::status() CairoContext::stroke() CairoContext::strokeExtents() CairoContext::strokePreserve() CairoContext::textExtents() CairoContext::textPath() CairoContext::transform() CairoContext::translate() CairoContext::userToDevice() CairoContext::userToDeviceDistance() CairoFontFace::__construct() CairoFontFace::getType() CairoFontFace::status() CairoFontOptions::__construct() CairoFontOptions::equal() CairoFontOptions::getAntialias() CairoFontOptions::getHintMetrics() CairoFontOptions::getHintStyle() CairoFontOptions::getSubpixelOrder() CairoFontOptions::hash() CairoFontOptions::merge() CairoFontOptions::setAntialias() CairoFontOptions::setHintMetrics() CairoFontOptions::setHintStyle() CairoFontOptions::setSubpixelOrder() CairoFontOptions::status() CairoFormat::strideForWidth() CairoGradientPattern::addColorStopRgb() CairoGradientPattern::addColorStopRgba() CairoGradientPattern::getColorStopCount() CairoGradientPattern::getColorStopRgba() CairoGradientPattern::getExtend() CairoGradientPattern::setExtend() CairoImageSurface::__construct() CairoImageSurface::createForData() CairoImageSurface::createFromPng() CairoImageSurface::getData() CairoImageSurface::getFormat() CairoImageSurface::getHeight() CairoImageSurface::getStride() CairoImageSurface::getWidth() CairoLinearGradient::__construct() CairoLinearGradient::getPoints() CairoMatrix::__construct() CairoMatrix::initIdentity() CairoMatrix::initRotate() CairoMatrix::initScale() CairoMatrix::initTranslate() CairoMatrix::invert() CairoMatrix::multiply() CairoMatrix::rotate() CairoMatrix::scale() CairoMatrix::transformDistance() CairoMatrix::transformPoint() CairoMatrix::translate() CairoPattern::__construct() CairoPattern::getMatrix() CairoPattern::getType() CairoPattern::setMatrix() CairoPattern::status() CairoPdfSurface::__construct() CairoPdfSurface::setSize() CairoPsSurface::__construct() CairoPsSurface::dscBeginPageSetup() CairoPsSurface::dscBeginSetup() CairoPsSurface::dscComment() CairoPsSurface::getEps() CairoPsSurface::getLevels() CairoPsSurface::levelToString() CairoPsSurface::restrictToLevel() CairoPsSurface::setEps() CairoPsSurface::setSize() CairoRadialGradient::__construct() CairoRadialGradient::getCircles() CairoScaledFont::__construct() CairoScaledFont::extents() CairoScaledFont::getCtm() CairoScaledFont::getFontFace() CairoScaledFont::getFontMatrix() CairoScaledFont::getFontOptions() CairoScaledFont::getScaleMatrix() CairoScaledFont::getType() CairoScaledFont::glyphExtents() CairoScaledFont::status() CairoScaledFont::textExtents() CairoSolidPattern::__construct() CairoSolidPattern::getRgba() CairoSurface::__construct() CairoSurface::copyPage() CairoSurface::createSimilar() CairoSurface::finish() CairoSurface::flush() CairoSurface::getContent() CairoSurface::getDeviceOffset() CairoSurface::getFontOptions() CairoSurface::getType() CairoSurface::markDirty() CairoSurface::markDirtyRectangle() CairoSurface::setDeviceOffset() CairoSurface::setFallbackResolution() CairoSurface::showPage() CairoSurface::status() CairoSurface::writeToPng() CairoSurfacePattern::__construct() CairoSurfacePattern::getExtend() CairoSurfacePattern::getFilter() CairoSurfacePattern::getSurface() CairoSurfacePattern::setExtend() CairoSurfacePattern::setFilter() CairoSvgSurface::__construct() CairoSvgSurface::getVersions() CairoSvgSurface::restrictToVersion() CairoSvgSurface::versionToString()


说明

创建时间: 2023-01-15 09:27:00 , 最后编辑于 2023-11-24 15:06:00