Skip to content

Commit 32cd6ad

Browse files
committed
added license
refactoring
1 parent 50616a2 commit 32cd6ad

12 files changed

+1452
-23
lines changed

COPYING

+504
Large diffs are not rendered by default.

example/src/testApp.h

+2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
class testApp : public ofBaseApp
77
{
88
public:
9+
910
void setup();
1011
void update();
1112
void draw();
@@ -21,6 +22,7 @@ class testApp : public ofBaseApp
2122
void gotMessage(ofMessage msg);
2223

2324
private:
25+
2426
ofPtr<ofBaseRenderer> _defaultRenderer;
2527
ofPtr<ofxShivaVGRenderer> _shivaVGRenderer;
2628

libs/ShivaVG/AUTHORS

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
===============================================================================
2+
ShivaVG - an open-source LGPL ANSI C implementation of the OpenVG specification
3+
===============================================================================
4+
5+
Lead developer:
6+
7+
Ivan Leben <[email protected]>
8+
9+
Occasional patches:
10+
11+
Daniel Turing
12+
Vincenzo Pupillo

libs/ShivaVG/COPYING

+504
Large diffs are not rendered by default.

libs/ShivaVG/NEWS

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
version 0.2.0 (20 Jan 2008):
2+
* Fixed a bug where rotation in the paint-to-user matrix broke radial
3+
gradient fill.
4+
5+
* vgCreateContextSH interface changed to allow for specification of
6+
surface width and height
7+
8+
* new extension: vgResizeSurfaceSH to be called whenever the surface
9+
needs to be resized to match the new window size
10+
11+
* #define GL_GLEXT_LEGACY in shExtensions.h prior to including gl.h
12+
so it doesn't include glext.h automatically, which enables us to
13+
check for OpenGL version and define OpenGL extension functions
14+
manually.
15+
16+
* Optimized image uploading by replacing the call to gluBuild2DMipmaps
17+
with glTexImage2D and changing the filter used to GL_LINEAR
18+
19+
* Added detection of ARB_texture_non_power_of_two extension to upload
20+
rectangular images directly instead of scaling them and loosing
21+
precision
22+
23+
* Pattern paint implemented
24+
25+
* Include folder changed to "vg" (lowercase)
26+
27+
* Added a message to test_blend program to notify the user that it
28+
has not been implemented yet (black screen is therefore fine)
29+
30+
* All the calls to glLoadMatrix replaced with glPushMatrix,
31+
glMultMatrix, glPopMatrix.
32+
33+
* Replaced images used in example programs for royalty-free
34+
35+
* README file written

libs/ShivaVG/README

+253
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,253 @@
1+
ShivaVG
2+
=============================
3+
4+
See AUTHORS for the list of contributors
5+
6+
ShivaVG is an open-source LGPL ANSI C implementation of the Khronos
7+
Group OpenVG specification.
8+
9+
I. BUILD
10+
II. TESTING
11+
III. IMPLEMENTATION STATUS
12+
IV. EXTENSIONS
13+
14+
15+
I. BUILD
16+
=============================
17+
18+
* Prerequisites:
19+
20+
OpenGL development libraries and headers should be installed.
21+
Othe than that, since it's ANSI C should compile with any modern
22+
C compiler. jpeglib needs to be installed for example programs
23+
that use images.
24+
25+
* Compiling under UNIX systems:
26+
27+
First run ./autogen.sh script to generate the required makefiles.
28+
Read the INSTALL file for more detailed (though generic) directions.
29+
This library uses the standard ./configure ; make. The example
30+
programs are automatically compiled. However, compilation of each
31+
example program can be toggled by ./configure --with-example-xxx
32+
command where xxx denotes the name of the example. Run ./configure
33+
--help for a list of such options.
34+
35+
* Compiling on Mac:
36+
37+
No XCode project files provided yet. The easiest way is by just
38+
using gcc, in which case look under UNIX compiling section.
39+
40+
* Compiling natively on Windows platform:
41+
42+
Solution files are provided for Visual C++ version 7 and 8. For
43+
the example programs using images to compile, you will need the
44+
appropriate build of jpeglib to match your Visual C++ version.
45+
46+
* Compiling in mingw / cygwin environment:
47+
48+
Might work just as fine as any UNIX-flavored system, but hasn't
49+
been tested yet.
50+
51+
52+
II. TESTING
53+
=============================
54+
55+
There is no real testing suite yet. The example programs are there
56+
just to play with what the implementation can currently do, but
57+
can hardly provide any proper validation, since no reference images
58+
are provided. Here is a description of each example program and
59+
what features it highlights:
60+
61+
* test_vgu
62+
63+
Constructs some path primitives using the VGU API.
64+
65+
* test_tiger
66+
67+
The most simple performance test. It draws the well known svg
68+
tiger using just simple stroke and fill of solid colors. It
69+
consists of 240 paths.
70+
71+
* test_dash
72+
73+
Shows different stroke dashing modes.
74+
75+
* test_linear
76+
77+
A rectangle drawn using 3-color linear gradient fill paint
78+
79+
* test_radial
80+
81+
A rectangle drawn using 3-color radial gradient fill paint
82+
83+
* test_interpolate
84+
85+
Interpolates between two paths - an apple and a pear.
86+
87+
* test_image
88+
89+
Images are drawn using VG_DRAW_IMAGE_MULTIPLY image mode to be
90+
multiplied with radial gradient fill paint.
91+
92+
* test_pattern
93+
94+
An image is drawn in multiply mode with an image pattern fill
95+
paint.
96+
97+
98+
III. IMPLEMENTATION STATUS
99+
=============================
100+
101+
Khronos states in the OpenVG specification, that the contexts for all
102+
their client APIs are expected to be created via the EGL API. Since
103+
EGL to use with ShivaVG has not been implemented yet, there is a set
104+
of extension functions provided for the task of creating, maintaining
105+
and destroying the OpenVG context. (See next section EXTENSIONS for
106+
details.)
107+
108+
What follows is a description of which functions or to what extent
109+
a certain function has been implemented. When a function is marked
110+
as PARTIALLY implemented, the TODO file or the comments in the code
111+
itself would provide further clues.
112+
113+
114+
* General:
115+
116+
vgGetError ............................ FULLY implemented
117+
vgFlush ............................... FULLY implemented
118+
vgFinish .............................. FULLY implemented
119+
120+
* Getters and setters:
121+
122+
vgSet ................................. FULLY implemented
123+
vgSeti ................................ FULLY implemented
124+
vgSetfv ............................... FULLY implemented
125+
vgSetiv ............................... FULLY implemented
126+
vgGetf ................................ FULLY implemented
127+
vgGeti ................................ FULLY implemented
128+
vgGetVectorSize ....................... FULLY implemented
129+
vgGetfv ............................... FULLY implemented
130+
vgGetiv ............................... FULLY implemented
131+
vgSetParameterf ....................... FULLY implemented
132+
vgSetParameteri ....................... FULLY implemented
133+
vgSetParameterfv ...................... FULLY implemented
134+
vgSetParameteriv ...................... FULLY implemented
135+
vgGetParameterf ....................... FULLY implemented
136+
vgGetParameteri ....................... FULLY implemented
137+
vgGetParameterVectorSize............... FULLY implemented
138+
vgGetParameterfv ...................... FULLY implemented
139+
vgGetParameteriv ...................... FULLY implemented
140+
141+
* Matrix Manipulation:
142+
143+
vgLoadIdentity ........................ FULLY implemented
144+
vgLoadMatrix .......................... FULLY implemented
145+
vgGetMatrix ........................... FULLY implemented
146+
vgMultMatrix .......................... FULLY implemented
147+
vgTranslate ........................... FULLY implemented
148+
vgScale ............................... FULLY implemented
149+
vgShear ............................... FULLY implemented
150+
vgRotate .............................. FULLY implemented
151+
152+
* Masking and Clearing:
153+
154+
vgMask ................................ NOT implemented
155+
vgClear ............................... FULLY implemented
156+
157+
* Paths:
158+
159+
vgCreatePath .......................... FULLY implemented
160+
vgClearPath ........................... FULLY implemented
161+
vgDestroyPath ......................... FULLY implemented
162+
vgRemovePathCapabilities .............. FULLY implemented
163+
vgGetPathCapabilities ................. FULLY implemented
164+
vgAppendPath .......................... FULLY implemented
165+
vgAppendPathData ...................... FULLY implemented
166+
vgModifyPathCoords .................... FULLY implemented
167+
vgTransformPath ....................... FULLY implemented
168+
vgInterpolatePath ..................... FULLY implemented
169+
vgPathLength .......................... NOT implemented
170+
vgPointAlongPath ...................... NOT implemented
171+
vgPathBounds .......................... FULLY implemented
172+
vgPathTransformedBounds ............... FULLY implemented
173+
vgDrawPath ............................ PARTIALLY implemented
174+
175+
* Paint:
176+
177+
vgCreatePaint ......................... FULLY implemented
178+
vgDestroyPaint ........................ FULLY implemented
179+
vgSetPaint ............................ FULLY implemented
180+
vgGetPaint ............................ FULLY implemented
181+
vgSetColor ............................ FULLY implemented
182+
vgGetColor ............................ FULLY implemented
183+
vgPaintPattern ........................ FULLY implemented
184+
185+
* Images:
186+
187+
vgCreateImage ......................... PARTIALLY implemented
188+
vgDestroyImage ........................ FULLY implemented
189+
vgClearImage .......................... FULLY implemented
190+
vgImageSubData ........................ PARTIALLY implemented
191+
vgGetImageSubData ..................... PARTIALLY implemented
192+
vgChildImage .......................... NOT implemented
193+
vgGetParent ........................... NOT implemented
194+
vgCopyImage ........................... FULLY implemented
195+
vgDrawImage ........................... PARTIALLY implemented
196+
vgSetPixels ........................... FULLY implemented
197+
vgWritePixels ......................... FULLY implemented
198+
vgGetPixels ........................... FULLY implemented
199+
vgReadPixels .......................... FULLY implemented
200+
vgCopyPixels .......................... FULLY implemented
201+
202+
* Image Filters:
203+
204+
vgColorMatrix ......................... NOT implemented
205+
vgConvolve ............................ NOT implemented
206+
vgSeparableConvolve ................... NOT implemented
207+
vgGaussianBlur ........................ NOT implemented
208+
vgLookup .............................. NOT implemented
209+
vgLookupSingle ........................ NOT implemented
210+
211+
* Hardware Queries:
212+
213+
vgHardwareQuery ....................... NOT implemented
214+
215+
* Renderer and Extension Information:
216+
217+
vgGetString ........................... FULLY implemented
218+
219+
* VGU
220+
221+
vguLine ............................... FULLY implemented
222+
vguPolygon ............................ FULLY implemented
223+
vguRect ............................... FULLY implemented
224+
vguRoundRect .......................... FULLY implemented
225+
vguEllipse ............................ FULLY implemented
226+
vguArc ................................ FULLY implemented
227+
vguComputeWarpQuadToSquare ............ NOT implemented
228+
vguComputeWarpSquareToQuad ............ NOT implemented
229+
vguComputeWarpQuadToQuad .............. NOT implemented
230+
231+
232+
IV. EXTENSIONS
233+
=============================
234+
235+
There are three extensions to the API that manipulate the OpenVG
236+
context as a temporary replacement for EGL:
237+
238+
VGboolean vgCreateContextSH(VGint width, VGint height)
239+
240+
Creates an OpenVG context on top of an existing OpenGL context
241+
that should have been manually initialized by the user of the
242+
library. Width and height specify the size of the rendering
243+
surface. No multi-threading support has been implemented yet.
244+
The context is created once per process.
245+
246+
void vgResizeSurfaceSH(VGint width, VGint height)
247+
248+
Should be called whenever the size of the surface changes (e.g.
249+
the owner window of the OpenGL context is resized).
250+
251+
void vgDestroyContextSH()
252+
253+
Destroys the OpenVG context associated with the calling process.

src/ofxShivaVGRenderer.cpp

+21-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,24 @@
1-
//
2-
// ofxShivaVGRenderer.cpp
3-
// ofxShivaVGRendererTest
4-
//
5-
// Created by Staal, Bjørn Gunnar (OSL-SDG) on 07.05.13.
6-
//
7-
//
1+
/*
2+
* ofxShivaVGRenderer
3+
* a 2d renderer for openFrameworks based on the ShivaVG library
4+
* by Bjørn Gunnar Staal
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library in the file COPYING;
18+
* if not, write to the Free Software Foundation, Inc.,
19+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
*/
822

923
#include "ofxShivaVGRenderer.h"
1024
#include "vgu.h"

src/ofxShivaVGRenderer.h

+25-10
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,28 @@
1-
//
2-
// ofxShivaVGRenderer.h
3-
// ofxShivaVGRendererTest
4-
//
5-
// Created by Staal, Bjørn Gunnar (OSL-SDG) on 07.05.13.
6-
//
7-
//
1+
/*
2+
* ofxShivaVGRenderer
3+
* a 2d renderer for openFrameworks based on the ShivaVG library
4+
* by Bjørn Gunnar Staal
5+
*
6+
* This library is free software; you can redistribute it and/or
7+
* modify it under the terms of the GNU Lesser General Public
8+
* License as published by the Free Software Foundation; either
9+
* version 2.1 of the License, or (at your option) any later version.
10+
*
11+
* This library is distributed in the hope that it will be useful,
12+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14+
* Lesser General Public License for more details.
15+
*
16+
* You should have received a copy of the GNU Lesser General Public
17+
* License along with this library in the file COPYING;
18+
* if not, write to the Free Software Foundation, Inc.,
19+
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20+
*
21+
*/
822

9-
#ifndef __ofxShivaVGRendererTest__ofxShivaVGRenderer__
10-
#define __ofxShivaVGRendererTest__ofxShivaVGRenderer__
23+
24+
#ifndef __ofxShivaVGRenderer__ofxShivaVGRenderer__
25+
#define __ofxShivaVGRenderer__ofxShivaVGRenderer__
1126

1227
#include "ofMain.h"
1328
#include "simpleVGContext.h"
@@ -44,4 +59,4 @@ class ofxShivaVGRenderer : public ofGLRenderer
4459

4560
};
4661

47-
#endif /* defined(__ofxShivaVGRendererTest__ofxShivaVGRenderer__) */
62+
#endif

0 commit comments

Comments
 (0)