| 162 | } |
| 163 | |
| 164 | BOOL LASwriterWRL::write_point(const LASpoint* point) |
| 165 | { |
| 166 | lidardouble2string(printstring, header->get_x(point->get_X()), header->x_scale_factor); fprintf(file, "%s ", printstring); |
| 167 | lidardouble2string(printstring, header->get_y(point->get_Y()), header->y_scale_factor); fprintf(file, "%s ", printstring); |
| 168 | lidardouble2string(printstring, header->get_z(point->get_Z()), header->z_scale_factor); fprintf(file, "%s\012", printstring); |
| 169 | if (rgb) |
| 170 | { |
| 171 | if (p_count == rgb_alloc) |
| 172 | { |
| 173 | rgb_alloc *= 2; |
| 174 | rgb = (U8*)realloc_las(rgb, 3*sizeof(U8)*rgb_alloc); |
| 175 | } |
| 176 | if (point->rgb[0] > 255) |
| 177 | rgb[3*p_count+0] = U8_CLAMP(point->rgb[0]/256); |
| 178 | else |
| 179 | rgb[3*p_count+0] = U8_CLAMP(point->rgb[0]); |
| 180 | if (point->rgb[1] > 255) |
| 181 | rgb[3*p_count+1] = U8_CLAMP(point->rgb[1]/256); |
| 182 | else |
| 183 | rgb[3*p_count+1] = U8_CLAMP(point->rgb[1]); |
| 184 | if (point->rgb[2] > 255) |
| 185 | rgb[3*p_count+2] = U8_CLAMP(point->rgb[2]/256); |
| 186 | else |
| 187 | rgb[3*p_count+2] = U8_CLAMP(point->rgb[2]); |
| 188 | } |
| 189 | p_count++; |
| 190 | return TRUE; |
| 191 | } |
| 192 | |
| 193 | BOOL LASwriterWRL::update_header(const LASheader* header, BOOL use_inventory, BOOL update_extra_bytes) |
| 194 | { |
nothing calls this directly
no test coverage detected