Hi,
I'm new to this list and haven't been using Inkscape for long, but I think this one belongs on this list.
I asked elsewhere whether it was possible for Inkscape to record, edit and playback penstrokes through the calligraphic tool, and the answer was a negative one. So I went away and thought about it.
I wrote a quick C header (at http://chalisque.com/c/penstroke/stroke.h) to illustrate the idea.
It's quite short at present, just capturing the abstract idea, so I've included it at the bottom. (I'm not interested in compiling it yet, so don't comment about the //comments if these are not legal in C yet.)
The thinking took me beyond Inkscape, but its use in Inkscape (and possibly GIMP) was its raison d'etre, so I think Inkscape developers are probably worth talking to, but consider this.
Suppose there was a generic (at the level of GNOME or Unity or whatever) method to capture and manipulate raw penstrokes which could be analysed to produce other slightly different penstroke objects and which could be saved, loaded and passed from application to application. I could draw something in Inkscape, take the raw penstrokes that were used as input, pass them to GIMP and run it through one of GIMP's brushes to produce a bitmap image that could then be re-imported into an Inkscape document (so as to be able to efficiently use GIMP's filters and brushes) etc. For now I am just asking some of you to consider the possibilties and think ahead to the possibility of these facilities being available (whether Linux only or everywhere Inkscape runs I'll leave to other discussions.)
Have a think,
Cheers,
John
-----[ stroke.h ]----- // value typedefs typedef float penstroke_real; typedef int penstroke_index; typedef int penstroke_dim;
// function pointer typedefs typedef (penstroke_real *)(*penstroke_position_function)( void *data_ptr,
penstroke_real t); typedef (penstroke_real *)(*penstroke_parameter_function)( void *data_ptr,
penstroke_real t,
penstroke_index i); typedef (penstroke_index *)(*penstroke_indexed_parameter_function)( void *data_ptr,
penstroke_real t,
penstroke_index i);
// shorthand typedefs typedef penstroke_position_function pst_posf; typedef penstroke_parameter_function pst_paramf; typedef penstroke_indexed_parameter_function pst_iparamf; typedef penstroke_dim pst_d; typedef penstroke_index pst_i;
// struct typedefs typedef struct penstroke { penstroke_dim dimension; penstroke_position_function position; penstroke_dim paramter_dimension; penstroke_parameter_function parameter; penstroke_dim indexed_parameter_dimension; penstroke_indexed_paramter_function indexed_parameter; void *data; // arbitrary data for the functions to handle.) } penstroke;
// Note that the number of dimensions through which the penstroke runs is not specified. // this allows for a (time,x,y) and (time,x,y,z) type dynamic strokes to be expressed. penstroke *penstroke_create( pst_d ptd, pst_posf pt, pst_d pad, pst_paramf pa, pst_d ipad, pst_iparamf ipa, void *data_ptr); penstroke_real *penstroke_get_position(penstroke *p, penstroke_real t); penstroke_real *penstroke_get_param(penstroke *p, penstroke_real t, penstroke_index i); penstroke_index *penstroke_get_iparam(penstroke *p, penstroke_real t, penstroke_index i);