regionator.cc
// Creates a new Regionator for tiles of max size 256 x 256.
Creates a new Regionator for tiles of max size 256 x 256.
Creates a new Regionator for tiles of max size 256 x 256 .
Regionator::Regionator(const Image &image,
                       const BoundingBox &bounding_box) {
  assert(image.width() >  1);
  assert(image.height() > 1);
  assert(image.colorspace() == Image::RGBA);
  image_ = &image;
  output_directory_ = "tiles";
  filename_prefix_ = "tile";
  root_kml_ = "root.kml";
  draw_tile_borders_ = false;
  SetMaxTileSideLength(256);
  min_lod_pixels_ = 128;
  max_lod_pixels_ = -1;
  double ra_min;
  double ra_max;
  double dec_min;
  double dec_max;
  bounding_box.GetMonotonicRaBounds(&ra_min, &ra_max);
  bounding_box.GetDecBounds(&dec_min, &dec_max);
  ra_pixel_scale_ = (ra_min - ra_max) /
                    static_cast<double>(image.width() - 1);
  dec_pixel_scale_ = (dec_min - dec_max) /
                     static_cast<double>(image.height() - 1);
  dec_upper_left_ = dec_max;
  ra_upper_left_ = ra_max;
}
Regionator :: Regionator ( const Image & image , const BoundingBox & bounding_box ) { assert ( image . width ( ) > 1 ) ; assert ( image . height ( ) > 1 ) ; assert ( image . colorspace ( ) == Image :: RGBA ) ; image_ = & image ; output_directory_ = " " ; filename_prefix_ = " " ; root_kml_ = " " ; draw_tile_borders_ = false ; SetMaxTileSideLength ( 256 ) ; min_lod_pixels_ = 128 ; max_lod_pixels_ = -1 ; double ra_min ; double ra_max ; double dec_min ; double dec_max ; bounding_box . GetMonotonicRaBounds ( & ra_min , & ra_max ) ; bounding_box . GetDecBounds ( & dec_min , & dec_max ) ; ra_pixel_scale_ = ( ra_min - ra_max ) / static_cast < double > ( image . width ( ) - 1 ) ; dec_pixel_scale_ = ( dec_min - dec_max ) / static_cast < double > ( image . height ( ) - 1 ) ; dec_upper_left_ = dec_max ; ra_upper_left_ = ra_max ; }
Creates a new Regionator for tiles of max size 256 x 256.
Creates a new Regionator for tiles of max size 256 x 256 .
// NB: The values of min_lod_pixels_ and the max tile size are related. // If one uses a quad tree hierarchy with min_lod_pixels_ = tile_size / 2 // Presuming a quadtree hierarchy min_lod_pixels = tile_size/2, // this makes the tile visible in screen space while that screen space // is between 128^2 and 256^2 pixels, hence the tile is never stretched. // If we used min_lod_pixels = tile_size, the image would always be // stretched. // Determine the coordinates of the upper left corner and the pixel scale // for this image, which will fully specify ra, dec for any range of pixel // coordinates in the image. // The ra and dec pixel scales are always negative because (0, 0) is the // upper left corner, so increasing indeces should decrease both ra and dec.