Giter Site home page Giter Site logo

ajstarks / openvg Goto Github PK

View Code? Open in Web Editor NEW
407.0 32.0 85.0 6.17 MB

Tools for exploring OpenVG

License: Other

Makefile 0.38% C 7.42% Go 10.84% C++ 56.55% Shell 0.02% Assembly 24.79%
graphics graphics-programming openvg drawing font raspberry-pi raspberry-pi-library

openvg's Introduction

Testbed for exploring OpenVG on the Raspberry Pi.

rotext

First program

Here is the graphics equivalent of "hello, world"

// first OpenVG program
// Anthony Starks ([email protected])
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "VG/openvg.h"
#include "VG/vgu.h"
#include "fontinfo.h"
#include "shapes.h"

int main() {
	int width, height;
	char s[3];

	init(&width, &height);					// Graphics initialization

	Start(width, height);					// Start the picture
	Background(0, 0, 0);					// Black background
	Fill(44, 77, 232, 1);					// Big blue marble
	Circle(width / 2, 0, width);			// The "world"
	Fill(255, 255, 255, 1);					// White text
	TextMid(width / 2, height / 2, "hello, world", SerifTypeface, width / 10);	// Greetings 
	End();						   			// End the picture

	fgets(s, 2, stdin);				   		// look at the pic, end with [RETURN]
	finish();					            // Graphics cleanup
	exit(0);
}

hellovg

API

OpenVG refcard

Coordinates are VGfloat values, with the origin at the lower left, with x increasing to the right, and y increasing up. OpenVG specifies colors as a VGfloat array containing red, green, blue, alpha values ranging from 0.0 to 1.0, but typically colors are specified as RGBA (0-255 for RGB, A from 0.0 to 1.0)

Window (canvas) functions

void WindowClear() 

WindowClear clears the window to previously set background colour

void AreaClear(unsigned int x, unsigned int y, unsigned int w, unsigned int h)

AreaClear clears a given rectangle in window coordinates

void WindowOpacity(unsigned int a)

WindowOpacity sets the window opacity

void WindowPosition(int x, int y)

WindowPosition moves the window to given position

Setup and shutdown

void init(int *w, int *h)

Initialize the graphics: width and height of the canvas are returned. This should begin every program.

void initWindowSize(int x, int y, unsigned int w, unsigned int h)

Initialize with specific dimensions

void finish() 

Shutdown the graphics. This should end every program.

void Start(int width, int height)

Begin the picture, clear the screen with a default white, set the stroke and fill to black.

void End()

End the picture, rendering to the screen.

void SaveEnd(char *filename)

End the picture, rendering to the screen, save the raster to the named file as 4-byte RGBA words, with a stride of width*4 bytes. The program raw2png converts the "raw" raster to png.

void saveterm(), restoreterm(), rawterm()

Terminal settings, save current settings, restore settings, put the terminal in raw mode.

Attributes

void setfill(float color[4])

Set the fill color

void Background(unsigned int r, unsigned int g, unsigned int b)

Fill the screen with the background color defined from RGB values.

void BackgroundRGB(unsigned int r, unsigned int g, unsigned int b, VGfloat a)

clears the screen to a background color with alpha

void StrokeWidth(float width)

Set the stroke width.

void RGBA(unsigned int r, unsigned int g, unsigned int b, VGfloat a, VGfloat color[4])

fill a color vector from RGBA values.

void RGB(unsigned int r, unsigned int g, unsigned int b, VGfloat color[4])

fill a color vector from RGB values.

void Stroke(unsigned int r, unsigned int g, unsigned int b, VGfloat a)

Set the Stroke color using RGBA values.

void Fill(unsigned int r, unsigned int g, unsigned int b, VGfloat a)

Set the Fill color using RGBA values.

void FillLinearGradient(VGfloat x1, VGfloat y1, VGfloat x2, VGfloat y2, VGfloat *stops, int n)

Set the fill to a linear gradient bounded by (x1, y1) and (x2, y2). using offsets and colors specified in n number of stops

void FillRadialGradient(VGfloat cx, VGfloat cy, VGfloat fx VGfloat fy, VGfloat r, VGfloat *stops, int n)

Set the fill to a radial gradient centered at (cx, cy) with radius r, and focal point at (fx, ry), using offsets and colors specified in n number of stops

Shapes

void Line(VGfloat x1, VGfloat y1, VGfloat x2, VGfloat y2)

Draw a line between (x1, y1) and (x2, y2).

void Rect(VGfloat x, VGfloat y, VGfloat w, VGfloat h)

Draw a rectangle with its origin (lower left) at (x,y), and size is (width,height).

void RectOutline(VGfloat x, VGfloat y, VGfloat w, VGfloat h)

Outlined version

void Roundrect(VGfloat x, VGfloat y, VGfloat w, VGfloat h, VGfloat rw, VGfloat rh)

Draw a rounded rectangle with its origin (lower left) at (x,y), and size is (width,height).
The width and height of the corners are specified with (rw,rh).

void RoundrectOutline(VGfloat x, VGfloat y, VGfloat w, VGfloat h, VGfloat rw, VGfloat rh)

Outlined version

void Polygon(VGfloat *x, VGfloat *y, VGint n)

Draw a polygon using the coordinates in arrays pointed to by x and y. The number of coordinates is n.

void Polyline(VGfloat *x, VGfloat *y, VGint n)

Draw a polyline using the coordinates in arrays pointed to by x and y. The number of coordinates is n.

void Circle(VGfloat x, VGfloat y, VGfloat d)

Draw a circle centered at (x,y) with diameter d.

void CircleOutline(VGfloat x, VGfloat y, VGfloat r)

Outlined version

void Ellipse(VGfloat x, VGfloat y, VGfloat w, VGfloat h)

Draw an ellipse centered at (x,y) with radii (w, h).

void EllipseOutline(VGfloat x, VGfloat y, VGfloat w, VGfloat h)

Outlined version

void Qbezier(VGfloat sx, VGfloat sy, VGfloat cx, VGfloat cy, VGfloat ex, VGfloat ey)

Draw a quadratic bezier curve beginning at (sx, sy), using control points at (cx, cy), ending at (ex, ey).

void QbezierOutline(VGfloat sx, VGfloat sy, VGfloat cx, VGfloat cy, VGfloat ex, VGfloat ey)

Outlined version

void Cbezier(VGfloat sx, VGfloat sy, VGfloat cx, VGfloat cy, VGfloat px, VGfloat py, VGfloat ex, VGfloat ey)

Draw a cubic bezier curve beginning at (sx, sy), using control points at (cx, cy) and (px, py), ending at (ex, ey).

void CbezierOutline(VGfloat sx, VGfloat sy, VGfloat cx, VGfloat cy, VGfloat px, VGfloat py, VGfloat ex, VGfloat ey) 

Outlined version

void Arc(VGfloat x, VGfloat y, VGfloat w, VGfloat h, VGfloat sa, VGfloat aext)

Draw an elliptical arc centered at (x, y), with width and height at (w, h). Start angle (degrees) is sa, angle extent is aext.

void ArcOutline(VGfloat x, VGfloat y, VGfloat w, VGfloat h, VGfloat sa, VGfloat aext)

Outlined version

Text and Images

void Text(VGfloat x, VGfloat y, char* s, Fontinfo f, int pointsize)

Draw a the text srtring (s) at location (x,y), using pointsize.

void TextMid(VGfloat x, VGfloat y, char* s, Fontinfo f, int pointsize)

Draw a the text srtring (s) at centered at location (x,y), using pointsize.

void TextEnd(VGfloat x, VGfloat y, char* s, Fontinfo f, int pointsize)

Draw a the text srtring (s) at with its lend aligned to location (x,y), using pointsize

VGfloat TextWidth(char *s, Fontinfo f, int pointsize)

Return the width of text

VGfloat TextHeight(Fontinfo f, int pointsize)

Return a font's height

TextDepth(Fontinfo f, int pointsize)

Return a font's distance beyond the baseline.

void Image(VGfloat x, VGfloat y, int w, int h, char * filename)

place a JPEG image with dimensions (w,h) at (x,y).

Transformations

void Translate(VGfloat x, VGfloat y)

Translate the coordinate system to (x,y).

void Rotate(VGfloat r)

Rotate the coordinate system around angle r (degrees).

void Scale(VGfloat x, VGfloat y)

Scale by x,y.

void Shear(VGfloat x, VGfloat y)

Shear by the angles x,y.

Clipping

