1 /* 2 Constants for inner image synthesis engine. 3 4 Copyright (C) 2010, 2011 Lloyd Konneker 5 6 This program is free software; you can redistribute it and/or modify 7 it under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, or 9 (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 19 */ 20 21 /* 22 Max size of neighborhood (patch) 23 Allocated on stack in reentrant version. 24 Engine returns error if parameter.patchSize exceeds this. 25 */ 26 #define IMAGE_SYNTH_MAX_NEIGHBORS 64 27 28 29 /* 30 Constants for selection masks 31 and transparency pixelel. 32 These should match the calling program's constants. 33 34 !!! Partially selected and partially transparent. 35 */ 36 #define MASK_TOTALLY_SELECTED 0xFF 37 #define MASK_UNSELECTED 0 38 39 #define ALPHA_TOTAL_TRANSPARENCY 0 40 41 #define PIXELEL_BLACK 0 42 43 44 /* 45 These specify the layout of our Pixel, which is not the same as Gimp !!! 46 e.g. MRGBW 47 These are the only constants: other counts and indexes are dynamic: 48 index of the first and last color and map pixelels 49 index of the alpha pixelel 50 count of color and map pixelel 51 */ 52 #define MASK_PIXELEL_INDEX 0 53 #define FIRST_PIXELEL_INDEX 1 /* Starting color pixelel (usually Red) */ 54 /* 55 The most pixelels imageSynth will store and use to match. 56 1 mask + 3 colors + 1 alpha + 3 map colors 57 */ 58 #define MAX_IMAGE_SYNTH_BPP 8 59 60 61 /* 62 Constants of the synthesis algorithm. 63 TODO in future versions, these might be parameters to the engine. 64 */ 65 66 /* 67 Maximum domain value of metric function for pixel difference. 68 Was metric[0] which was typically 65418, for the setting that affects weighting (autism.) 69 65535 is max number representable in 16-bit unsigned int. 70 !!! Note mapMetric[0] is the max domain value for the map metric. 71 The mapMetric domain is not gushort and values depend on a user given parameter. 72 */ 73 #define MAX_WEIGHT G_MAXUSHORT 74 75 /* 76 A constant multiplying factor of the map metric function. 77 */ 78 #define MAP_MULTIPLIER 4.0 79 /* 80 TODO scale the mapMetric and use a constant for the extreme value, 81 for slightly better performance?? 82 #define MAX_MAP_DIFF 65569 // G_MAXUINT = 4,294,967,295 = 32^2 - 1 83 */ 84 85 /* 86 The fraction of target points that must be bettered on a pass 87 else terminate repeated passes over the target. 88 */ 89 #define IMAGE_SYNTH_TERMINATE_FRACTION 0.1 90 91 /* 92 The fraction ( count of points in a band / total target points) 93 for banded randomization of target points. 94 */ 95 #define IMAGE_SYNTH_BAND_FRACTION 0.1 96 97 98 // Count of target pixels synthesized per deep progress callback 99 // !!! This must in binary all x lower bits ones i.e. 2^12-1 100 #define IMAGE_SYNTH_CALLBACK_COUNT 4095 101