Krita Source Code Documentation
Loading...
Searching...
No Matches
flatten.h
Go to the documentation of this file.
1/* Flattning functions for xcftools
2 *
3 * This file was written by Henning Makholm <henning@makholm.net>
4 * It is hereby in the public domain.
5 *
6 * In jurisdictions that do not recognise grants of copyright to the
7 * public domain: I, the author and (presumably, in those jurisdictions)
8 * copyright holder, hereby permit anyone to distribute and use this code,
9 * in source code or binary form, with or without modifications. This
10 * permission is world-wide and irrevocable.
11 *
12 * Of course, I will not be liable for any errors or shortcomings in the
13 * code, since I give it away without asking any compenstations.
14 *
15 * If you use or distribute this code, I would appreciate receiving
16 * credit for writing it, in whichever way you find proper and customary.
17 */
18
19#ifndef FLATTEN_H
20#define FLATTEN_H
21
22#include "xcftools.h"
23#include "pixels.h"
24
25#define PERHAPS_ALPHA_CHANNEL (NEWALPHA(0,1))
26#define FORCE_ALPHA_CHANNEL (NEWALPHA(0,2))
27#define CHECKERED_BACKGROUND (NEWALPHA(0,200))
56
57/* From flatspec.c */
58
59void init_flatspec(struct FlattenSpec *);
60
61int add_layer_request(struct FlattenSpec *,const char *name);
62struct xcfLayer *lastlayerspec(struct FlattenSpec *,const char *option);
63
64typedef enum out_color_mode (*guesser) (struct FlattenSpec *,rgba **);
65
66/* Call this after processing options, and after opening the XCF file */
69
70/* From flatten.c */
71
72typedef void (*lineCallback)(unsigned num,rgba *pixels);
74rgba **flattenAll(struct FlattenSpec*);
75void shipoutWithCallback(struct FlattenSpec *,rgba **pixels,lineCallback);
76
77#endif /* FLATTEN_H */
void(* lineCallback)(unsigned num, rgba *pixels)
Definition flatten.h:72
enum out_color_mode(* guesser)(struct FlattenSpec *, rgba **)
Definition flatten.h:64
int flattenIncrementally(struct FlattenSpec *, lineCallback)
Definition flatten.c:646
int add_layer_request(struct FlattenSpec *, const char *name)
Definition flatspec.c:40
rgba ** flattenAll(struct FlattenSpec *)
Definition flatten.c:711
int analyse_colormode(struct FlattenSpec *, rgba **allPixels, guesser)
Definition flatspec.c:304
void shipoutWithCallback(struct FlattenSpec *, rgba **pixels, lineCallback)
Definition flatten.c:728
struct xcfLayer * lastlayerspec(struct FlattenSpec *, const char *option)
Definition flatspec.c:57
void init_flatspec(struct FlattenSpec *)
Definition flatspec.c:25
int complete_flatspec(struct FlattenSpec *, guesser)
Definition flatspec.c:131
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)
uint32_t rgba
Definition pixels.h:44
int gimpish_indexed
Definition flatten.h:54
const char * transmap_filename
Definition flatten.h:34
int process_in_memory
Definition flatten.h:53
rgba default_pixel
Definition flatten.h:30
int numLayers
Definition flatten.h:31
enum FlattenSpec::@15 window_mode
struct tileDimensions dim
Definition flatten.h:29
const char * output_filename
Definition flatten.h:35
@ FORBID_PARTIAL_TRANSPARENCY
Definition flatten.h:46
@ PARTIAL_TRANSPARENCY_IMPOSSIBLE
Definition flatten.h:47
@ ALLOW_PARTIAL_TRANSPARENCY
Definition flatten.h:44
@ DISSOLVE_PARTIAL_TRANSPARENCY
Definition flatten.h:45
struct xcfLayer * layers
Definition flatten.h:32
@ MANUAL_OFFSET
Definition flatten.h:50
@ MANUAL_CROP
Definition flatten.h:51
enum FlattenSpec::@14 partial_transparency_mode
@ COLOR_INDEXED
Definition flatten.h:39
@ COLOR_BY_CONTENTS
Definition flatten.h:38
@ COLOR_BY_FILENAME
Definition flatten.h:37
const char * name
Definition xcftools.h:182