void ClipRect(VGint x, VGint y, VGint w, VGint h)

Limit drawing the drawing area to the specified rectangle, end with ClipEnd()

void ClipEnd()

Ends clipping area

Using fonts

Also included is the font2openvg program, which turns font information into C source that you can embed in your program. The Makefile makes font code from files found in /usr/share/fonts/truetype/ttf-dejavu/. If you want to use other fonts, adjust the Makefile accordingly, or generate the font code on your own once the font2openvg program is built.

font2openvg takes three arguments: the TrueType font file, the output file to be included and the prefix for identifiers. For example to use the DejaVu Sans font:

./font2openvg /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf DejaVuSans.inc DejaVuSans

and include the generated code in your program:

#include "DejaVuSans.inc"
Fontinfo DejaFont

The loadfont function creates OpenVG paths from the font data:

loadfont(DejaVuSans_glyphPoints, 
        DejaVuSans_glyphPointIndices, 
    	DejaVuSans_glyphInstructions,                
    	DejaVuSans_glyphInstructionIndices, 
        DejaVuSans_glyphInstructionCounts, 
        DejaVuSans_glyphAdvances,
        DejaVuSans_characterMap, 
    	DejaVuSans_glyphCount);

The unloadfont function releases the path information:

unloadfont(DejaFont.Glyphs, DejaFont.Count);

Note that the location of the font files may differ. (The current location for Jessie is /usr/share/fonts/truetype/ttf-dejavu) Use the FONTLIB makefile variable to adjust this location.

Build and run

Note that you will need at least 64 Mbytes of GPU RAM:. You will also need the DejaVu fonts, and the jpeg and freetype libraries. The indent tool is also useful for code formatting. Install them via:

pi@raspberrypi ~ $ sudo apt-get install libjpeg8-dev indent libfreetype6-dev ttf-dejavu-core

Next, build the library and test:

pi@raspberrypi ~ $ git clone git://github.com/ajstarks/openvg
pi@raspberrypi ~ $ cd openvg
pi@raspberrypi ~/openvg $ make
g++ -I/usr/include/freetype2 fontutil/font2openvg.cpp -o font2openvg -lfreetype
./font2openvg /usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf DejaVuSans.inc DejaVuSans
224 glyphs written
./font2openvg /usr/share/fonts/truetype/ttf-dejavu/DejaVuSansMono.ttf DejaVuSansMono.inc DejaVuSansMono
224 glyphs written
./font2openvg /usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf DejaVuSerif.inc DejaVuSerif
224 glyphs written
gcc -O2 -Wall -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -c libshapes.c
gcc -O2 -Wall -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -c oglinit.c
pi@raspberrypi ~/openvg/client $ cd client
pi@raspberrypi ~/openvg/client $ make test
cc -Wall -I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -o shapedemo shapedemo.c ../libshapes.o ../oglinit.o -L/opt/vc/lib -lGLESv2 -ljpeg
./shapedemo demo 5

The program "shapedemo" exercises a high-level API built on OpenVG found in libshapes.c.

./shapedemo                      # show a reference card
./shapedemo raspi                # show a self-portrait
./shapedemo image                # show four test images
./shapedemo astro                # the sun and the earth, to scale
./shapedemo text                 # show blocks of text in serif, sans, and mono fonts
./shapedemo rand 10              # show 10 random shapes
./shapedemo rotate 10 a          # rotated and faded "a"
./shapedemo test "hello, world"  # show a test pattern, with "hello, world" at mid-display in sans, serif, and mono.
./shapedemo fontsize             # show a range of font sizes (per <https://speakerdeck.com/u/idangazit/p/better-products-through-typography>)
./shapedemo demo 10              # run through the demo, pausing 10 seconds between each one; contemplate the awesome.

To install the shapes library as a system-wide shared library

pi@raspberrypi ~/openvg $ make library
pi@raspberrypi ~/openvg $ sudo make install

The openvg shapes library can now be used in C code by including shapes.h and fontinfo.h and linking with libshapes.so:

#include <shapes.h>
#include <fontinfo.h>

pi@raspberrypi ~ $ gcc -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads anysource.c -o anysource -lshapes
pi@raspberrypi ~ $ ./anysource

The Raspberry Pi, drawn by the Raspberry Pi

Go wrapper

A Go programming language wrapper for the library is found in openvg.go. Sample clients are in the directory go-client. The API closely follows the C API; here is the "hello, world" program in Go:

The Go API

package main

import (
	"bufio"
	"github.com/ajstarks/openvg"
	"os"
)

func main() {
	width, height := openvg.Init() // OpenGL, etc initialization

	w2 := openvg.VGfloat(width / 2)
	h2 := openvg.VGfloat(height / 2)
	w := openvg.VGfloat(width)

	openvg.Start(width, height)                               // Start the picture
	openvg.BackgroundColor("black")                           // Black background
	openvg.FillRGB(44, 77, 232, 1)                            // Big blue marble
	openvg.Circle(w2, 0, w)                                   // The "world"
	openvg.FillColor("white")                                 // White text
	openvg.TextMid(w2, h2, "hello, world", "serif", width/10) // Greetings 
	openvg.End()                                              // End the picture
	bufio.NewReader(os.Stdin).ReadBytes('\n')                 // Pause until [RETURN]
	openvg.Finish()                                           // Graphics cleanup
}

To build the wrapper: (make sure GOPATH is set)

pi@raspberrypi ~/openvg $ go install .
pi@raspberrypi ~/openvg $ cd go-client/hellovg
pi@raspberrypi ~/openvg/go-client/hellovg $ go build .
pi@raspberrypi ~/openvg/go-client/hellovg $ ./hellovg 

openvg's People

Contributors

ajstarks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

openvg's Issues

* Failed to add service - already in use? When openGL driver is enabled.

I am sorry to submit this here as I don't believe this has anything to do with your code but I am frustrated searching for an answer. I believe I need either the FULL KMS or the FAKE KMS driver enabled to take advantage of hardware acceleration and when I enable either of them and try to run I get this error message. Have you seen this, or do you have any idea how to make this work? My digital dash is starting to slow down significantly as I add complexity.

