graphical blog 2

Filed under: MyPaint, extension, software developement, test

Technic : draw with ballpen on paper + scan + gimp => copy/paste to mypaint, color by mypaint save as multiple png
remiport in gimp for remix (with multiply mode for first layer)

I wrote several functions to import/export layers as multiple png in Mypaint, the save after review and correction was integrated in Mypaint, the open, is in standby. => patchs

frenchIl y a également une version en français de cet article
Most of today computer has got several core in their CPU, today I wanted to accelerate some hard computing tasks that are done in a monothread, by dispatching them on 4core computer (my atom330 64bits ultra-low voltage and low-cost deskstation has 4 core and several servers have 2 to 8 cores).

I remember the old day of funny coding with BeOS on BeBox first two-CPU personal computer. I thought it could be cool and fun to reuse those technics on today computers.

I was astonished by the lake of semaphore management on Bash and other shell. Then I written these POSIX atomic semaphore API binding to be able to use more resources in parallel. This is a quick’n'dirty coding, without comments, with commented printf, without return code testing, but working enough for simple use. It only manage named semaphores (Linux-2.6 minimum), I will try to add more functions or aggregate them in a single command later.

You can download sema4shell (sema(phore/ for) shell) here. (updated to 0.3, march, 17 2009)
You can read the included README, included example sample.sh and the sem_overview man page to understand the POSIX implementation.

After a try on Xubuntu (the light desktop XFCE version of Ubuntu) of Pencil Gnu GPL licensed animation software (for GNU/Linux, Mac OSX and clone of Wine including MS version called something like ixpi).
,

Pencil is a young but really good application for animation. It’s mainly oriented to traditional drawing animation, but can be used for other things.
Features :
* multilayer (several bitmap layers (on demand), several vector layers (on demand), one(SVN include several) camera layer, SVN include sound layers)
* pan, zoom, rotate of the view (allowing drawing on a rotated canvas) objects and camera
* tablet pen pressure management for drawing (on pencil, brush and dip pen).
* onionskin for the pleasure of animators :)
* import of bitmaps (and SVG vector format as bitmap).
* export as MOV, only on Mac and perhaps wine clones)
* export frame by frame png (with transparency) or opaque jpeg, this should be reopened easily with Gimp Animation Package or assembled in a movie with mencoder (in mplayer project) and transcode.
* export as SWF movie (my test was not really good, only vector part worked perfectly in svn version, with libming version 0.4.0.beta5)
* timeline with keying of layers objects
* interpolation of camera movements
* palette management (GPL gimp/Inkscape/Agave palette format isn’t managed for now)

Update : The following described problem was due to libXi < 1.1.3, you can easily correct this by installing libXi-1.1.3 (lib) and the dependence inputproto >= 1.4 (proto), the last one are on x.org mirrors, go to individual subdir and then the lib or proto subdirs to get these versions. Upgrade only these two libs works with x.org 7.2

I really liked it, then tried to compile it on my main Linux From Scratch production computer, the compilation works perfectly, but sadly, when I tried to launch it on my LFS box, I obtained the following error:

Pencil: xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
Aborted

This is a common problem on xlib coded application, that yet aren’t tested on libxcb_xlib systems. XCB is a replacement of Xlib on X11 graphic interface, that allow faster access to graphical ressources a better way. XlibXcb is a wrapper to Xlib, allowing application coded for xlib to take transparently benefits of the new xcb architectures. But there is still some software that aren’t compatible, due to some light errors on (un)locking.

Some GNU/Linux distro patched libxcb to automatically pass this or doesn’t install xcb_xlib wrapper to avoid errors.
Some other have patched it with an environment variable to set to avoid the bug:

export LIBXCB_ALLOW_SLOPPY_LOCK=1
launch_your_application

Else the main two possible errors, for not corrected applications are:
xcb_xlib.c:41: xcb_xlib_lock: Assertion `!c->xlib.lock' failed.
xcb_xlib.c:50: xcb_xlib_unlock: Assertion `c->xlib.lock' failed.

More information on this Debian-devel message:
http://lists.debian.org/debian-devel-announce/2006/11/msg00010.html

The libxcb patch proposed in Linux from scratch with LIBXCB_ALLOW_SLOPPY_LOCK settable variable.

I don’t have only the bug only with Pencil, but with few other applications:
xsetwacom (from linuxwacom project) and few other. Searching on Google, at least some release of Sun implementation of Java suffer the same bug.

I hop this will help some people using those application and having bug to find a mean to avoid it until these application are patched.

Un exemple de SVG dynamique

