diff --git a/ChangeLog b/ChangeLog index f62183d218..f1d3bcce80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +Thu Aug 19 00:18:32 1999 Adrian Likins + + * 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 * app/apptypes.h: add GradientPaintMode enum diff --git a/app/gimpbrushhose.c b/app/gimpbrushhose.c index 918a506597..10479058f6 100644 --- a/app/gimpbrushhose.c +++ b/app/gimpbrushhose.c @@ -194,6 +194,13 @@ gimp_brush_hose_load (char *file_name) header.height, header.bytes, 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 */ if ((fread (temp_buf_data (GIMP_BRUSH(brush)->mask), diff --git a/app/gimpbrushpixmap.c b/app/gimpbrushpixmap.c index d38ecb5038..a1188c2809 100644 --- a/app/gimpbrushpixmap.c +++ b/app/gimpbrushpixmap.c @@ -153,8 +153,13 @@ gimp_brush_pixmap_load (char *file_name) /* Get a new brush mask */ GIMP_BRUSH(brush)->mask = temp_buf_new (header.width, header.height, header.bytes, 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, fp)) < header.width * header.height) g_message ("GIMP brush file appears to be truncated."); diff --git a/data/brushes/pepper.gpb b/data/brushes/pepper.gpb new file mode 100644 index 0000000000..1b82803475 Binary files /dev/null and b/data/brushes/pepper.gpb differ diff --git a/data/brushes/vine.gih b/data/brushes/vine.gih new file mode 100644 index 0000000000..711c830a73 Binary files /dev/null and b/data/brushes/vine.gih differ diff --git a/docs/gih.txt b/docs/gih.txt new file mode 100644 index 0000000000..faff7a2dc6 --- /dev/null +++ b/docs/gih.txt @@ -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 + diff --git a/docs/gpb.txt b/docs/gpb.txt new file mode 100644 index 0000000000..f2472c070e --- /dev/null +++ b/docs/gpb.txt @@ -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 +