data/brushes/vine.gih new files, a sample hose and a sample pixmap brush

* data/brushes/vine.gih
        * data/brushes/pepper.gpb: new files, a sample hose
        and a sample pixmap brush

        * docs/gpb.txt
        * docs/gih.txt: vague description of the current pixmap
        brush and hose formats

        * app/gimpbrushhose.c
        * app/gimpbrushpicmap.c: use the brush spacing info now
This commit is contained in:
Adrian Likins 1999-08-19 05:22:45 +00:00
parent 311953b12c
commit 342374190e
7 changed files with 144 additions and 2 deletions

View File

@ -1,3 +1,16 @@
Thu Aug 19 00:18:32 1999 Adrian Likins <alikins@redhat.com>
* data/brushes/vine.gih
* data/brushes/pepper.gpb: new files, a sample hose
and a sample pixmap brush
* docs/gpb.txt
* docs/gih.txt: vague description of the current pixmap
brush and hose formats
* app/gimpbrushhose.c
* app/gimpbrushpicmap.c: use the brush spacing info now
Wed Aug 18 22:49:31 1999 Adrian Likins <alikins@redhat.com> Wed Aug 18 22:49:31 1999 Adrian Likins <alikins@redhat.com>
* app/apptypes.h: add GradientPaintMode enum * app/apptypes.h: add GradientPaintMode enum

View File

@ -194,6 +194,13 @@ gimp_brush_hose_load (char *file_name)
header.height, header.height,
header.bytes, header.bytes,
0, 0, NULL); 0, 0, NULL);
GIMP_BRUSH(brush)->spacing = header.spacing;
/* set up spacing axis */
GIMP_BRUSH(brush)->x_axis.x = header.width / 2.0;
GIMP_BRUSH(brush)->x_axis.y = 0.0;
GIMP_BRUSH(brush)->y_axis.x = 0.0;
GIMP_BRUSH(brush)->y_axis.y = header.height / 2.0;
/* Read the brush mask data */ /* Read the brush mask data */
if ((fread (temp_buf_data (GIMP_BRUSH(brush)->mask), if ((fread (temp_buf_data (GIMP_BRUSH(brush)->mask),

View File

@ -153,8 +153,13 @@ gimp_brush_pixmap_load (char *file_name)
/* Get a new brush mask */ /* Get a new brush mask */
GIMP_BRUSH(brush)->mask = temp_buf_new (header.width, header.height, header.bytes, GIMP_BRUSH(brush)->mask = temp_buf_new (header.width, header.height, header.bytes,
0, 0, NULL); 0, 0, NULL);
/* Read the brush mask data */ GIMP_BRUSH(brush)->spacing = header.spacing;
/* set up spacing axis */
GIMP_BRUSH(brush)->x_axis.x = header.width / 2.0;
GIMP_BRUSH(brush)->x_axis.y = 0.0;
GIMP_BRUSH(brush)->y_axis.x = 0.0;
GIMP_BRUSH(brush)->y_axis.y = header.height / 2.0;
/* Read the brush mask data */
if ((fread (temp_buf_data (GIMP_BRUSH(brush)->mask), 1, header.width * header.height, if ((fread (temp_buf_data (GIMP_BRUSH(brush)->mask), 1, header.width * header.height,
fp)) < header.width * header.height) fp)) < header.width * header.height)
g_message ("GIMP brush file appears to be truncated."); g_message ("GIMP brush file appears to be truncated.");

BIN
data/brushes/pepper.gpb Normal file

Binary file not shown.

BIN
data/brushes/vine.gih Normal file

Binary file not shown.

53
docs/gih.txt Normal file
View File

@ -0,0 +1,53 @@
Gimp I* Hose Format
The gih format is use to store a series of pixmap brushes,
and some extra info for how to use them.
Basically, the format is real simple. It is a text header, followed
by a series of gpb files, all concatenated together.
The header format
================
First line is the name of the hose.
Second line is the number of brushes in file
ie
===========================
Fire
6
===========================
The rest is just gpb files catted in.
Making a gih file:
1. Create a series of gpb files. Note these do not
need to be the same size.
2. Create a text header like above.
3. Combine them all together:
cat header brush1.gpb brush2.gpb brush3.gpb > foo.gih
Thats about it for now.
Other bits:
==========
The spacing for the hose is currently based on the spacing
for the last brush in the hose.
WARNING:
=======
The header file format, and possible the entire file format
is likely to change.
Adrian Likins
aug 18, 1999

64
docs/gpb.txt Normal file
View File

@ -0,0 +1,64 @@
Gimp Pixmap Brush File Format
The current format for gpb files, the pixmap
bnrush format is very simple. What it essentially
boils down to is a greyscale gbr (gimp brush) and
a rgb pat (gimp pattern) concatented into the same file.
The gbr is first, and is used for the greyscale mask for
the brush. The pat is second and is used for the rgb info in
the file.
The name and spacing info for the greyscale portion
is used for the name and spacing of the pixmap
brush.
The greyscale mask and the rgb data need to be of
the same height and width.
At the time of writing this, there isnt a gpb file
loader or saver plugin, so the easiest way to
create gpb's is:
1. Create a rgb image of some sort. The best
images seem to be something on a black background,
but thats not required.
2. Generate a mask for all the parts of the image
that should be transparent in the final product. There
are several ways to do this but quickmask, or select
by color, selection to channel seem to be a good way to
do it. This mask needs to be greyscale. So I usually
make it a selection, and then use "save selection
as channel"
3. Take that mask, select all, and cut it. Then
open a new greyscale image, and paste it into the
image. This is the easiest way to insure the images
are the same size and are aligned. The white portions
of this image will be what is opaque in the pixmap
brush.
Take the above mask, and save it as a .gbr file.
It doesnt need to be in the brushes dir.
5. Take the original rgb image, remove any mask layers,
and flatten the image. Setting background color to black
and flattening to a black background seems to work
a little better.
Take this image, and save it as a .pat file. This does
not need to be in the patterns directory.
6. Go to a shell, and concatenate the files together
into a .gpb. Ie, for a mask named foo.gbr, and a
rgb pat name foo.pat:
cat foo.gbr foo.pat > foo.gpb
7. Copy that foo.gpb to your brushes dir
Adrian Likins
aug 18, 1999