Commit bb7b98a4 authored by Sven Neumann's avatar Sven Neumann
Browse files

applied patches from Wolfgang Hofer <hof@hotbot.com>


--Sven
parent 9e0e369e
Mon Jan 31 10:59:29 CET 2000 Sven Neumann <sven@gimp.org>
* plug-ins/gap/gap_exchange_image.c
* plug-ins/gap/gap_pdb_calls.[ch]
* plug-ins/xjt/README_xjt_fileformat.txt
* plug-ins/xjt/xjt.c
* plug-ins/xjt/xpdb_calls.[ch]:
applied patches from Wolfgang Hofer <hof@hotbot.com>
Mon Jan 31 02:55:00 GMT 2000 Nick Lamb <njl195@zepler.org.uk>
 
* plug-ins/common/tiff.c: Images we save are full size (duh)
......
......@@ -28,6 +28,7 @@
*/
/* revision history:
* 1.1.15b 2000/01/30 hof: handle image specific parasites
* 1.1.15a 2000/01/25 hof: stopped gimp 1.0.x support (removed p_copy_content)
* handle pathes
* 0.98.00; 1998/11/30 hof: 1.st release
......@@ -92,14 +93,17 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
gint32 l_x1, l_x2, l_y1, l_y2;
guchar *l_cmap;
gint l_ncolors;
char **l_path_names;
char *l_current_pathname;
gchar **l_path_names;
gchar *l_current_pathname;
gint32 l_num_paths;
gdouble *l_path_points;
gint32 l_path_type;
gint32 l_path_closed;
gint32 l_num_points;
Parasite *l_parasite;
gchar **l_parasite_names = NULL;
gint32 l_num_parasites = 0;
l_rc = -1; /* init retcode to Errorstate */
l_layers_list = NULL;
l_channels_list = NULL;
......@@ -267,11 +271,7 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
gimp_image_set_cmap(dst_image_id, l_cmap, l_ncolors);
}
/* copy guides
* You need GIMP 1.1 or higher for that feature
* (in GIMP 1.0.2 there is no interface for that job
* and guides will be ignored.)
*/
/* copy guides */
l_guide_id = p_gimp_image_findnext_guide(src_image_id, 0); /* get 1.st guide */
while(l_guide_id > 0)
{
......@@ -310,6 +310,33 @@ p_steal_content(gint32 dst_image_id, gint32 src_image_id)
}
if(l_path_names) g_free(l_path_names);
/* copy image specific parasites
* (drawable specific parasites are handled implicite
* by stealing layers and channels)
*/
l_parasite_names = p_gimp_image_parasite_list (src_image_id, &l_num_parasites);
for(l_idx = 0; l_idx < l_num_parasites; l_idx++)
{
l_parasite = gimp_image_parasite_find(src_image_id, l_parasite_names[l_idx]);
if(l_parasite)
{
if(gap_debug) printf("copy image_parasite NAME:%s:\n", l_parasite_names[l_idx]);
gimp_image_attach_new_parasite(dst_image_id,
l_parasite->name,
l_parasite->flags,
l_parasite->size,
l_parasite->data);
if(l_parasite->data) g_free(l_parasite->data);
if(l_parasite->name) g_free(l_parasite->name);
g_free(l_parasite);
}
g_free(l_parasite_names[l_idx]);
}
g_free(l_parasite_names);
l_rc = 0;
cleanup:
......@@ -348,8 +375,10 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
gint32 l_channel_id;
gint32 l_guide_id;
gint32 l_old_bg_layer_id;
char **l_path_names;
gchar **l_path_names;
gint32 l_num_paths;
gchar **l_parasite_names = NULL;
gint32 l_num_parasites = 0;
if(gap_debug) printf("\nGAP-DEBUG: START p_replace_img img_id=%d \n", (int)image_id);
......@@ -395,6 +424,19 @@ p_replace_img(gint32 image_id, gint32 src_image_id)
}
if(l_path_names) g_free(l_path_names);
/* remove image specific parasites */
l_parasite_names = p_gimp_image_parasite_list (image_id, &l_num_parasites);
if(l_parasite_names)
{
for(l_idx = 0; l_idx < l_num_parasites; l_idx++)
{
if(gap_debug) printf("detach image_parasite NAME:%s:\n", l_parasite_names[l_idx]);
gimp_image_parasite_detach(image_id, l_parasite_names[l_idx]);
g_free(l_parasite_names[l_idx]);
}
g_free(l_parasite_names);
}
/* get list of all (old) dst_layers to delete */
l_layers_list = gimp_image_get_layers(image_id, &l_nlayers);
......
......@@ -23,6 +23,7 @@
*/
/* revision history:
* version 1.1.15b; 2000/01/30 hof: image parasites
* version 1.1.15a; 2000/01/26 hof: pathes
* removed old gimp 1.0.x PDB Interfaces
* version 1.1.14a; 2000/01/09 hof: thumbnail save/load,
......@@ -866,6 +867,36 @@ p_gimp_path_set_current(gint32 image_id, char *name)
return(-1);
} /* end p_gimp_path_set_current */
/* ============================================================================
* p_gimp_image_parasite_list
* ============================================================================
*/
gchar **
p_gimp_image_parasite_list (gint32 image_id, gint32 *num_parasites)
{
static gchar *l_procname = "gimp_image_parasite_list";
GParam *return_vals;
int nreturn_vals;
return_vals = gimp_run_procedure (l_procname,
&nreturn_vals,
PARAM_IMAGE, image_id,
PARAM_END);
if (return_vals[0].data.d_status == STATUS_SUCCESS)
{
*num_parasites = return_vals[1].data.d_int32;
return(return_vals[2].data.d_stringarray); /* OK, return name list */
}
printf("GAP: Error: PDB call of %s failed\n", l_procname);
*num_parasites = 0;
return(NULL);
} /* end p_gimp_image_parasite_list */
/* ============================================================================
* Procedures to get/set the video_info_file
* ============================================================================
......
......@@ -21,6 +21,7 @@
*/
/* revision history:
* version 1.1.15b; 2000/01/30 hof: image parasites
* version 1.1.15a; 2000/01/26 hof: pathes, removed gimp 1.0.x support
* version 1.1.14a; 2000/01/06 hof: thumbnail save/load,
* Procedures for video_info file
......@@ -83,6 +84,7 @@ gint p_gimp_path_delete(gint32 image_id, char *name);
char **p_gimp_path_list(gint32 image_id, gint32 *num_paths);
gint p_gimp_path_set_current(gint32 image_id, char *name);
char *p_gimp_path_get_current(gint32 image_id);
gchar** p_gimp_image_parasite_list (gint32 image_id, gint32 *num_parasites);
char *p_alloc_video_info_name(char *basename);
......
------------------------------
XJT Fileformat specification:
------------------------------
TODO:
extend and implement xjt fileformat for
- load/save pathes,
- load/save units and user_units
(XJT 1.1.15, 2000.01.23)
(XJT 1.1.15b, 2000.01.30) paths
(XJT 1.1.15a, 2000.01.23)
(XJT 1.1, 1998.10.31 - 1999.03.16)
XJT Fileformat was designed to save compressed GIMP Images with
......@@ -31,6 +28,7 @@ TODO:
Restrictions:
-------------
** XJT does not support INDEXED Images. **
......@@ -122,11 +120,12 @@ Syntax of the PRP -file
followed by a List of Image properties seperated by Blank:
PROP_VERSION
PROP_GIMP_VERSION
PROP_DIMENSION
PROP_RESOLUTION
PROP_TYPE 0 == RGB, 1 = GRAY
PROP_GUIDES position, orientation (can occure more than 1 time)
PROP_PARASITES
PROP_TYPE
PROP_GUIDES (can occure more than 1 time)
PROP_PARASITES (can occure more than 1 time)
Layer Properties:
......@@ -157,7 +156,7 @@ Syntax of the PRP -file
PROP_SHOW_MASK
PROP_OFFSETS
PROP_TATTOO
PROP_PARASITES
PROP_PARASITES (can occure more than 1 time)
PROP_NAME
Channel Properties:
......@@ -182,7 +181,7 @@ Syntax of the PRP -file
PROP_SHOW_MASKED
PROP_COLOR
PROP_TATTOO
PROP_PARASITES
PROP_PARASITES (can occure more than 1 time)
PROP_NAME
Parasite Properties:
......@@ -192,11 +191,28 @@ Syntax of the PRP -file
the parasite data is stored 1:1 in a
file named p<nr>.pte
followed by a List of Layer properties seperated by Blank:
followed by a List of Parasite properties seperated by Blank:
(properties for the default values are not written)
PROP_NAME
PROP_PARASITE_FLAGS
Path Properties:
====================
The line starts with
PATH Path identstring.
the parasite data is stored 1:1 in a
file named p<nr>.pte
followed by a List of Path properties seperated by Blank:
(properties for the default values are not written)
PROP_NAME
PROP_PATH_TYPE
PROP_PATH_CURRENT
PROP_PATH_LOCKED
PROP_PATH_POINT
--------------------------
Properties Summary
......@@ -204,6 +220,7 @@ Properties Summary
Property types:
--------------------------
PTYP_BOOLEAN
mnemonic
PTYP_INT
......@@ -216,8 +233,25 @@ Property types:
mnemonic:float_value
PTYP_2xFLT
mnemonic:float_value,float_value
PTYP_FLIST
mnemonic:float_value[,float_value ...]
xjt uses max 5 digits behind the comma.
precision of max 5 digits
17.00000999 is truncated to 17
2.00001999 is truncated to 2.00001
PTYP_STRING
mnemonic:"string_value"
If a String contains DoublleQuote Backslash
or newline Characters, they are escaped by
a preceeding Backslash character.
Example:
the text:
hello "quotes" and \backslash
is encoded as:
n:"hello \"quotes\" and \\backslash"
Properties are written as short mnemonics (1 upto 3 characters) to identify the Property.
Non-boolean Property-mnemonics require a Value seperated by ':'.
......@@ -228,7 +262,7 @@ Boolean tokens default always to FALSE and become TRUE when specified.
/* propery mnemonic type default values */
/* property mnemonic type default values */
PROP_END, "*", PTYP_NOT_SUPPORTED, 0,
PROP_COLORMAP, "*", PTYP_NOT_SUPPORTED, 0,
PROP_ACTIVE_LAYER, "acl", PTYP_BOOLEAN, FALSE,
......@@ -259,9 +293,18 @@ Boolean tokens default always to FALSE and become TRUE when specified.
PROP_TYPE, "typ", PTYP_INT, 0,
PROP_VERSION, "ver", PTYP_STRING, 0,
PROP_GIMP_VERSION, "gimp", PTYP_3xINT, 0,
PROP_PATH_POINT, "php", PTYP_FLIST, 0.0, 0.0, 0.0
PROP_PATH_TYPE, "pht", PTYP_INT, 1, /* BEZIER */
PROP_PATH_CURRENT, "pha", PTYP_BOOLEAN, FALSE,
PROP_PATH_LOCKED, "phl", PTYP_BOOLEAN, FALSE,
Property Values (Valid Ranges)
------------------------------
PROP_OPACITY valid values are
0.0 ( full transparent)
0.0 (full transparent)
upto
100.0 (full opaque)
......@@ -288,7 +331,9 @@ PROP_MODE valid values are:
15 ... XJT_DIVIDE_MODE
PROP_GUIDES
valid values for the 1.st integer are positve integers
valid values for the 1.st integer are
positve integers, representing x or y
position (depends on the 2.nd value)
valid values for the 2.nd integer are:
0 ... XJT_ORIENTATION_HORIZONTAL
1 ... XJT_ORIENTATION_VERTICAL
......@@ -300,36 +345,38 @@ PROP_GUIDES
to the xjt guide orientation property.
Unforunately this gimp internal representation has changed
PROP_PATH_TYPE valid values are:
1 ... XJT_BEZIER_PATH
PROP_PATH_POINT
This property is a list of float values.
For Paths of the type XJT_BEZIER_PATH
each point is represented by a float value triplet
x,y,type
where type can be 1 (BEZIER_ANCHOR point)
or 2 (BEZIER_CONTROL point)
-----------------------------------------------------------
changelog:
------------------------------------------------
- XJT Version 1.1
XJT Format 1.1 was extended for
RESOLUTION, TATTOO's, and PARASITES
Please note that TATTOO's and PARASITES are only defined
but not implemented.
(Gimp 1.1.3 has no PDB-Interfaces to enable Plug-Ins
to Load/Save TATTOO's and PARASITES)
-------------------------------
Extended Example of PRP file:
-------------------------------
PARASITES: The parasite data is stored in a seperate file for each
parasite. The file is named p<id>.pte, where
<id> is a unique integer parasite Id.
A Layer, Channel or Image can have 0 or more PROP_PARASITE
Properties (pte:1 pte:2 ...), where the integer parameter
refers to the unique parasite id.
Parasite entries can have a Name Property.
Extended Example of PRP file with resolution, and parasites:
Example of PRP file with resolution, parasites and paths:
-------------------------------------------------------------
GIMP_XJ_IMAGE ver:"1.1" w/h:256,256 res:72.0,100.5 pte:1
PATH n:"Path 1" php:103,65,1,103,65,2,176,15,2,177,15,1,178,15,2,198,229,2,198,229,1,198,229,2
L0 acl fsl pt o:35,116 n:"Pasted Layer"
L1 ln pt aml eml o:0,7 n:"Pasted Layer" pte:2 pte:3
m1 smc o:0,7 n:"Pasted Layer mask"
......
This diff is collapsed.
This diff is collapsed.
......@@ -20,6 +20,7 @@
*/
/* revision history:
* version 1.1.15b; 2000/01/28 hof: parasites part2
* version 1.1.15; 2000/01/20 hof: parasites
* version 1.02.00; 1999/02/01 hof: PDB-calls to load/save resolution tattoos and parasites
* (needs GIMP 1.1.1)-- UNDER CONSTRUCTION ---
......@@ -32,7 +33,7 @@
#include "libgimp/gimp.h"
gint p_procedure_available(char *proc_name);
gint p_procedure_available(gchar *proc_name);
gint p_get_gimp_selection_bounds (gint32 image_id, gint32 *x1, gint32 *y1, gint32 *x2, gint32 *y2);
gint p_gimp_selection_load (gint32 image_id, gint32 channel_id);
int p_layer_set_linked (gint32 layer_id, gint32 new_state);
......@@ -48,14 +49,22 @@ gint32 p_gimp_image_findnext_guide(gint32 image_id, gint32 guide_id);
gint32 p_gimp_image_get_guide_position(gint32 image_id, gint32 guide_id);
gint32 p_gimp_image_get_guide_orientation(gint32 image_id, gint32 guide_id);
void p_gimp_add_busy_cursors();
void p_gimp_remove_busy_cursors(void *);
gint p_gimp_image_get_resolution(gint32 image_id, float *xresolution, float *yresolution);
gint p_gimp_image_set_resolution(gint32 image_id, float xresolution, float yresolution);
gint32 p_gimp_layer_get_tattoo(gint32 layer_id);
gint32 p_gimp_channel_get_tattoo(gint32 channel_id);
char** p_gimp_parasite_list (gint32 *num_parasites);
gchar** p_gimp_drawable_parasite_list (gint32 drawable_id, gint32 *num_parasites);
gchar** p_gimp_image_parasite_list (gint32 image_id, gint32 *num_parasites);
gint p_gimp_path_set_points(gint32 image_id, gchar *name,
gint32 path_type, gint32 num_points, gdouble *path_points);
gdouble* p_gimp_path_get_points(gint32 image_id, gchar *name,
gint32 *path_type, gint32 *path_closed, gint32 *num_points);
gchar** p_gimp_path_list(gint32 image_id, gint32 *num_paths);
gchar* p_gimp_path_get_current(gint32 image_id);
gint p_gimp_path_set_current(gint32 image_id, gchar *name);
#endif
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment