Example #1
0
void
RasterRenderer::GenerateImage(bool do_shading,
                              unsigned height_scale,
                              int contrast, int brightness,
                              const Angle sunazimuth,
                              bool do_contour)
{
  if (image == NULL ||
      height_matrix.GetWidth() > image->GetWidth() ||
      height_matrix.GetHeight() > image->GetHeight()) {
    delete image;
    image = new RawBitmap(height_matrix.GetWidth(), height_matrix.GetHeight());

    delete[] contour_column_base;
    contour_column_base = new unsigned char[height_matrix.GetWidth()];
  }

  if (quantisation_effective == 0) {
    do_shading = false;
    do_contour = false;
  }

  const unsigned contour_height_scale = do_contour? height_scale * 2 : 16;

  ContourStart(contour_height_scale);

  if (do_shading)
    GenerateSlopeImage(height_scale, contrast, brightness,
                       sunazimuth, contour_height_scale);
  else
    GenerateUnshadedImage(height_scale, contour_height_scale);

  image->SetDirty();
}
Example #2
0
void
RasterRenderer::GenerateImage(bool do_shading,
                              unsigned height_scale,
                              int contrast, int brightness,
                              const Angle sunazimuth)
{
  if (image == NULL ||
      height_matrix.GetWidth() > image->GetWidth() ||
      height_matrix.GetHeight() > image->GetHeight()) {
    delete image;
    image = new RawBitmap(height_matrix.GetWidth(),
                          height_matrix.GetHeight());
  }

  if (quantisation_effective == 0)
    do_shading = false;

  if (do_shading)
    GenerateSlopeImage(height_scale, contrast, brightness,
                       sunazimuth);
  else
    GenerateUnshadedImage(height_scale);
}