app/gimpimage.h app/gimpimageP.h app/gimpimage.c app/gimage_cmds.c

Sat Nov 14 23:16:55 GMT 1998  Austin Donnelly  <austin@greenend.org.uk>

	* app/gimpimage.h
	* app/gimpimageP.h
	* app/gimpimage.c
	* app/gimage_cmds.c
	* app/file_new_dialog.c
	* app/info_window.c
	* libgimp/gimp.h
	* libgimp/gimpimage.c
	* plug-ins/newsprint/newsprint.c
	* plug-ins/tiff/tiff.c: gimp_image_{get,set}_resolution() calls
	now get and set both X and Y resolutions.  Gimp image struct now
	has two resolution fields, one for each direction.  I've updated
	the two plugins which used the info (TIFF and newsprint).
This commit is contained in:
GMT 1998 Austin Donnelly
1998-11-14 23:28:47 +00:00
committed by Austin Donnelly
parent b8b5d7834d
commit 9dd1c38b7f
32 changed files with 319 additions and 143 deletions

View File

@ -982,30 +982,43 @@ gimp_image_detach_parasite (gint32 image_ID, const char *name)
gimp_destroy_params (return_vals, nreturn_vals);
}
float
gimp_image_get_resolution (gint32 image_ID)
void
gimp_image_get_resolution (gint32 image_ID,
float *xresolution,
float *yresolution)
{
GParam *return_vals;
int nreturn_vals;
float result;
float xres;
float yres;
g_return_if_fail(xresolution && yresolution);
return_vals = gimp_run_procedure ("gimp_image_get_resolution",
&nreturn_vals,
PARAM_IMAGE, image_ID,
PARAM_END);
result = 0.0; /* error return value */
/* error return values */
xres = 0.0;
yres = 0.0;
if (return_vals[0].data.d_status == STATUS_SUCCESS)
result = return_vals[1].data.d_float;
{
xres = return_vals[1].data.d_float;
yres = return_vals[2].data.d_float;
}
gimp_destroy_params (return_vals, nreturn_vals);
return result;
*xresolution = xres;
*yresolution = yres;
}
void
gimp_image_set_resolution (gint32 image_ID,
float resolution)
float xresolution,
float yresolution)
{
GParam *return_vals;
int nreturn_vals;
@ -1013,7 +1026,8 @@ gimp_image_set_resolution (gint32 image_ID,
return_vals = gimp_run_procedure ("gimp_image_set_resolution",
&nreturn_vals,
PARAM_IMAGE, image_ID,
PARAM_FLOAT, resolution,
PARAM_FLOAT, xresolution,
PARAM_FLOAT, yresolution,
PARAM_END);
gimp_destroy_params (return_vals, nreturn_vals);