File: show_image.cc

package info (click to toggle)
purify 4.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 182,264 kB
  • sloc: cpp: 16,485; python: 449; xml: 182; makefile: 7; sh: 6
file content (22 lines) | stat: -rw-r--r-- 773 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include "purify/config.h"
#include "purify/types.h"
#include "purify/cimg.h"
#include "purify/directories.h"
#include "purify/pfitsio.h"
using namespace purify;
using namespace purify::notinstalled;

int main(int nargs, char const **args) {
  // up samples M31 example
  std::string const fitsfile = image_filename("M31.fits");
  std::string const fitsfile2 = image_filename("M31_512.fits");
  Image<t_real> const M31 = pfitsio::read2d(fitsfile).real();
  Image<t_real> const M31_large = pfitsio::read2d(fitsfile2).real();
#ifdef PURIFY_CImg
  CDisplay display = cimg::make_display<Image<t_real>>(M31, "M31 small");
  while (!display.is_closed()) {
    if (display.is_key())
      display = cimg::make_display<Image<t_real>>(M31_large, "Image of M31 large");
  }
#endif
}