• Skip to content
  • Skip to link menu
KDE 3.5 API Reference
  • KDE API Reference
  • API Reference
  • Sitemap
  • Contact Us
 

kstars

fitsimage.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           fitsimage.cpp  -  FITS Image
00003                              -------------------
00004     begin                : Tue Feb 24 2004
00005     copyright            : (C) 2004 by Jasem Mutlaq
00006     email                : mutlaqja@ikarustech.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  *   Some code fragments were adapted from Peter Kirchgessner's FITS plugin*
00017  *   See http://members.aol.com/pkirchg for more details.                  *
00018  ***************************************************************************/
00019 
00020 #ifndef FITSIMAGE_H
00021 #define FITSIMAGE_H
00022 
00023 #include <qwidget.h>
00024 #include <qstring.h>
00025 #include <qimage.h>
00026 #include <qpixmap.h>
00027 #include <qframe.h>
00028 #include <qrect.h> 
00029 #include <qptrlist.h>
00030 #include <qscrollview.h>
00031 
00032 #include <kpixmapio.h>
00033 #include <kpixmap.h>
00034 #include <kdialog.h>
00035 #include <kmainwindow.h>
00036 #include <kurl.h>
00037 
00038 #include "indi/fitsrw.h"
00039 
00040 class KCommandHistory;
00041 class QScrollView;
00042 class FITSViewer;
00043 class FITSFrame;
00044 
00045 class FITSImage : public QScrollView  {
00046     Q_OBJECT
00047 
00048     public:
00049     
00050     friend class ContrastBrightnessDlg;
00051     friend class FITSProcess;
00052     friend class FITSFrame;
00053     friend class FITSViewer;
00054     friend class FITSHistogram;
00055     friend class FITSHistogramCommand;
00056     friend class FITSChangeCommand;
00057     friend class FITSProcessCommand;
00058     
00059     FITSImage(QWidget * parent, const char * name = 0);
00060     ~FITSImage();
00061     
00062     enum scaleType { FITSAuto = 0 , FITSLinear, FITSLog, FITSSqrt, FITSCustom };
00063     
00065     /*void paintEvent (QPaintEvent *ev);*/
00066     /* Resize event */
00067     void resizeEvent (QResizeEvent *ev);
00068     /* Loads FITS image, scales it, and displays it in the GUI */
00069     int  loadFits(const char *filename);
00070     /* Convert current image to a pixmap */
00071     void convertImageToPixmap();
00072     /* Clear memory */
00073     void clearMem();
00074     
00075     private:
00076     FITSViewer *viewer;                 /* parent FITSViewer */
00077     FITSFrame  *imgFrame;                   /* Frame holding the image */
00078     QImage  *displayImage;                  /* FITS image that is displayed in the GUI */
00079     QImage  *templateImage;                 /* backup image for currentImage */
00080     QPixmap qpix;                       /* Pixmap for drawing */
00081     KPixmapIO kpix;                     /* Pixmap IO for fast converting */
00082     QRect currentRect;                  /* Current rectangle encapsulating the image */
00083     int bitpix, bpp;                    /* bits per pixel and bytes per pixels for FITS */
00084     int width, height;                  /* Original FITS dimensions */
00085     double currentWidth,currentHeight;          /* Current width and height due to zoom */
00086     const double zoomFactor;                /* Image zoom factor */
00087     double currentZoom;                 /* Current Zoom level */
00088     QRgb   *grayTable;
00089     unsigned char *reducedImgBuffer;            /* scaled image buffer (0-255) range */
00090     
00091 
00092     void saveTemplateImage();               /* saves a backup image */
00093     void reLoadTemplateImage();             /* reloads backup image into the current image */
00094     void destroyTemplateImage();                /* deletes backup image */
00095     void zoomToCurrent();                   /* Zoom the image to current zoom level without modifying it */
00096     
00097     protected:
00098     /*void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph );*/
00099     void contentsMouseMoveEvent ( QMouseEvent * e );
00100     void viewportResizeEvent ( QResizeEvent * e) ;
00101     
00102     public slots:
00103     void fitsZoomIn();
00104     void fitsZoomOut();
00105     void fitsZoomDefault();
00106 };
00107 
00108 class FITSFrame : public QFrame
00109 {
00110   Q_OBJECT
00111   
00112     public:
00113       FITSFrame(FITSImage * img, QWidget * parent = 0, const char * name = 0);
00114       ~FITSFrame();
00115     
00116     private:
00117       FITSImage *image;
00118       
00119     protected:
00120       void paintEvent( QPaintEvent * e);
00121       
00122 };
00123 
00124 #endif

kstars

Skip menu "kstars"
  • Main Page
  • Modules
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

API Reference

Skip menu "API Reference"
  • keduca
  • kstars
Generated for API Reference by doxygen 1.5.9
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal