30 CImage& img,
bool verticalFlip,
bool forceRGB,
bool tricolor)
const
38 unsigned char* destPtr;
39 for (
unsigned int y = 0; y < size_y; y++)
42 destPtr = img(0, size_y - 1 - y);
45 for (
unsigned int x = 0; x < size_x; x++)
47 *destPtr++ = l2p_255(*srcPtr++);
55 unsigned char* destPtr;
56 for (
unsigned int y = 0; y < size_y; y++)
59 destPtr = img(0, size_y - 1 - y);
62 for (
unsigned int x = 0; x < size_x; x++)
64 uint8_t c = l2p_255(*srcPtr++);
79 unsigned char* destPtr;
80 for (
unsigned int y = 0; y < size_y; y++)
83 destPtr = img(0, size_y - 1 - y);
86 for (
unsigned int x = 0; x < size_x; x++)
88 uint8_t c = l2p_255(*srcPtr++);
103 unsigned char* destPtr;
104 for (
unsigned int y = 0; y < size_y; y++)
107 destPtr = img(0, size_y - 1 - y);
110 for (
unsigned int x = 0; x < size_x; x++)
112 uint8_t c = l2p_255(*srcPtr++);
133 CImage& img,
bool verticalFlip,
bool forceRGB)
const
135 getAsImage(img, verticalFlip, forceRGB);
138 if (insertionOptions.CFD_features_gaussian_size != 0)
140 img,
round(insertionOptions.CFD_features_gaussian_size));
141 if (insertionOptions.CFD_features_median_size != 0)
151 if (!genericMapParams.enableSaveAs3DObject)
return;
157 outObj->setPlaneCorners(x_min, x_max, y_min, y_max);
159 outObj->setLocation(0, 0, insertionOptions.mapAltitude);
167 for (
unsigned int y = 0; y < size_y; y++)
169 unsigned char* destPtr_color = imgColor(0, y);
170 unsigned char* destPtr_trans = imgTrans(0, y);
171 for (
unsigned int x = 0; x < size_x; x++)
173 uint8_t cell255 = l2p_255(*srcPtr++);
174 *destPtr_color++ = cell255;
176 int8_t auxC = (int8_t)((
signed short)cell255) - 127;
177 *destPtr_trans++ = auxC > 0 ? (auxC << 1) : ((-auxC) << 1);
181 outObj->assignImage(imgColor, imgTrans);
182 outSetOfObj->insert(outObj);
195 for (
size_t i = 1; i + 1 < size_x; i++)
198 for (
size_t j = 1; j + 1 < size_y; j++)
201 bool is_surrounded =
true;
202 for (
int di = -1; di <= 1 && is_surrounded; di++)
203 for (
int dj = -1; dj <= 1 && is_surrounded; dj++)
204 if ((di != 0 || dj != 0) &&
205 getCell(i + di, j + dj) > occup_threshold)
206 is_surrounded =
false;
208 if (getCell(i, j) < occup_threshold && !is_surrounded)