257 int xlinewidth,
nchan;
259 rle_pixel *bot_edge_pxl, *bot_data_pxl, *bot_extrap_pxl;
260 rle_pixel *top_edge_pxl, *top_data_pxl, *top_extrap_pxl;
261 rle_pixel *left_edge_pxl, *left_data_pxl, *left_extrap_pxl;
262 rle_pixel *right_edge_pxl, *right_data_pxl, *right_extrap_pxl;
264 rasterbase = pyr->
corners[level];
265 xsize = pyr->
xlen[level];
266 ysize = pyr->
ylen[level];
271 for (chan = 0; chan <
nchan; chan++)
273 bot_edge_pxl = &(rastptr[chan * xlinewidth]);
274 top_edge_pxl = &(rastptr[(ysize-1) * nchan * xlinewidth
275 + chan * xlinewidth]);
276 for(x=0; x <
xsize; x++)
280 bot_data_pxl = bot_edge_pxl + i * xlinewidth *
nchan;
281 bot_extrap_pxl = bot_edge_pxl - i * xlinewidth *
nchan;
282 newvalue = 2 * (*bot_edge_pxl) - (*bot_data_pxl);
283 *bot_extrap_pxl = (newvalue < 0) ? 0 :
284 ((newvalue > 255) ? 255 : newvalue);
288 top_data_pxl = top_edge_pxl - i * xlinewidth *
nchan;
289 top_extrap_pxl = top_edge_pxl + i * xlinewidth *
nchan;
290 newvalue = 2 * (*top_edge_pxl) - (*top_data_pxl);
291 *top_extrap_pxl = (newvalue < 0) ? 0 :
292 ((newvalue > 255) ? 255 : newvalue);
299 left_edge_pxl = &(rastptr[(-
MASKBELOW) * nchan * xlinewidth]);
300 right_edge_pxl = &(rastptr[(-
MASKBELOW) * nchan * xlinewidth
301 + xlinewidth - MASKSIZE]);
302 for (chan = 0; chan <
nchan; chan++)
304 for(y=0; y < ysize + MASKSIZE - 1; y++)
308 left_data_pxl = left_edge_pxl +
i;
309 left_extrap_pxl = left_edge_pxl -
i;
310 newvalue = 2 * (*left_edge_pxl) - (*left_data_pxl);
311 *left_extrap_pxl = (newvalue < 0) ? 0 :
312 ((newvalue > 255) ? 255 : newvalue);
316 right_data_pxl = right_edge_pxl -
i;
317 right_extrap_pxl = right_edge_pxl +
i;
318 newvalue = 2 * (*right_edge_pxl) - (*right_data_pxl);
319 *right_extrap_pxl = (newvalue < 0) ? 0 :
320 ((newvalue > 255) ? 255 : newvalue);
322 left_edge_pxl += xlinewidth;
323 right_edge_pxl += xlinewidth;