All Projects → sammycage → Plutovg

sammycage / Plutovg

Licence: mit
Tiny 2D vector graphics library in C

Programming Languages

c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to Plutovg

Wechart
Create all the [ch]arts by cax or three.js - Cax 和 three.js 创造一切图[表]
Stars: ✭ 152 (+7.8%)
Mutual labels:  graphics, 2d, svg, canvas
Svg.skia
An SVG rendering library.
Stars: ✭ 122 (-13.48%)
Mutual labels:  vector, graphics, 2d, svg
Picasso
Picasso is a high quality 2D vector graphic rendering library. It support path , matrix , gradient , pattern , image and truetype font.
Stars: ✭ 205 (+45.39%)
Mutual labels:  graphics, 2d, svg, canvas
Pts
A library for visualization and creative-coding
Stars: ✭ 4,628 (+3182.27%)
Mutual labels:  vector, graphics, svg, canvas
Cax
HTML5 Canvas 2D Rendering Engine - 小程序、小游戏以及 Web 通用 Canvas 渲染引擎
Stars: ✭ 1,864 (+1221.99%)
Mutual labels:  2d, svg, canvas
G2
📊 A highly interactive data-driven visualization grammar for statistical charts.
Stars: ✭ 11,020 (+7715.6%)
Mutual labels:  graphics, svg, canvas
Rough
Create graphics with a hand-drawn, sketchy, appearance
Stars: ✭ 16,472 (+11582.27%)
Mutual labels:  graphics, svg, canvas
Zrender
A lightweight graphic library providing 2d draw for Apache ECharts
Stars: ✭ 5,122 (+3532.62%)
Mutual labels:  2d, svg, canvas
Gcanvas
A lightweight cross-platform graphics rendering engine. (超轻量的跨平台图形引擎) https://alibaba.github.io/GCanvas
Stars: ✭ 1,705 (+1109.22%)
Mutual labels:  graphics, 2d, canvas
Bgrabitmap
📜 BGRABitmap graphics library made with Lazarus (Free Pascal).
Stars: ✭ 112 (-20.57%)
Mutual labels:  graphics, svg
Vue Graph
⚡️ Vue components based on the JUI chart available in Vue.js
Stars: ✭ 114 (-19.15%)
Mutual labels:  svg, canvas
Pixelfarm
From Vectors to (sub) Pixels, C# 2D Rendering Library
Stars: ✭ 120 (-14.89%)
Mutual labels:  svg, canvas
Echarts
Apache ECharts is a powerful, interactive charting and data visualization library for browser
Stars: ✭ 49,119 (+34736.17%)
Mutual labels:  svg, canvas
Anime
JavaScript animation engine
Stars: ✭ 41,064 (+29023.4%)
Mutual labels:  svg, canvas
Reimg
reimg - A javascript library for converting image formats
Stars: ✭ 106 (-24.82%)
Mutual labels:  svg, canvas
Xsound
Web Audio API Library for Synthesizer, Effects, Visualization, Multi-Track Recording, Audio Streaming, Visual Audio Sprite ...
Stars: ✭ 123 (-12.77%)
Mutual labels:  svg, canvas
Ml Logos
📷 ✨ SVG logos for various ML libraries
Stars: ✭ 99 (-29.79%)
Mutual labels:  vector, svg
Hilo3d
Hilo3d, a WebGL Rendering Engine.
Stars: ✭ 123 (-12.77%)
Mutual labels:  graphics, canvas
Zfont
💬 Text plugin for Zdog - works with any .ttf font!
Stars: ✭ 126 (-10.64%)
Mutual labels:  svg, canvas
Svgo
Go Language Library for SVG generation
Stars: ✭ 1,779 (+1161.7%)
Mutual labels:  graphics, svg

PlutoVG

PlutoVG is a standalone 2D vector graphics library in C.

Features

  • Path Filling, Stroking and Dashing
  • Soild, Gradient and Texture Paints
  • Clipping and Compositing
  • Transformations
  • Font and Text Rendering

Example

#include "plutovg.h"

int main(void)
{
    const int width = 150;
    const int height = 150;

    plutovg_surface_t* surface = plutovg_surface_create(width, height);
    plutovg_t* pluto = plutovg_create(surface);

    double center_x = width / 2;
    double center_y = height / 2;
    double radius = 70;
    double eye_radius = 10;
    double eye_offset_x = 25;
    double eye_offset_y = 20;
    double eye_x = center_x - eye_offset_x;
    double eye_y = center_y - eye_offset_y;

    const double pi = 3.14159265358979323846;

    plutovg_arc(pluto, center_x, center_y, radius, 0, 2 * pi, 0);
    plutovg_set_source_rgb(pluto, 1, 1, 0);
    plutovg_fill_preserve(pluto);
    plutovg_set_line_width(pluto, 5);
    plutovg_set_source_rgb(pluto, 0, 0, 0);
    plutovg_stroke(pluto);

    plutovg_arc(pluto, eye_x, eye_y, eye_radius, 0, 2 * pi, 0);
    plutovg_arc(pluto, center_x + eye_offset_x, eye_y, eye_radius, 0, 2 * pi, 0);
    plutovg_set_source_rgb(pluto, 0, 0, 0);
    plutovg_fill(pluto);

    plutovg_arc(pluto, center_x, center_y, 50, 0, pi, 0);
    plutovg_set_source_rgb(pluto, 0, 0, 0);
    plutovg_stroke(pluto);

    plutovg_surface_write_to_png(surface, "smiley.png");
    plutovg_surface_destroy(surface);
    plutovg_destroy(pluto);

    return 0;
}

output :

smiley.png

Build

Install cmake if not already installed

mkdir build
cd build
cmake ..
make

Projects using PlutoVG

Support

If you like what we do, you can buy us a coffee

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].