50 assert(band->
raster != NULL);
53 memset(
trim, 0,
sizeof(uint16_t) * 4);
59 for (y = 0; y < height; y++) {
60 for (offset = 0; offset < 3; offset++) {
62 for (x = offset; x < width; x += 3) {
64 rterror(
"_rti_raster_get_band_perimeter: Could not get band pixel");
68 RASTER_DEBUGF(4,
"top (x, y, value, nodata) = (%d, %d, %f, %d)", x, y, value, nodata);
85 for (x = width - 1; x >= 0; x--) {
86 for (offset = 0; offset < 3; offset++) {
88 for (y = offset; y < height; y += 3) {
90 rterror(
"_rti_raster_get_band_perimeter: Could not get band pixel");
94 RASTER_DEBUGF(4,
"right (x, y, value, nodata) = (%d, %d, %f, %d)", x, y, value, nodata);
96 trim[1] = width - (x + 1);
111 for (y = height - 1; y >= 0; y--) {
112 for (offset = 0; offset < 3; offset++) {
114 for (x = offset; x < width; x += 3) {
116 rterror(
"_rti_raster_get_band_perimeter: Could not get band pixel");
120 RASTER_DEBUGF(4,
"bottom (x, y, value, nodata) = (%d, %d, %f, %d)", x, y, value, nodata);
122 trim[2] = height - (y + 1);
137 for (x = 0; x < width; x++) {
138 for (offset = 0; offset < 3; offset++) {
140 for (y = offset; y < height; y += 3) {
142 rterror(
"_rti_raster_get_band_perimeter: Could not get band pixel");
146 RASTER_DEBUGF(4,
"left (x, , value, nodata) = (%d, %d, %f, %d)", x, y, value, nodata);
void rterror(const char *fmt,...)
Wrappers used for reporting errors and info.
rt_errorstate rt_band_get_pixel(rt_band band, int x, int y, double *value, int *nodata)
Get pixel value.
uint16_t rt_band_get_width(rt_band band)
Return width of this band.
uint16_t rt_band_get_height(rt_band band)
Return height of this band.
#define RASTER_DEBUGF(level, msg,...)
static char * trim(const char *input)