diff options
author | Henning Makholm <henning@makholm.net> | 2006-01-27 18:00:00 (EST) |
---|---|---|
committer | Julien Jorge <julien.jorge@stuff-o-matic.com> | 2013-01-10 16:00:40 (EST) |
commit | 7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717 (patch) | |
tree | 98d2772f50aaddb02ac94492d2b8b151aa3e9465 /flatten.h | |
download | xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.zip xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.tar.gz xcftools-7b7cd6da61b1fcc0f2a3ecce2cb9e6c42782c717.tar.bz2 |
Import of release 0.7
Diffstat (limited to 'flatten.h')
-rw-r--r-- | flatten.h | 72 |
1 files changed, 72 insertions, 0 deletions
diff --git a/flatten.h b/flatten.h new file mode 100644 index 0000000..03aa435 --- /dev/null +++ b/flatten.h @@ -0,0 +1,72 @@ +/* Flattning functions for xcftools + * + * Copyright (C) 2006 Henning Makholm + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of version 2 of the GNU General Public License as + * published by the Free Software Foundation. + * + * 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 + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef FLATTEN_H +#define FLATTEN_H + +#include "xcftools.h" +#include "pixels.h" + +#define PERHAPS_ALPHA_CHANNEL (NEWALPHA(0,1)) +#define FORCE_ALPHA_CHANNEL (NEWALPHA(0,2)) +struct FlattenSpec { + struct tileDimensions dim ; + rgba default_pixel ; + int numLayers ; + struct xcfLayer *layers ; + + const char * transmap_filename ; + const char * output_filename ; + enum out_color_mode { + COLOR_BY_FILENAME, + COLOR_BY_CONTENTS, + COLOR_INDEXED, + COLOR_RGB, + COLOR_GRAY, + COLOR_MONO + } out_color_mode ; + enum { ALLOW_PARTIAL_TRANSPARENCY, + DISSOLVE_PARTIAL_TRANSPARENCY, + FORBID_PARTIAL_TRANSPARENCY, + PARTIAL_TRANSPARENCY_IMPOSSIBLE + } partial_transparency_mode ; + int process_in_memory ; + int gimpish_indexed ; +}; + +/* From flatspec.c */ + +void init_flatspec(struct FlattenSpec *); + +void add_layer_request(struct FlattenSpec *,const char *name); +struct xcfLayer *lastlayerspec(struct FlattenSpec *,const char *option); + +typedef enum out_color_mode (*guesser) (struct FlattenSpec *,rgba **); + +/* Call this after processing options, and after opening the XCF file */ +void complete_flatspec(struct FlattenSpec *,guesser); +void analyse_colormode(struct FlattenSpec *,rgba **allPixels,guesser); + +/* From flatten.c */ + +typedef void (*lineCallback)(unsigned num,rgba *pixels); +void flattenIncrementally(struct FlattenSpec *,lineCallback); +rgba **flattenAll(struct FlattenSpec*); +void shipoutWithCallback(struct FlattenSpec *,rgba **pixels,lineCallback); + +#endif /* FLATTEN_H */ |