I dug into the paint core to see what needs to be changed to support
drawing on textured media. Here's the basic modifications necessary:
* enum BrushApplicationHardness:
Add a new value "TEXTURE" which applies both pressure and
texture to a brush mask. It doesn't make sense to apply
only texture. Rationale: much of the realism afforded by
textures is due to the interaction between them and the
pressure an artist exerts on the medium.
* function paint_core_get_brush_mask:
Add "TEXTURE" to the switch statement. It will call the function
paint_core_texturize_mask (mask, x, y, pressure).
* new function paint_core_texturize_mask:
Calls paint_core_pressurize_mask. Next, it calls
gimp_context_get_texture (). Last, it applies the texturing algorithm
described in the previous email using the x and y arguments as an
offset into the texture.
* new function gimp_context_get_texture:
Returns a GPattern * from the specified context. Heeding Seth's
advice not to create a new file format without good reason, I've
determined the .PAT format to be suitable for this purpose: it
supports grayscale data and description text. Also, it provides
an already existing API framework, GPattern.
I have Makefile.am and configure.in modifications for a new textures
directory. Also, I have some texture tiles that may be added to the
new directory. The autoconf/automake diffs will be sent in a seperate
email along with a pointer to the new tiles.
- David