cairo graphics 0.4 (line work animation)

/* http://cairographics.org/threaded_animation_with_cairo/ */ /* Hack by Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include //the global pixmap that will serve as our buffer static GdkPixmap *pixmap = NULL; gboolean on_window_configure_event(GtkWidget * da, GdkEventConfigure * event, gpointer user_data){ static int oldw = 0; static int oldh = 0; //make …

cairo graphics 0.3

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { int i; cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); for (i=0;i<100;i++) { /* cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i);*/ cairo_rectangle(cr,50+i,100,10+i,10+i); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* cairo_surface_flush(); */ …

cairo graphics 0.2 (triangle)

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include int i=0; static gboolean draw(GtkWidget *widget, GdkEventExpose *event, gpointer data) { cairo_t *cr; cr = gdk_cairo_create(widget->window); cairo_set_source_rgb(cr, 0, 0, 0); cairo_set_line_width (cr, 0.5); for (i=0;i<200;i++) { cairo_move_to(cr,30+i,60); cairo_line_to(cr,30+i,60+i); /* cairo_line_to(cr,40,200); */ cairo_stroke(cr); /* cairo_surface_flush(); */ /* usleep(100000);*/ } cairo_destroy(cr); return …

cairo graphics 0.1 (line)

#include #include int i=0; static gboolean draw(GtkWidget *widget, GdkEventExpose *event, gpointer data) { cairo_t *cr; cr = gdk_cairo_create(widget->window); cairo_set_source_rgb(cr, 0, 0, 0); cairo_set_line_width (cr, 0.5); /*for (i=0;i<200;i++) { */ cairo_move_to(cr,30,60); /* cairo_line_to(cr,30+i,60+i);*/ cairo_line_to(cr,40,200); cairo_stroke(cr); /* cairo_surface_flush(); */ /* usleep(100000);*/ /*} */ cairo_destroy(cr); return FALSE; } int main (int argc, char *argv[]) { GtkWidget *window; gtk_init(&argc, …

auxiliary and vector.

Words auxiliary = assistant,help,helper,supporter. vector = a one dimensional array. source: http://www.thefreedictionary.com Application Vector graphics is the use of geometrical primitives such as points, lines, curves, and shapes or polygon(s), which are all based on mat hematical equations, to represent images in computer graphics.Vector graphics formats are complementary to raster graphics, which is the representation …

operating system auxiliary vector

GDB show’s Auxiliary Vector (gdb) info auxv 33 AT_SYSINFO_EHDR System-supplied DSO’s ELF header 0x7fff68bdf000 16 AT_HWCAP Machine-dependent CPU capability hints 0x78bfbff 6 AT_PAGESZ System page size 4096 17 AT_CLKTCK Frequency of times() 100 3 AT_PHDR Program headers for program 0x400040 4 AT_PHENT Size of program header entry 56 5 AT_PHNUM Number of program headers 8 …

rectangle with cairo

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); cairo_rectangle(cr,30,20,67,70); cairo_stroke(cr); cairo_destroy (cr); cairo_surface_write_to_png (surface, “hello.png”); cairo_surface_destroy (surface); return 0; }

line with cairo

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include int main () { cairo_surface_t *surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 800, 600); cairo_t *cr = cairo_create (surface); cairo_set_font_size (cr, 32.0); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width(cr,1.0); cairo_move_to (cr, 10.0, 50.0); cairo_line_to(cr,20,300); cairo_stroke(cr); cairo_destroy (cr); cairo_surface_write_to_png (surface, “hello.png”); cairo_surface_destroy (surface); return 0; }

Print With Delay 0.6 ( with option)

/* Jeffrin Jose Licensed GPL v3 Copyright August 2010 GPL –> http://www.gnu.org/copyleft/gpl.html */ #include #include #include #include int main(int argc,char *argv[]) { int count; int i=0,getptr; pid_t pid; size_t length; char array[20]=”Happy Friendship Day”; /* printf(“n Happy Friendship Day n”); */ pid=fork(); if (pid == 0) { setsid(); setenv(“PS1″,”$”,1); /* getptr=getenv(“PS1”); printf(“%s”,getptr); */ printf(“\n”); for(i=0;i<20;i++) …