Strace:
execve("./digitalDash", ["./digitalDash"], [/* 42 vars */]) = 0 brk(0) = 0x1aa1000 uname({sys="Linux", node="DigitalDash", ...}) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) mmap2(NULL, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff8000 access("/etc/ld.so.preload", R_OK) = 0 open("/etc/ld.so.preload", O_RDONLY|O_CLOEXEC) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=42, ...}) = 0 mmap2(NULL, 42, PROT_READ|PROT_WRITE, MAP_PRIVATE, 3, 0) = 0x76ff7000 close(3) = 0 open("/usr/lib/arm-linux-gnueabihf/libarmmem.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0h\5\0\0004\0\0\0"..., 512) = 512 lseek(3, 17960, SEEK_SET) = 17960 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 960) = 960 lseek(3, 17696, SEEK_SET) = 17696 read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\3\f\1\22\4\24"..., 47) = 47 fstat64(3, {st_mode=S_IFREG|0644, st_size=18920, ...}) = 0 mmap2(NULL, 83236, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76fb6000 mprotect(0x76fbb000, 61440, PROT_NONE) = 0 mmap2(0x76fca000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x4000) = 0x76fca000 mprotect(0x7ed20000, 4096, PROT_READ|PROT_WRITE|PROT_EXEC|PROT_GROWSDOWN) = 0 close(3) = 0 munmap(0x76ff7000, 42) = 0 open("/etc/ld.so.cache", O_RDONLY|O_CLOEXEC) = 3 fstat64(3, {st_mode=S_IFREG|0644, st_size=92304, ...}) = 0 mmap2(NULL, 92304, PROT_READ, MAP_PRIVATE, 3, 0) = 0x76f9f000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/usr/lib/libshapes.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\210\37\0\0004\0\0\0"..., 512) = 512 lseek(3, 472068, SEEK_SET) = 472068 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1000) = 1000 lseek(3, 471803, SEEK_SET) = 471803 read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47 fstat64(3, {st_mode=S_IFREG|0755, st_size=473068, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff7000 mmap2(NULL, 543560, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76f1a000 mprotect(0x76f8d000, 65536, PROT_NONE) = 0 mmap2(0x76f9d000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x73000) = 0x76f9d000 mmap2(0x76f9e000, 2888, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f9e000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/usr/lib/libwiringPi.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0000+\0\0004\0\0\0"..., 512) = 512 lseek(3, 69208, SEEK_SET) = 69208 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080 lseek(3, 51763, SEEK_SET) = 51763 read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47 fstat64(3, {st_mode=S_IFREG|0755, st_size=70288, ...}) = 0 mmap2(NULL, 121248, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76efc000 mprotect(0x76f08000, 65536, PROT_NONE) = 0 mmap2(0x76f18000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc000) = 0x76f18000 mmap2(0x76f19000, 2464, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76f19000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/opt/vc/lib/libOpenVG.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\30&\0\0004\0\0\0"..., 512) = 512 lseek(3, 97960, SEEK_SET) = 97960 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1240) = 1240 lseek(3, 83386, SEEK_SET) = 83386 read(3, "A;\0\0\0aeabi\0\0011\0\0\0\5ARM1176JZF-S\0\6\7"..., 60) = 60 fstat64(3, {st_mode=S_IFREG|0644, st_size=99200, ...}) = 0 mmap2(NULL, 148868, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76ed7000 mprotect(0x76eec000, 61440, PROT_NONE) = 0 mmap2(0x76efb000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x76efb000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/usr/lib/arm-linux-gnueabihf/libstdc++.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0xk\4\0004\0\0\0"..., 512) = 512 lseek(3, 808332, SEEK_SET) = 808332 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1280) = 1280 lseek(3, 807760, SEEK_SET) = 807760 read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47 fstat64(3, {st_mode=S_IFREG|0644, st_size=809612, ...}) = 0 mmap2(NULL, 900808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76dfb000 mprotect(0x76ebc000, 61440, PROT_NONE) = 0 mmap2(0x76ecb000, 24576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0xc0000) = 0x76ecb000 mmap2(0x76ed1000, 24264, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76ed1000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/arm-linux-gnueabihf/libm.so.6", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0p<\0\0004\0\0\0"..., 512) = 512 lseek(3, 434644, SEEK_SET) = 434644 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160 lseek(3, 434312, SEEK_SET) = 434312 read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49 fstat64(3, {st_mode=S_IFREG|0644, st_size=435804, ...}) = 0 mmap2(NULL, 499856, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d80000 mprotect(0x76de9000, 65536, PROT_NONE) = 0 mmap2(0x76df9000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x69000) = 0x76df9000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/arm-linux-gnueabihf/libgcc_s.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\321\0\0004\0\0\0"..., 512) = 512
lseek(3, 116400, SEEK_SET) = 116400
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1120) = 1120
lseek(3, 116072, SEEK_SET) = 116072
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0644, st_size=117520, ...}) = 0
mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff6000
mmap2(NULL, 181664, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d53000
mprotect(0x76d70000, 61440, PROT_NONE) = 0
mmap2(0x76d7f000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1c000) = 0x76d7f000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libpthread.so.0", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0lY\0\0004\0\0\0"..., 512) = 512
lseek(3, 120788, SEEK_SET) = 120788
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1520) = 1520
lseek(3, 86420, SEEK_SET) = 86420
read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49
fstat64(3, {st_mode=S_IFREG|0755, st_size=122308, ...}) = 0
mmap2(NULL, 160316, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76d2b000
mprotect(0x76d3f000, 65536, PROT_NONE) = 0
mmap2(0x76d4f000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x76d4f000
mmap2(0x76d51000, 4668, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76d51000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/lib/arm-linux-gnueabihf/libc.so.6", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0L\204\1\0004\0\0\0"..., 512) = 512
lseek(3, 1239936, SEEK_SET) = 1239936
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 2840) = 2840
lseek(3, 1236500, SEEK_SET) = 1236500
read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 47) = 47
fstat64(3, {st_mode=S_IFREG|0755, st_size=1242776, ...}) = 0
mmap2(NULL, 1312152, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76bea000
mprotect(0x76d15000, 65536, PROT_NONE) = 0
mmap2(0x76d25000, 12288, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x12b000) = 0x76d25000
mmap2(0x76d28000, 9624, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76d28000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/opt/vc/lib/libEGL.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\370i\0\0004\0\0\0"..., 512) = 512
lseek(3, 200832, SEEK_SET) = 200832
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1240) = 1240
lseek(3, 166098, SEEK_SET) = 166098
read(3, "A;\0\0\0aeabi\0\0011\0\0\0\5ARM1176JZF-S\0\6\7"..., 60) = 60
fstat64(3, {st_mode=S_IFREG|0644, st_size=202072, ...}) = 0
mmap2(NULL, 232596, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76bb1000
mprotect(0x76bd9000, 65536, PROT_NONE) = 0
mmap2(0x76be9000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x28000) = 0x76be9000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/opt/vc/lib/libGLESv2.so", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\2109\0\0004\0\0\0"..., 512) = 512
lseek(3, 104528, SEEK_SET) = 104528
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1240) = 1240
lseek(3, 82602, SEEK_SET) = 82602
read(3, "A9\0\0\0aeabi\0\1/\0\0\0\5ARM1176JZF-S\0\6\7"..., 58) = 58
fstat64(3, {st_mode=S_IFREG|0644, st_size=105768, ...}) = 0
mmap2(NULL, 148084, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76b8c000
mprotect(0x76ba0000, 65536, PROT_NONE) = 0
mmap2(0x76bb0000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x14000) = 0x76bb0000
close(3) = 0
access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory)
open("/usr/lib/arm-linux-gnueabihf/libjpeg.so.8", O_RDONLY|O_CLOEXEC) = 3
read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0.\0\0004\0\0\0"..., 512) = 512 lseek(3, 205756, SEEK_SET) = 205756 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080 lseek(3, 205432, SEEK_SET) = 205432 read(3, "A.\0\0\0aeabi\0\1$\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\24\1\25"..., 47) = 47 fstat64(3, {st_mode=S_IFREG|0644, st_size=206836, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff5000 mmap2(NULL, 270972, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76b49000 mprotect(0x76b7b000, 61440, PROT_NONE) = 0 mmap2(0x76b8a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x31000) = 0x76b8a000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/arm-linux-gnueabihf/librt.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\3\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0000\30\0\0004\0\0\0"..., 512) = 512 lseek(3, 25352, SEEK_SET) = 25352 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1320) = 1320 lseek(3, 24964, SEEK_SET) = 24964 read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49 fstat64(3, {st_mode=S_IFREG|0644, st_size=26672, ...}) = 0 mmap2(NULL, 90684, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76b32000 mprotect(0x76b38000, 61440, PROT_NONE) = 0 mmap2(0x76b47000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x76b47000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/arm-linux-gnueabihf/libcrypt.so.1", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0P\10\0\0004\0\0\0"..., 512) = 512 lseek(3, 29140, SEEK_SET) = 29140 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160 lseek(3, 28804, SEEK_SET) = 28804 read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49 fstat64(3, {st_mode=S_IFREG|0644, st_size=30300, ...}) = 0 mmap2(NULL, 254300, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76af3000 mprotect(0x76afa000, 61440, PROT_NONE) = 0 mmap2(0x76b09000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x6000) = 0x76b09000 mmap2(0x76b0b000, 155996, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76b0b000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/opt/vc/lib/libbcm_host.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\3547\0\0004\0\0\0"..., 512) = 512 lseek(3, 98436, SEEK_SET) = 98436 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1080) = 1080 lseek(3, 78982, SEEK_SET) = 78982 read(3, "A;\0\0\0aeabi\0\0011\0\0\0\5ARM1176JZF-S\0\6\7"..., 60) = 60 fstat64(3, {st_mode=S_IFREG|0644, st_size=99516, ...}) = 0 mmap2(NULL, 156968, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76acc000 mprotect(0x76adf000, 65536, PROT_NONE) = 0 mmap2(0x76aef000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x13000) = 0x76aef000 mmap2(0x76af0000, 9512, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x76af0000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/opt/vc/lib/libvchiq_arm.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0(\26\0\0004\0\0\0"..., 512) = 512 lseek(3, 29248, SEEK_SET) = 29248 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1040) = 1040 lseek(3, 21226, SEEK_SET) = 21226 read(3, "A;\0\0\0aeabi\0\0011\0\0\0\5ARM1176JZF-S\0\6\7"..., 60) = 60 fstat64(3, {st_mode=S_IFREG|0644, st_size=30288, ...}) = 0 mmap2(NULL, 88456, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76ab6000 mprotect(0x76abc000, 61440, PROT_NONE) = 0 mmap2(0x76acb000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x5000) = 0x76acb000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/opt/vc/lib/libvcos.so", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\234*\0\0004\0\0\0"..., 512) = 512 lseek(3, 171748, SEEK_SET) = 171748 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1360) = 1360 lseek(3, 37806, SEEK_SET) = 37806 read(3, "A;\0\0\0aeabi\0\0011\0\0\0\5ARM1176JZF-S\0\6\7"..., 60) = 60 fstat64(3, {st_mode=S_IFREG|0644, st_size=173108, ...}) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff4000 mmap2(NULL, 105624, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76a9c000 mprotect(0x76aa5000, 65536, PROT_NONE) = 0 mmap2(0x76ab5000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x9000) = 0x76ab5000 close(3) = 0 access("/etc/ld.so.nohwcap", F_OK) = -1 ENOENT (No such file or directory) open("/lib/arm-linux-gnueabihf/libdl.so.2", O_RDONLY|O_CLOEXEC) = 3 read(3, "\177ELF\1\1\1\0\0\0\0\0\0\0\0\0\3\0(\0\1\0\0\0\220\t\0\0004\0\0\0"..., 512) = 512 lseek(3, 8660, SEEK_SET) = 8660 read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 1160) = 1160 lseek(3, 8328, SEEK_SET) = 8328 read(3, "A0\0\0\0aeabi\0\1&\0\0\0\0056\0\6\6\10\1\t\1\n\2\22\4\23\1\24"..., 49) = 49 fstat64(3, {st_mode=S_IFREG|0644, st_size=9820, ...}) = 0 mmap2(NULL, 73912, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x76a89000 mprotect(0x76a8b000, 61440, PROT_NONE) = 0 mmap2(0x76a9a000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x1000) = 0x76a9a000 close(3) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff3000 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff2000 set_tls(0x76ff24c0, 0x76ff2bb8, 0x76ffb058, 0x76ff24c0, 0x76ffb058) = 0 mprotect(0x76d25000, 8192, PROT_READ) = 0 mprotect(0x76a9a000, 4096, PROT_READ) = 0 mprotect(0x76d4f000, 4096, PROT_READ) = 0 mprotect(0x76b47000, 4096, PROT_READ) = 0 mprotect(0x76b09000, 4096, PROT_READ) = 0 mprotect(0x76b8a000, 4096, PROT_READ) = 0 mprotect(0x76df9000, 4096, PROT_READ) = 0 mmap2(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x76ff1000 mprotect(0x76ecb000, 16384, PROT_READ) = 0 mprotect(0x76fb6000, 20480, PROT_READ|PROT_WRITE) = 0 mprotect(0x76fb6000, 20480, PROT_READ|PROT_EXEC) = 0 cacheflush(0x76fb6000, 0x76fbb000, 0, 0x15, 0x7ed1eed8) = 0 mprotect(0x76ffa000, 4096, PROT_READ) = 0 munmap(0x76f9f000, 92304) = 0 set_tid_address(0x76ff2068) = 1146 set_robust_list(0x76ff2070, 12) = 0 rt_sigaction(SIGRTMIN, {0x76d30434, [], SA_RESTORER|SA_SIGINFO, 0x76c191a0}, NULL, 8) = 0 rt_sigaction(SIGRT_1, {0x76d302d8, [], SA_RESTORER|SA_RESTART|SA_SIGINFO, 0x76c191a0}, NULL, 8) = 0 rt_sigprocmask(SIG_UNBLOCK, [RTMIN RT_1], NULL, 8) = 0 getrlimit(RLIMIT_STACK, {rlim_cur=8192*1024, rlim_max=RLIM_INFINITY}) = 0 futex(0x76ab5478, FUTEX_WAKE_PRIVATE, 2147483647) = 0 open("/dev/vchiq", O_RDWR|O_LARGEFILE) = 3 ioctl(3, 0xc008c40a, 0x7ed1f714) = 0 ioctl(3, 0xc410, 0x8) = 0 ioctl(3, 0xc400, 0) = 0 mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x76289000 brk(0) = 0x1aa1000 brk(0x1ac2000) = 0x1ac2000 mprotect(0x76289000, 4096, PROT_NONE) = 0 clone(child_stack=0x76a87f88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x76a884b8, tls=0x76a88910, child_tidptr=0x76a884b8) = 1148 ioctl(3, 0xc01cc402Process 1148 attached , 0x7ed1f694) = 0 [pid 1146] ioctl(3, 0xc40d, 0x10002) = 0 [pid 1146] ioctl(3, 0xc01cc402 <unfinished ...> [pid 1148] set_robust_list(0x76a884c0, 12 <unfinished ...> [pid 1146] <... ioctl resumed> , 0x7ed1f634) = 0 [pid 1146] ioctl(3, 0xc01cc402, 0x7ed1f634) = 0 [pid 1146] mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x75a89000 [pid 1146] mprotect(0x75a89000, 4096, PROT_NONE) = 0 [pid 1146] clone(child_stack=0x76287f88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x762884b8, tls=0x76288910, child_tidptr=0x762884b8) = 1149 [pid 1146] ioctl(3, 0xc40d, 0x11003) = 0 [pid 1146] ioctl(3, 0xc40d, 0x12004) = 0 [pid 1146] ioctl(3, 0xc01cc402Process 1149 attached , 0x7ed1f654) = 0 [pid 1146] ioctl(3, 0xc01cc402 <unfinished ...> [pid 1149] set_robust_list(0x762884c0, 12 <unfinished ...> [pid 1146] <... ioctl resumed> , 0x7ed1f654) = 0 [pid 1146] ioctl(3, 0xc40d, 0x13005) = 0 [pid 1146] ioctl(3, 0xc40d, 0x14006) = 0 [pid 1146] mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x75289000 [pid 1146] mprotect(0x75289000, 4096, PROT_NONE) = 0 [pid 1146] clone(child_stack=0x75a87f88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x75a884b8, tls=0x75a88910, child_tidptr=0x75a884b8) = 1150 [pid 1146] ioctl(3, 0xc01cc402Process 1150 attached , 0x7ed1f654) = 0 [pid 1146] ioctl(3, 0xc01cc402 <unfinished ...> [pid 1150] set_robust_list(0x75a884c0, 12 <unfinished ...> [pid 1146] <... ioctl resumed> , 0x7ed1f654) = 0 [pid 1146] ioctl(3, 0xc40d, 0x15007) = 0 [pid 1146] ioctl(3, 0xc40d, 0x16008) = 0 [pid 1146] mmap2(NULL, 8388608, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANONYMOUS|MAP_STACK, -1, 0) = 0x74a89000 [pid 1146] mprotect(0x74a89000, 4096, PROT_NONE) = 0 [pid 1146] clone(child_stack=0x75287f88, flags=CLONE_VM|CLONE_FS|CLONE_FILES|CLONE_SIGHAND|CLONE_THREAD|CLONE_SYSVSEM|CLONE_SETTLS|CLONE_PARENT_SETTID|CLONE_CHILD_CLEARTID, parent_tidptr=0x752884b8, tls=0x75288910, child_tidptr=0x752884b8) = 1151 [pid 1146] ioctl(3, 0xc40c, 0x10002) = 0 [pid 1146] ioctl(3, 0xc40c, 0x10002) = 0 [pid 1146] ioctl(3, 0x400cc404, 0x7ed1f6f4) = 0 [pid 1146] ioctl(3, 0xc40d, 0x10002) = 0 [pid 1146] ioctl(3, 0xc40c, 0x10002) = 0 [pid 1146] ioctl(3, 0xc010c408, 0x7ed1f6d0) = 13 [pid 1146] ioctl(3, 0xc40d, 0x10002) = 0 [pid 1146] ioctl(3, 0xc40d, 0x10002) = 0 [pid 1146] ioctl(3, 0xc01cc402Process 1151 attached , 0x7ed1f6cc) = -1 EIO (Input/output error) [pid 1146] ioctl(3, 0xc01cc402 <unfinished ...> [pid 1151] set_robust_list(0x752884c0, 12 <unfinished ...> [pid 1146] <... ioctl resumed> , 0x7ed1f6cc) = -1 EIO (Input/output error) [pid 1146] ioctl(3, 0xc01cc402 <unfinished ...> [pid 1151] <... set_robust_list resumed> ) = 0 [pid 1146] <... ioctl resumed> , 0x7ed1f6cc) = -1 EIO (Input/output error) [pid 1146] write(2, "* failed to add service - alread"..., 41* failed to add service - already in use?) = 41 [pid 1146] write(2, "\n", 1 ) = 1 [pid 1146] exit_group(1) = ? [pid 1149] +++ exited with 1 +++ [pid 1148] +++ exited with 1 +++ [pid 1150] +++ exited with 1 +++ [pid 1151] +++ exited with 1 +++ +++ exited with 1 +++

How to select fb device?

Using adafruit's 'piTFT', I now have hdmi as /dev/fb0, and the touchscreen as /dev/fb1.

How would I pass the device to init()?

Transparent background / overlay possibility ?

Hi,

I am trying to create a simple text overlay on top of an existing opengl running application, is this possible ?

I tried to create a BackgroundRGB(0, 0, 0, 0.1); but even with this it seems to cover the whole screen with a black background. When I remove the background I have a yellow background.

Any hints? :-)

My program is:

int main() {
    int width, height;
    char s[3];

    init(&width, &height);                  // Graphics initialization

    VGfloat color[4] = { 255, 255, 255, 1 };
    vgSetfv(VG_CLEAR_COLOR, 4, color);
    vgClear(0, 0, 100, 200);
    color[0] = 0, color[1] = 0, color[2] = 0;
    setfill(color);
    setstroke(color);
    StrokeWidth(0);
    vgLoadIdentity();

    Fill(255, 255, 255, 1);                 // White text
    TextMid(width / 2, height / 2, "hello, world", SerifTypeface, width / 10);  // Greetings
    End();                                  // End the picture

    fgets(s, 2, stdin);                     // look at the pic, end with [RETURN]
    finish();                               // Graphics cleanup
    exit(0);
}

svg2openvg

I have browsed some sourcecode for example the tigerdemo that compiles svg into a C program. Obviously dynamic loading would be awesome, but using SVG templates would be even better.

Is there are demand for such mapping?

Some improvement suggestions / feature requests

hello,
according to other graphic libs I would like to suggest a lib improvement/extension:

SetColor() // set brush color (foreground)
DrawCircle() // draw outlined Circle (circle edge) by defined SetColor
FillCircle() // draw filled Circle (circular area) by defined SetColor (aka Circle() )

by analogous manner also for Rectangle, Polygon, Ellipse.
As Circle() and FillCircle don't conflict, one can keep it both for legacy and lib compatibility purposes.

What do you think?

Can't use FontAwesome

I'm getting the following error:
img: libshapes.c:559: End: Assertion 'vgGetError() == VG_NO_ERROR' failed.
While trying to use FontAwesome. Here is the code i've been using:

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "shapes.h"
#include "fontinfo.h"
#include "FontAwesome.inc"

Fontinfo FontAwesome;

void register_fonts() {

    FontAwesome =
        loadfont(FontAwesome_glyphPoints,
            FontAwesome_glyphPointIndices,
            FontAwesome_glyphInstructions,
            FontAwesome_glyphInstructionIndices,
            FontAwesome_glyphInstructionCounts,
            FontAwesome_glyphAdvances,
            FontAwesome_characterMap,
            FontAwesome_glyphCount);

}

int main(int argc, char** argv) {
    int width, height;
    char s[3];
    char *image = argv[1],
         text[] = {0xE0};//argv[2];

    if (argc != 3) abort();

    register_fonts();

    init(&width, &height);
    Start(width, height);
    Background(0, 0, 0);
    Image(0, 0, width, height, image);
    Fill(255, 255, 255, 1);                 
    TextMid(width / 2, height / 2, text, FontAwesome, 36);  
    End();                                  

    fgets(s, 2, stdin);                     // look at the pic, end with [RETURN]
    finish();                               // Graphics cleanup
    exit(0);
}

can char * be changed to const char * in shapes.h

Is it possible to change the char * to const char * in shapes.h. The reason is:

  1. When you compile (with all warnings enabled) such as :
    Text(100, 100, "Hello World", MonoTypeface, 32) ;

you get a warning
... warning: passing argument 3 of ‘Text’ discards ‘const’ qualifier from pointer target type
Text(100, 100, "Hello World", MonoTypeface, 32) ;

When there are 100s of such text prompts, I find it really hard to keep looking through all the warnings trying to decide which to ignore and would find it easier to not have such warnings so that I do not miss a 'real' warning.

  1. I use const char * for strings, which also gives the above warning. The reason I use them for strings is because when using multi-dimension prompts/strings, I need to use multi-dim arrays of pointers to the actual string, because they occupy a lot less space than multi-dim array of chars (because, the latter multi-dim array of chars needs to allocate space for the largest string throughout the array and so wastes space, whereas a multi-dim array of pointers does not.) For example, I use const char * for strings for multi language menu prompts and an example of an array I use is:

in the source
int8_t * testStr[2][2] = {
{"A long string of characters","just a few"},
{"Hello", "Another long prompt for displaying"}
};

and In the header
extern int8_t * testStr[2][2] ;

Thanks
Steve

install on OSX issue

go get -u github.com/ajstarks/openvg

github.com/ajstarks/openvg

openvg/openvg.go:7:10: fatal error: 'VG/openvg.h' file not found

include "VG/openvg.h"

     ^

1 error generated.

Setting Window Size?

hi aj. thanks a lot for making openvg approachable.
sorry if i miss the obvious, is there any way to set the drawing window size?

setting int width, height will still result in a fullscreen...

thank you
rfl

Performance of large rects vs background

I am benchmarking the visual bahavior of tickers on different platforms. A ticker can be seen as a HTML Marquee element and is found in clip.c. I am implementing a small visual interface around it and noticed some unexpected behavior.

Consider 3 rects. A small header, a flat content area and a small footer. A ticker is running in the footer. I noticed that drawing the background of the content area manually the ticker starts to tear and stutter. When I color this section by means of Background. I get the same visual appearance and smooth linear motion of the text.

I have tried to change the order of rendering, but it doesn't seem to affect the behavior. Is this a direct limitation in OpenVG? If so, can it be overcome via OpenGL for example by buffering the Text operation, or a "more efficient" rect fill?

#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "VG/openvg.h"
#include "VG/vgu.h"
#include "shapes.h"

int main() {
        int  w, h, fontsize, cy0;
        char *message = "Now is";
        char s[3];
        init(&w, &h);
        fontsize = w / 50;
        float x = w;
        VGfloat tw = TextWidth(message, SansTypeface, fontsize);

        while ((x + tw) >= 0.0) {
                x -= 2.0;
                Start(w, h);

                Background(213, 43, 30);
/*              Background(255, 255, 255); */

                Fill(255, 255, 255, 1);
                Rect(0.0, 0.0, (float) w, (float) (fontsize * 2));
                Translate(x, (float) (fontsize / 2));
                Fill(0, 0, 0, 1);
                Text(0, 0, message, SansTypeface, fontsize);
                Translate(-x, (float) -(fontsize / 2));
/*              Fill(213, 43, 30, 1);
                Rect(0.0, (float) (fontsize * 2), (float) w, (float) (h - (fontsize * 4)));*/
                Fill(255, 255, 255, 1);
                Rect(0.0, (float) (h - (fontsize * 2)), (float) w, (float) (fontsize * 2));
                End();
        }
        fgets(s, 2, stdin);
        finish();
        exit(0);
}

Degree sign doesn't get rendered

Whenever I try to render text containing the degree sign (°), everything after it isn't rendered anymore. What could be the cause of that?

Feature Request: Add support for png,bmp and other simple image formats

I think it's quite a shame that you can't insert any other images except jpg's.

API wise: It should be fairly easy detecting what kind of image we have from the first few bytes of the image. If not the ending might help. Also adding a new parameter to the image function that would allow to force a specific image format.

Slight error in a colour definition

On line 582 of libshapes.c, right as the start of Start() you set the colour value to {255, 255, 255, 1} whereas it should be {1, 1, 1, 1} - all colour values are in the range [0-1], it works due to anything over 1.0 being clamped to 1.0.

void Start(int width, int height) {
VGfloat color[4] = { 255, 255, 255, 1 }; // Should be {1, 1, 1, 1};

compiling library - no rule error... need by DejaVuSans.inc

When I 'cd' into the openvg folder and 'make library' I get the following mo rule error

$ make library
gcc -O2 -Wall -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -fPIC -c oglinit.c
make: *** No rule to make target '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSans.ttf', needed by 'DejaVuSans.inc'. Stop.

The library does not get made. I have not altered anything in the freshly downloaded openvg folder.

I did not get this error before and it used to make fine, however I was using RPi Wheezy, but now I have just done a fresh install of Jessie OS. Is there anything else needed to do a make library?

Thanks
Steve

unwanted echo of keystrokes to terminal

In running a openvg program, all keystrokes as well as mouse buttons are echo to whatever was open before, the terminal or xterm. In my openvg program I use raw keystrokes using
open("/dev/input/event0",O_RDONLY|O_NONBLOCK)
I don't want the echo, any sugestions?
Thank you.

Can't scale images

Is it possible to use Scale() to up-scale images? I tried using Scale() with makeimage() and Image() but it doesn't seem to do anything.

additional feature request: outlined shapes (?)

are there meanwhile outlined shapes available, not just filled shapes ?
It shoud be possible to just draw a geometric pattern (Circle, Rectangle,...) by a line of a certain brush width and don't change the current background inside the pattern.

Enabling swapInterval?

Apologies if this has is documented somewhere but as I couldn't find it I figured I'd raise an issue regarding enablement of vsync.

Is there anyway to enable vsync for apps this library? Right now I'm set to call eglSwapInterval in oglinit() but I'm curious if there's a way to programatically do it without having to modify, recompile and re-link to the modified library.

Include Paeryn updates

Paeryn has submitted changes to the library. This is a tracking issue for those changes:

  1. Ability to change window sizes, opacity, and positions
  2. TextHeight and TextDepth functions
  3. AreaClear and WindowClear functions
  4. Outlined shapes
  5. Names colors

fix a random VG_NO_CONTEXT_ERROR crash

diff --git a/openvg.go b/openvg.go
index 70bb145..374588f 100644
--- a/openvg.go
+++ b/openvg.go
@@ -20,6 +20,7 @@ import (
        "os"
        "strings"
        "unsafe"
+       "runtime"
 )

 // RGB defines the red, green, blue triple that makes up colors.
@@ -188,6 +189,8 @@ var colornames = map[string]RGB{

 // Init initializes the graphics subsystem
 func Init() (int, int) {
+       // vg is not thread safe, avoid VG_NO_CONTEXT_ERROR
+       runtime.LockOSThread()
        var rh, rw C.int
        C.init(&rw, &rh)
        return int(rw), int(rh)

Error in font initialization.

On line 63 of libshapes.c you
memset(f.Glyphs, 0, MAXFONTPATH * sizeof(VGPath));
with MAXFONTPATH = 500 (line 21), but in fontinfo.h f.Glyphs is only declared as
VGPath Glyphs[256];

Golang make failed

I installed all dependecies sudo apt-get install libjpeg8-dev indent libfreetype6-dev ttf-dejavu-core

If I start make in openvg I get following message:

gcc -O2 -Wall -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -fPIC -c libshapes.c
gcc -L/opt/vc/lib -lEGL -lGLESv2 -ljpeg -shared -o libshapes.so oglinit.o libshapes.o
/usr/bin/ld: cannot find -lEGL
/usr/bin/ld: cannot find -lGLESv2
collect2: error: ld returned 1 exit status
Makefile:35: recipe for target 'library' failed
make: *** [library] Error 1

Is GO required?

Im using Geany to make and edit my programs but every time I compile one of the sample porgrams, I get an error about "VG/openvg.h" saying it can't find it.

I looked through the files myself and I can't even find the openvg.h either.

PS. I am on my Raspberry Pi on whatever the most recent Raspian version is.

Frozzen screen with the examples with alt-tab or mouse click

Hi,

In my raspberry X11 terminal, when I launch any sample code like ./particles and I click with the mouse (out-side the terminal window), The focus is lost then I can't send the Ctrl-C signal and the control over the graphic is lost.
Then I've to connect by network to my raspberry and kill the ./particles process to close the graphics window and then I can see all my keystrokes in other window.

Is normal or I'm doing anything wrong?

Regards.
Tomás.

Buffers are not preserved

Hi,
Thank you for such wonderful work. This really helped me in my project.

The problem I had was that the buffers are not preserved after a call to End();
e.g. with this code I expect the "hello, world" to appear on the drawn background after I press enter.

Fill(44, 77, 232, 1);
Circle(width / 2, 0, width);
End();
fgets(s, 2, stdin); //Wait for input               
Fill(255, 255, 255, 1);
TextMid(width / 2, height / 2, "hello, world", SerifTypeface, width / 10);
End();
fgets(s, 2, stdin);

But, sadly the entire buffer is reset and I see the "hello, world" on a yellow background.

I read through the EGL Specification and found by adding these lines to oglinit.c, my problem was solved.

//Preserve the buffers on swap
result = eglSurfaceAttrib(state->display, state->surface, EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
assert(EGL_FALSE != result);
// connect the context to the surface...

I added the lines just before "connect the context to the surface", but these options can also be passed in an attribute list to eglCreateWindowSurface().

This helps increase the performance a lot as I have to redraw only portions of the screen for an update.

hellovg crash

$ ./hellovg
fatal error: malloc/free - deadlock
[signal 0xb code=0x1 addr=0x2f0 pc=0x2d1cc]

goroutine 1 [syscall]:
[fp=0xb6896f20] return()
/home/pi/src/go/src/pkg/runtime/asm_arm.s:275
[fp=0xb6896f48] runtime.cgocall(0xb5df4, 0xb6896f58)
/home/pi/src/go/src/pkg/runtime/cgocall.c:162 +0xec
[fp=0xb6896f54] github.com/ajstarks/openvg._Cfunc_init(0x102001a0, 0x102001
98)
github.com/ajstarks/openvg/_obj/_cgo_defun.c:328 +0x30
[fp=0xb6896f68] github.com/ajstarks/openvg.Init(0xb6d2fafa, 0xb6f5f5f5)
github.com/ajstarks/openvg/_obj/_cgo_gotypes.go:295 +0x58
[fp=0xb6896fb8] main.main()
/home/pi/src/gopkg/src/github.com/ajstarks/openvg/go-client/hellovg
/hellovg.go:11 +0x20
[fp=0xb6896fd0] runtime.main()
/home/pi/src/go/src/pkg/runtime/proc.c:182 +0x78
[fp=0xb6896fd4] runtime.goexit()
/home/pi/src/go/src/pkg/runtime/proc.c:1223

goroutine 2 [syscall]:

$ go version
go version devel +d58997478ec6 Mon Apr 08 00:09:35 2013 -0700 linux/arm

$ cat /etc/debian_version
7.0

$ uname -r
3.6.11-rpi-aufs

openvg fails to load in raspberry's 2 models

after downloading from the github, the make fails with an error.
programs that had been created in the model 1 like "shapedemo" give an error as:
"oglinit.c oglinit:Assertion 'state->surface !=CCEGLSurface(0)' failed"

Scissoring support

I added two functions to my copy:

`// LimitTo limits the drawing area to specified rectangle
void LimitTo(VGint x, VGint y, VGint w, VGint h) {
vgSeti(VG_SCISSORING, VG_TRUE);
VGint coords[4] = { x, y, w, h };
vgSetiv(VG_SCISSOR_RECTS, 4, coords);
}

// Unlimit stops limiting drawing area to specified rectangle
void Unlimit() {
vgSeti(VG_SCISSORING, VG_FALSE);
}`

If you find them useful, please add them.

unwanted echo of keystrokes to terminal

Thank you for your answer, sorry I didn't reply sooner.
I'm still getting echo into the xterminal from the mouse and keyboard.
I suppose is because I don't know the proper attributes for the rawterm() function.
I use "open("/dev/input/event0".O_RDWR | O_NONBLOCK)" to get the raw key codes with "mouse0" for the mouse codes.
I appreciate your help very much.
Also, can the SaveEnd function or something else be used to create a JPG or BMP screenshot of a VG screen?

Very slow on rpi2 raspbian

Running this simple example:

// first OpenVG program
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include "shapes.h"
#include <time.h>

#include <sys/time.h>

long long current_timestamp() {
    struct timeval te;
    gettimeofday(&te, NULL);
    long long milliseconds = te.tv_sec*1000LL + te.tv_usec/1000;
    return milliseconds;
}

int main() {
    long long start, end;
    int width, height;
    VGfloat w2, h2, w;
    char s[3];

    init(&width, &height);                                      // Graphics initialization

    w2 = (VGfloat)(width/2);
    h2 = (VGfloat)(height/2);
    w  = (VGfloat)w;
    int circ_size = 0;
    int i;

    while (1) {
        circ_size = (circ_size + 1) % width;
        start = current_timestamp();
        Start(width, height);                                       // Start the picture
        Background(0, 0, 0);                                        // Black background
        Fill(44, 77, 232, 1);                                       // Big blue marble
        Circle(w2, 0, circ_size);                                           // The "world"
        Fill(255, 255, 255, 1);                                     // White text
        TextMid(w2, h2, "hello, world", SerifTypeface, width/10);   // Greetings
        End();                                                      // End the picture
        end = current_timestamp();
        printf("Loop iteration: %dms\n", end - start);
    }

    finish();                                                   // Graphics cleanup
    exit(0);
}

Compiled with

gcc vgtest.c libshapes.c oglinit.c -I../src -I/opt/vc/include/ -I../example -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux -L/opt/vc/lib -lEGL -lm -lGLESv2 -lbcm_host -ljpeg -o test.bin

Yields a constant 338ms for the iteration time on a raspberry pi 2. This seems incredibly slow for hardware accelerated vector graphics. Are those results known ? Am I doing something wrong ?

Performance optimizations

Dear Ajstarks,

Your shapes libs is looks very useful and I would like to use it to also make demo effects.. I tried for a bit on my PI3, but the performance seems low. It's extremely simple to use, though. Great API :) For instance, in the particles demo, it seems like it cannot handle more than 50 particles at 60 fps? Is there a reason for this? Can I disable some rendering settings, or should I reconfigure GLES? Please advise.

Cheers,

Pieter

Build fails on archlinux (armv7) without -fPIC

Building openvg on archlinux (armv7 / rpi2) fails:

$ make
/usr/bin/ld: libshapes.o: relocation R_ARM_MOVW_ABS_NC against `stdin' can not be used when making a shared object; recompile with -fPIC

To fix the issue, you have add -fPIC to INCLUDEFLAGS:

diff --git a/Makefile b/Makefile
index 3976e3e..e454b92 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
-INCLUDEFLAGS=-I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads
+INCLUDEFLAGS=-I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -fPIC
LIBFLAGS=-L/opt/vc/lib -lGLESv2 -lEGL -ljpeg
-FONTLIB=/usr/share/fonts/truetype/ttf-dejavu
+FONTLIB=/usr/share/fonts/TTF
FONTFILES=DejaVuSans.inc DejaVuSansMono.inc DejaVuSerif.inc
all: font2openvg fonts library

Updated font handing

This is a tracking bug to discuss the implementation of updated font handling.

const char *

Sincere thanks for the update change from char * to const char *. For completeness, could the remaining 2 funcs still using char * also be changed to const char *, which are:

extern void Image(VGfloat, VGfloat, int, int, char *);

extern void SaveEnd(char *);

Thanks again as the change has saved MB of space and cleared up all of the distracting warnings!

Printing text with accented characters

Is it possible to draw accented characters in this API? e.g. ÅåÖöÄä ?

I could not see any way to do that; I don't know if there needs to be some locale sensitive handling, or more font data or something else?

add existing func to shapes.h: VGImage createImageFromJpeg(const char *filename)

I am writing a new mouse routine and need to copy a jpg file (small thumbnail pictures) into VGImage mem bufs which can be later moved and placed on the screen. I see that libshapes.c has this function, which looks as though it could do this.

VGImage createImageFromJpeg(const char *filename)

Is is possible to add this existing within shapes.h to allow accessing it.


Also, does anyone know how to save an area of the screen as a jpeg file, which would allow screen shots to be saved.

Thanks
Steve

after installation: don't work, lib not found

after installation: can't compile, lib not found

source code: your helloWorld example

openvg_helloworld.c:6:23: fatal error: VG/openvg.h: no such file or directory
#include "VG/openvg.h"
^
compilation terminated.

which are the parameters which have to be passed go g++ call additionionally?
unfortunately your description is misleading.

currently my function call by Geany settings is
for compile:
g++ -Wall -c "%f" -lpthread  -lrt -lwiringPi
for make:
g++ -Wall -o "%e" "%f" -lpthread  -lrt -lwiringPi 

what has to be added for your graph libs?

[improvement suggestion] color codes for standardized color names

if you wish you are welcome to include the following color codes for standardized color names
(source: http://www.december.com/html/spec/colordeccompact.html
http://www.december.com/html/spec/colordec.html )

  • additional wishes and proposals appreciated!

(e.g., one could use a variable alpha value by
Stroke( RED, 0.5);

#define RED         255,  0, 0
#define SIGNRED     175, 30, 45
#define STRAWBERRY  190, 38, 37
#define RASPBERRY   135, 38, 87

#define MAGENTA     255, 0, 255
#define DARKMAGENTA 139, 0, 139
#define ROSE        255, 0, 204
#define PURPLE      160, 32, 240
#define PINK        255, 192, 203
#define DEEPPINK    255, 20, 147

#define YELLOW      255, 255, 0
#define SIGNYELLOW  255, 209, 22
#define LIGHTYELLOW 255, 255, 224
#define PAPAYA      255, 255, 126
#define PEACH       254, 240, 219
#define COPPER      184, 115, 51
#define LIGHTCOPPER 237, 195, 147
#define GOLD        255, 215, 0
#define ORANGE      255, 102, 0
#define SIGNORANGE  221, 117, 0
#define TANGERINE   255, 114, 22
#define SALMON      250, 128, 114
#define APRICOT     251, 161, 108

#define LIME          0, 255, 0
#define SIGNGREEN     0, 107, 87
#define GREEN         0, 128, 0
#define LIGHTGREEN  144, 238, 144
#define DARKGREEN    47,  79, 47
#define MINTGREEN   189, 252, 201

#define CYAN          0, 255, 255
#define LIGHTCYAN   224, 255, 255

#define BLUE          0,  0, 255
#define SIGNBLUE      0, 63, 135
#define DARKBLUE      0,  0, 139
#define NAVY          0,  0, 128
#define ULTRAMARINE  18,  10, 143
#define SKYBLUE     135, 206, 235
#define LIGHTBLUE   173, 216, 230
#define BLUEBERRY   117, 161, 208
#define AQUA        102, 204, 204
#define AQUAMARINE  112, 219, 147
#define VIOLET      143,  94, 153
#define WILDVIOLET  130,  11, 187

#define BROWN       128,  42, 42
#define SIGNBROWN    96,  51, 17
#define OCHRE       204, 119, 34
#define BRONZE      140, 120, 83

#define BLACK         0,  0,  0
#define WHITE       255, 255, 255
#define GRAY25       64,  64, 64
#define GRAY50      127, 127, 127
#define GRAY75      191, 191, 191
#define LIGHTGRAY   211, 211, 211
#define SILVER      192, 192, 192

Broken Makefile in the main directory

Hi,

When following your instructions from the "Build and run" part of readme there is a problem with the first "make" -- the one in the main directory.

It is probably just a file copying mistake, because it is the same Makefile as the one in the "client" directory.

Compiling by hand works.

...and of course: thanks for this lib and examples :-)

VGImage createImageFromJpeg - can width/height of image be made global to allow accessing

Thanks for the update to allow accessing VGImage createImageFromJpeg() which now allows me to load in jpgs into VGimage bufs. I need to find the width and height of the images once loaded in and see that this section of code is used in your routine:

width = jdc.output_width;
height = jdc.output_height;

If the above local width and height were made global, they could be accessed after calling createImageFromJpeg() - or is there another way to find these values.
Thanks

Move scaling origin point ?

When I scale a shape by using Scale(scale_factor, scale_factor);, it also moves the shape from its initial position. It looks like the scale origin point is (0,0).

How can I put the scale origin point to the shape's center without doing heavy computations ? I've found that I can Translate(-scale_factor*shape_width, -scale_factor*shape_height); but I don't find it very elegant.

Thanks :)

followed the instructions for shapedemo

i have followed the instructions from the main page but geting this error .

i am still learning soo i haven´t found the problem yet

Makefile.txt
shapedemo.c.txt

pi@raspberrypi:~/openvg/client $ make test gcc -Wall -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads -I.. -o shapedemo shapedemo.c ../libshapes.o ../oglinit.o -L/opt/vc/lib -lEGL -lGLESv2 -lbcm_host -lpthread -ljpeg -lutil ../libshapes.o: In function loadfont':
libshapes.c:(.text+0x1c0): undefined reference to vgCreatePath' libshapes.c:(.text+0x1e4): undefined reference to vgAppendPathData'
../libshapes.o: In function unloadfont': libshapes.c:(.text+0x27c): undefined reference to vgDestroyPath'
../libshapes.o: In function createImageFromJpeg': libshapes.c:(.text+0x3e8): undefined reference to vgCreateImage'
libshapes.c:(.text+0x410): undefined reference to vgImageSubData' ../libshapes.o: In function makeimage':
libshapes.c:(.text+0x490): undefined reference to vgCreateImage' libshapes.c:(.text+0x4b8): undefined reference to vgImageSubData'
libshapes.c:(.text+0x4d8): undefined reference to vgSetPixels' libshapes.c:(.text+0x4ec): undefined reference to vgDestroyImage'
../libshapes.o: In function Image': libshapes.c:(.text+0x538): undefined reference to vgSetPixels'
libshapes.c:(.text+0x54c): undefined reference to vgDestroyImage' ../libshapes.o: In function dumpscreen':
libshapes.c:(.text+0x58c): undefined reference to vgReadPixels' ../libshapes.o: In function Translate':
libshapes.c:(.text+0x904): undefined reference to vgTranslate' ../libshapes.o: In function Rotate':
libshapes.c:(.text+0x908): undefined reference to vgRotate' ../libshapes.o: In function Shear':
libshapes.c:(.text+0x90c): undefined reference to vgShear' ../libshapes.o: In function Scale':
libshapes.c:(.text+0x910): undefined reference to vgScale' ../libshapes.o: In function setfill':
libshapes.c:(.text+0x91c): undefined reference to vgCreatePaint' libshapes.c:(.text+0x92c): undefined reference to vgSetParameteri'
libshapes.c:(.text+0x940): undefined reference to vgSetParameterfv' libshapes.c:(.text+0x94c): undefined reference to vgSetPaint'
libshapes.c:(.text+0x958): undefined reference to vgDestroyPaint' ../libshapes.o: In function setstroke':
libshapes.c:(.text+0x968): undefined reference to vgCreatePaint' libshapes.c:(.text+0x978): undefined reference to vgSetParameteri'
libshapes.c:(.text+0x98c): undefined reference to vgSetParameterfv' libshapes.c:(.text+0x998): undefined reference to vgSetPaint'
libshapes.c:(.text+0x9a4): undefined reference to vgDestroyPaint' ../libshapes.o: In function StrokeWidth':
libshapes.c:(.text+0x9b4): undefined reference to vgSetf' libshapes.c:(.text+0x9c0): undefined reference to vgSeti'
libshapes.c:(.text+0x9d0): undefined reference to vgSeti' ../libshapes.o: In function setstop':
libshapes.c:(.text+0xad0): undefined reference to vgSetParameteri' libshapes.c:(.text+0xae0): undefined reference to vgSetParameteri'
libshapes.c:(.text+0xaf4): undefined reference to vgSetParameterfv' libshapes.c:(.text+0xb04): undefined reference to vgSetPaint'
../libshapes.o: In function FillLinearGradient': libshapes.c:(.text+0xb38): undefined reference to vgCreatePaint'
libshapes.c:(.text+0xb48): undefined reference to vgSetParameteri' libshapes.c:(.text+0xb5c): undefined reference to vgSetParameterfv'
libshapes.c:(.text+0xb74): undefined reference to vgDestroyPaint' ../libshapes.o: In function FillRadialGradient':
libshapes.c:(.text+0xbac): undefined reference to vgCreatePaint' libshapes.c:(.text+0xbbc): undefined reference to vgSetParameteri'
libshapes.c:(.text+0xbd0): undefined reference to vgSetParameterfv' libshapes.c:(.text+0xbe8): undefined reference to vgDestroyPaint'
../libshapes.o: In function ClipRect': libshapes.c:(.text+0xc1c): undefined reference to vgSeti'
libshapes.c:(.text+0xc3c): undefined reference to vgSetiv' ../libshapes.o: In function ClipEnd':
libshapes.c:(.text+0xc58): undefined reference to vgSeti' ../libshapes.o: In function Text':
libshapes.c:(.text+0xd54): undefined reference to vgGetMatrix' libshapes.c:(.text+0xdc0): undefined reference to vgLoadMatrix'
libshapes.c:(.text+0xdc8): undefined reference to vgMultMatrix' libshapes.c:(.text+0xdd8): undefined reference to vgDrawPath'
libshapes.c:(.text+0xdf8): undefined reference to vgLoadMatrix' ../libshapes.o: In function newpath':
libshapes.c:(.text+0x10a4): undefined reference to vgCreatePath' ../libshapes.o: In function makecurve':
libshapes.c:(.text+0x10dc): undefined reference to vgAppendPathData' libshapes.c:(.text+0x10e8): undefined reference to vgDrawPath'
libshapes.c:(.text+0x10f4): undefined reference to vgDestroyPath' ../libshapes.o: In function poly':
libshapes.c:(.text+0x1224): undefined reference to vguPolygon' libshapes.c:(.text+0x1230): undefined reference to vgDrawPath'
libshapes.c:(.text+0x1238): undefined reference to vgDestroyPath' ../libshapes.o: In function Rect':
libshapes.c:(.text+0x1284): undefined reference to vguRect' libshapes.c:(.text+0x1290): undefined reference to vgDrawPath'
libshapes.c:(.text+0x12a0): undefined reference to vgDestroyPath' ../libshapes.o: In function Line':
libshapes.c:(.text+0x12d4): undefined reference to vguLine' libshapes.c:(.text+0x12e0): undefined reference to vgDrawPath'
libshapes.c:(.text+0x12f0): undefined reference to vgDestroyPath' ../libshapes.o: In function Roundrect':
libshapes.c:(.text+0x1334): undefined reference to vguRoundRect' libshapes.c:(.text+0x1340): undefined reference to vgDrawPath'
libshapes.c:(.text+0x1350): undefined reference to vgDestroyPath' ../libshapes.o: In function Ellipse':
libshapes.c:(.text+0x1384): undefined reference to vguEllipse' libshapes.c:(.text+0x1390): undefined reference to vgDrawPath'
libshapes.c:(.text+0x13a0): undefined reference to vgDestroyPath' ../libshapes.o: In function Arc':
libshapes.c:(.text+0x13f0): undefined reference to vguArc' libshapes.c:(.text+0x13fc): undefined reference to vgDrawPath'
libshapes.c:(.text+0x140c): undefined reference to vgDestroyPath' ../libshapes.o: In function Start':
libshapes.c:(.text+0x1448): undefined reference to vgSetfv' libshapes.c:(.text+0x145c): undefined reference to vgClear'
libshapes.c:(.text+0x1484): undefined reference to vgLoadIdentity' ../libshapes.o: In function End':
libshapes.c:(.text+0x14a4): undefined reference to vgGetError' ../libshapes.o: In function SaveEnd':
libshapes.c:(.text+0x154c): undefined reference to vgGetError' ../libshapes.o: In function Background':
libshapes.c:(.text+0x1688): undefined reference to vgSetfv' libshapes.c:(.text+0x16a4): undefined reference to vgClear'
../libshapes.o: In function BackgroundRGB': libshapes.c:(.text+0x16d4): undefined reference to vgSetfv'
libshapes.c:(.text+0x16f0): undefined reference to vgClear' ../libshapes.o: In function WindowClear':
libshapes.c:(.text+0x171c): undefined reference to vgClear' ../libshapes.o: In function AreaClear':
libshapes.c:(.text+0x1724): undefined reference to vgClear' ../libshapes.o: In function RectOutline':
libshapes.c:(.text+0x1834): undefined reference to vguRect' libshapes.c:(.text+0x1840): undefined reference to vgDrawPath'
libshapes.c:(.text+0x1850): undefined reference to vgDestroyPath' ../libshapes.o: In function RoundrectOutline':
libshapes.c:(.text+0x1894): undefined reference to vguRoundRect' libshapes.c:(.text+0x18a0): undefined reference to vgDrawPath'
libshapes.c:(.text+0x18b0): undefined reference to vgDestroyPath' ../libshapes.o: In function EllipseOutline':
libshapes.c:(.text+0x18e4): undefined reference to vguEllipse' libshapes.c:(.text+0x18f0): undefined reference to vgDrawPath'
libshapes.c:(.text+0x1900): undefined reference to vgDestroyPath' ../libshapes.o: In function ArcOutline':
libshapes.c:(.text+0x1950): undefined reference to vguArc' libshapes.c:(.text+0x195c): undefined reference to vgDrawPath'
libshapes.c:(.text+0x196c): undefined reference to vgDestroyPath' collect2: error: ld returned 1 exit status Makefile:7: receptet för målet ”shapedemo” misslyckades ( recip for target "shapedemo" failed. ) make: *** [shapedemo] error 1 pi@raspberrypi:~/openvg/client $

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.