1 /*
2 Parameters of the innermost image synthesis engine.
3 Same as engine parameters to be passed in the SimpleAPI.
4 
5 Also error return values of engine.
6 */
7 
8 #ifndef FALSE
9   #define FALSE 0
10 #endif
11 
12 
13 typedef enum  ImageSynthError
14 {
15   IMAGE_SYNTH_SUCCESS,
16   // Programmer error
17   IMAGE_SYNTH_ERROR_INVALID_IMAGE_FORMAT, // Returned by SimpleAPI adapter
18   IMAGE_SYNTH_ERROR_IMAGE_MASK_MISMATCH,  // "
19   // Programmer error, parameter errors returned by inner engine
20   IMAGE_SYNTH_ERROR_PATCH_SIZE_EXCEEDED,
21   IMAGE_SYNTH_ERROR_MATCH_CONTEXT_TYPE_RANGE,
22   // IN data errors, user error in making selection? returned by inner engine
23   IMAGE_SYNTH_ERROR_EMPTY_TARGET,
24   IMAGE_SYNTH_ERROR_EMPTY_CORPUS,
25   // There are more errors returned by the GIMP adapter
26   // There will be more errors returned by a future FullAPI adapter, similar to GIMP adapter errors
27   // These are only pertinent for the FullAPI, when more than one image is passed
28 } TImageSynthError;
29 
30 
31 typedef struct ImageSynthParametersStruct {
32 
33   /*
34   Boolean.  Whether to synthesize the target so it is subsequently seamlessly tileable.
35   This is only pertinenent if isMatchContext is False (when there is no context of the target.)
36   */
37   int isMakeSeamlesslyTileableHorizontally;
38   int isMakeSeamlesslyTileableVertically;
39   /*
40   Whether to synthesize the target so it matches the context of the target, if there is any.
41   For the SimpleAPI, there should always be a context, otherwise, the corpus (which is the context) is empty,
42   and this should be TRUE.
43   For the AdvancedAPI, the target might not have a context.
44   If there is no context, this is moot.
45   If there is a context, set it according to whether you want the synthesize target to blend into the context.
46   0 Don't match context
47   1 Match context but choose corpus entirely at random
48   2 Match context and synthesize randomly but in bands inward (from surrounding context.)
49   3 etc. see ...orderTarget()
50   */
51   int matchContextType;
52 
53   /*
54   For the advanced API, when maps are passed tothe engine,
55   the weight to give to the matching of the maps for the target and corpus,
56   as opposed to the weight  given to the matching of the target and the corpus themselves.
57   Multiplication factor the the map metric.
58   Scales the map metric function to return greater or lesser values
59   in relation to the target/corpus metric funtion.
60   */
61   double mapWeight;
62 
63   /*
64   A parameter of the statistical function for weighting pixel differences.
65   AKA autism
66   */
67   double sensitivityToOutliers;
68 
69   /*
70   Size of the patch matched, in pixels.
71   Formerly called neighbors (but it includes the pixel being synthesized, which is not strictly a neighbor.)
72   A factor in the complexity of the algorithm.
73   Typically a square: 9, 16, 25, 36, 49, 64.
74   But patches need not be square, indeed are NOT rectangular early in the algorithm.
75   */
76   unsigned int patchSize;
77 
78   /*
79   The maximum count of probes per pixel per pass.
80   Generally, this count of probes is done per pixel per pass,
81   except if an exact match is found, which ends probing.
82   A factor in the complexity of the algorithm.
83   Typically in the hundreds.
84   */
85   unsigned int maxProbeCount;
86 } TImageSynthParameters;
87 
88 
89 
90 
91 extern void
92 setDefaultParams(
93   TImageSynthParameters* param
94   );
95 
96