Gosu un toolkit pour developper des jeux (et accessoirement plus généralement multimédia) en Ruby et c++. J’apprecie particulièrement la version Ruby qui est simple claire, compacte efficace. Permet sous GNU/Linux d’utiliser l’OpenGL pour le 3d, l’accélération de la partie 2D (bitmap, rotation, scale, zoom) en OpenGL, le son en SDL_mixer, la simulation physique avec chipmunk. La grosse limite est au niveau du vectoriel, rien pour le vectoriel 2D, il faut ecrire cette partie en OpenGL, rmagick permet bien d’écrire des courbes vectorielles dans des bitmap, mais c’est inutilisable pour retracer en temps réel.
Un excellent exemple en moins de 250 lignes de code commentées et propres OpenGLIntegration.rb, qui mélange décor 3D de montagnes fractales générées dynamiquement, et jeu 2d, avec des étoiles qui tournoient (bitmaps animés avec coloration dynamique) + score.

Ruby-goocanvas basé sur Gcompris est en train de passer progressivement à goocanvas et les résultats sont intéressant (utilisation des svg, changement de la taille de la fenêtre à volonté, etc…) d’après son développeur principal.

Un ‘concurrent’ de Gosu, Rubygame une plus grosse api, mais pas aussi facile d’accès, et peut être pas avec la même puissance d’affichage (à voir ???)
agg4r un bind Ruby de la bibliothèque Agg (antigrain), qui utilise SDL, elle ne gère malheureusement que les primitives les plus simples, mais un exemple de viewer SVG en c++ et quelques autres intégré aux sources la libagg laisse présager une certaine simplicité pour la gestion du SVG.

Pour la création/gestion des SVG, à explorer (je les notes juste comme ça, je ne suis pas encore convaincu et n’est pas eu le temps de creuser :
Ruby-SVG une bibliothèque SVG pour ruby, ça crée plutôt des SVG a embarqué dans le source d’une page que des réels fichiers SVG visiblement, mais ça ne doit pas être un problème
Svugy Pour créer des fichiers SVG

Une liste de téléphones mobiles supportant le SVG (je confirme mon V630i le fait), Inkscape est cité dans les documentations de s/e.

Toujours à propos des appareils mobiles, OpenKode est une unification de différentes api standard, de façon a faciliter le déploiement d’application sur différents systèmes mobiles sans redéveloppement, il utilise OpenGL (3D), OpenSL/ES (son), OpenVG (vecteurs 2d) et OpenMax (streaming video/audio).

A voir aussi, OpenVG, une api libre, comme OpenGL, mais dédiée dessin vectoriel 2d. Il y a déjà 2 implémentations libre et à sources ouvertes : Celle de Zack Rusin utilisant QtOpenGL pour l’accélération, et ShivaVG ne dépendant que d’OpenGL pour l’accélération, mais n’utilisant malheureusement pas les vertex buffer (tampons de vecteurs) ce qui le rend moins rapide qu’il ne pourrait. Visiblement, l’auteur, Ivan Leben, n’a fait qu’un upload dans le SVN il y a 5 mois et n’y a plus touché, dommage. Pas de librairie OpenVG ruby non plus visiblement.

G3D-ruby est un bind ruby de G3D qui est elle même une bibliothèque permettant d’utiliser les fonctions avancées d’OpenGL (vertex array, shaders (GLSL recommandé), …) ainsi que quelques fonctions utiles comme les collisions, physique, ray tracing, BSP tree.

La bibliothèque Shattered Ruby quant est basée sur la bibliothèque libre 3D de haut niveau Ogre3D (elle même basée sur OpenGL).

françaisJ’ai pondu un patch qui corrige quelques bugs importants relatifs aux masques et chemin de découpe dans inkscape-0.44.1.

Ces 2 attributs étaient perdus lors de simplification de chemin, lors de transformation d’objet en chemin [MISE A JOUR] ou lors d’application d’opération booléennes.
Le patch gzippé se trouve ici.
Pour l’appliquer, aller dans le repértoire ou se trouve le répertoire source inkscape-0.44.1 puis taper :

zcat fix_mask_clip-path_for_bool-simplify-obj2path.patch.gz | patch -N -p0

englishI made a patch for loose of mask and clip-path in inkscape-0.44.1.

The mask & cut-path attributes was lost when applying ‘object to path’, ’simplify path’ [UPDATE] or boolean operations.
The gziped patch is here.
To apply this, go in directory where is Inkscape-0.44.1 sources, then type:

zcat fix_mask_clip-path_for_bool-simplify-obj2path.patch.gz | patch -N -p0
« Newer PostsOlder Posts »

Powered by WordPress

Switch to our mobile site