2008-01-29 05:08:35 +08:00
|
|
|
/* GIMP - The GNU Image Manipulation Program
|
|
|
|
* Copyright (C) 1995 Spencer Kimball and Peter Mattis
|
|
|
|
*
|
2009-01-18 06:28:01 +08:00
|
|
|
* This program is free software: you can redistribute it and/or modify
|
2008-01-29 05:08:35 +08:00
|
|
|
* it under the terms of the GNU General Public License as published by
|
2009-01-18 06:28:01 +08:00
|
|
|
* the Free Software Foundation; either version 3 of the License, or
|
2008-01-29 05:08:35 +08:00
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
2018-07-12 05:27:07 +08:00
|
|
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2008-01-29 05:08:35 +08:00
|
|
|
*/
|
|
|
|
|
2004-07-02 21:31:25 +08:00
|
|
|
#ifndef __PPM_TOOL_H
|
|
|
|
#define __PPM_TOOL_H
|
|
|
|
|
1999-08-30 05:06:26 +08:00
|
|
|
#include <glib.h>
|
1999-08-27 06:29:37 +08:00
|
|
|
|
2002-11-20 04:25:57 +08:00
|
|
|
typedef struct ppm {
|
1999-08-27 06:29:37 +08:00
|
|
|
int width;
|
|
|
|
int height;
|
1999-08-30 05:06:26 +08:00
|
|
|
unsigned char *col;
|
2002-11-20 04:25:57 +08:00
|
|
|
} ppm_t;
|
1999-08-27 06:29:37 +08:00
|
|
|
|
|
|
|
void fatal(char *s);
|
2004-07-15 19:58:47 +08:00
|
|
|
void ppm_kill(ppm_t *p);
|
|
|
|
void ppm_new(ppm_t *p, int xs, int ys);
|
|
|
|
void get_rgb(ppm_t *s, float xo, float yo, unsigned char *d);
|
2002-11-20 04:25:57 +08:00
|
|
|
void resize(ppm_t *p, int nx, int ny);
|
|
|
|
void rescale(ppm_t *p, double scale);
|
|
|
|
void resize_fast(ppm_t *p, int nx, int ny);
|
2004-07-15 19:58:47 +08:00
|
|
|
void ppm_load(const char *fn, ppm_t *p);
|
|
|
|
void ppm_save(ppm_t *p, const char *fn);
|
|
|
|
void ppm_copy(ppm_t *s, ppm_t *p);
|
2002-11-20 04:25:57 +08:00
|
|
|
void fill(ppm_t *p, guchar *c);
|
2004-07-15 19:58:47 +08:00
|
|
|
void free_rotate(ppm_t *p, double amount);
|
2004-07-02 21:31:25 +08:00
|
|
|
void ppm_pad(ppm_t *p, int left,int right, int top, int bottom, guchar *);
|
2002-11-20 04:25:57 +08:00
|
|
|
void edgepad(ppm_t *p, int left,int right, int top, int bottom);
|
|
|
|
void autocrop(ppm_t *p, int room);
|
|
|
|
void crop(ppm_t *p, int lx, int ly, int hx, int hy);
|
2004-07-15 19:58:47 +08:00
|
|
|
void ppm_apply_gamma(ppm_t *p, float e, int r, int g, int b);
|
|
|
|
void ppm_apply_brightness(ppm_t *p, float e, int r, int g, int b);
|
|
|
|
void ppm_put_rgb_fast(ppm_t *s, float xo, float yo, guchar *d);
|
|
|
|
void ppm_put_rgb(ppm_t *s, float xo, float yo, guchar *d);
|
|
|
|
void ppm_drawline(ppm_t *p, float fx, float fy, float tx, float ty, guchar *col);
|
1999-08-27 06:29:37 +08:00
|
|
|
|
2002-11-20 04:25:57 +08:00
|
|
|
void repaint(ppm_t *p, ppm_t *a);
|
1999-08-27 06:29:37 +08:00
|
|
|
|
2002-11-20 04:25:57 +08:00
|
|
|
void blur(ppm_t *p, int xrad, int yrad);
|
1999-08-27 06:29:37 +08:00
|
|
|
|
2002-11-20 04:25:57 +08:00
|
|
|
void mkgrayplasma(ppm_t *p, float turb);
|
2004-07-02 21:31:25 +08:00
|
|
|
|
2004-07-26 02:12:49 +08:00
|
|
|
#define PPM_IS_INITED(ppm_ptr) ((ppm_ptr)->col != NULL)
|
|
|
|
|
2004-07-02 21:31:25 +08:00
|
|
|
#endif /* #ifndef __PPM_TOOL_H */
|
|
|
|
|