diff --git a/NEWS b/NEWS index 38daa21..be26511 100644 --- a/NEWS +++ b/NEWS @@ -43,6 +43,10 @@ GFits returned as const references. HDU access operators[] have been implemented to access FITS extensions without range checking. +GFitsAsciiTable +GFitsBinTable + The table constructors now take a const reference as argument. + GFitsHDU The card() methods now return a reference instead of a pointer. @@ -56,6 +60,22 @@ GFitsHeader reference. Card access operators[] have been implemented to access header cards without range checking. +GFitsImage + All constructors and methods now take const references as arguments. + The size(), bitpix(), naxis() and anynul() methods return const + references, nulval() returns a const pointer. + +GFitsImageByte +GFitsImageDouble +GFitsImageFloat +GFitsImageLong +GFitsImageLongLong +GFitsImageSByte +GFitsImageShort +GFitsImageULong +GFitsImageUShort + All constructors now take const references as arguments. + GFitsTable The column table operator[] now returns a pointer instead of a reference. Set set() method has been added for column setting. diff --git a/include/GFitsAsciiTable.hpp b/include/GFitsAsciiTable.hpp index 8f39505..5c5ea1c 100644 --- a/include/GFitsAsciiTable.hpp +++ b/include/GFitsAsciiTable.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsAsciiTable.hpp - FITS ASCII table class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,7 +34,7 @@ /***********************************************************************//** * @class GFitsAsciiTable * - * @brief Interface for FITS ASCII table + * @brief FITS ASCII table class * * The following ASCII table columns are supported: * TSTRING (A), @@ -47,17 +47,17 @@ class GFitsAsciiTable : public GFitsTable { public: // Constructors and destructors GFitsAsciiTable(void); - GFitsAsciiTable(int nrows); + GFitsAsciiTable(const int& nrows); GFitsAsciiTable(const GFitsAsciiTable& table); virtual ~GFitsAsciiTable(void); // Operators - GFitsAsciiTable& operator= (const GFitsAsciiTable& table); + GFitsAsciiTable& operator=(const GFitsAsciiTable& table); // Methods virtual void clear(void); virtual GFitsAsciiTable* clone(void) const; - HDUType exttype(void) const { return HT_ASCII_TABLE; } + HDUType exttype(void) const; private: // Private methods @@ -66,4 +66,16 @@ private: void free_members(void); }; + +/***********************************************************************//** + * @brief Return extension type + * + * @return Extension type (HT_ASCII_TABLE). + ***************************************************************************/ +inline +GFitsHDU::HDUType GFitsAsciiTable::exttype(void) const +{ + return (HT_ASCII_TABLE); +} + #endif /* GFITSASCIITABLE_HPP */ diff --git a/include/GFitsBinTable.hpp b/include/GFitsBinTable.hpp index 8ed6dbd..d4fa41d 100644 --- a/include/GFitsBinTable.hpp +++ b/include/GFitsBinTable.hpp @@ -1,7 +1,7 @@ /*************************************************************************** * GFitsBinTable.hpp - FITS binary table class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -34,24 +34,24 @@ /***********************************************************************//** * @class GFitsBinTable * - * @brief Interface for FITS binary table + * @brief FITS binary table class ***************************************************************************/ class GFitsBinTable : public GFitsTable { public: // Constructors and destructors GFitsBinTable(void); - GFitsBinTable(int nrows); + GFitsBinTable(const int& nrows); GFitsBinTable(const GFitsBinTable& table); virtual ~GFitsBinTable(void); // Operators - GFitsBinTable& operator= (const GFitsBinTable& table); + GFitsBinTable& operator=(const GFitsBinTable& table); // Implemented pure virtual methods virtual void clear(void); virtual GFitsBinTable* clone(void) const; - HDUType exttype(void) const { return HT_BIN_TABLE; } + HDUType exttype(void) const; private: // Private methods @@ -60,4 +60,16 @@ private: void free_members(void); }; + +/***********************************************************************//** + * @brief Return extension type + * + * @return Extension type (HT_BIN_TABLE). + ***************************************************************************/ +inline +GFitsHDU::HDUType GFitsBinTable::exttype(void) const +{ + return (HT_BIN_TABLE); +} + #endif /* GFITSBINTABLE_HPP */ diff --git a/include/GFitsImage.hpp b/include/GFitsImage.hpp index 22f649b..2edc5d1 100644 --- a/include/GFitsImage.hpp +++ b/include/GFitsImage.hpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GFitsImage.hpp - FITS image abstract base class * + * GFitsImage.hpp - Abstract FITS image base class * * ----------------------------------------------------------------------- * * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImage.hpp - * @brief GFitsImage class definition. + * @brief Abstract FITS image base class definition * @author Juergen Knoedlseder */ @@ -34,7 +34,7 @@ /***********************************************************************//** * @class GFitsImage * - * @brief Abstract interface for the FITS image classes. + * @brief Abstract FITS image base class * * This class defines the abstract interface for a FITS image. ***************************************************************************/ @@ -43,16 +43,16 @@ class GFitsImage : public GFitsHDU { public: // Constructors and destructors GFitsImage(void); - explicit GFitsImage(int bitpix, int nx); - explicit GFitsImage(int bitpix, int nx, int ny); - explicit GFitsImage(int bitpix, int nx, int ny, int nz); - explicit GFitsImage(int bitpix, int nx, int ny, int nz, int nt); - explicit GFitsImage(int bitpix, int naxis, const int* naxes); + GFitsImage(const int& bitpix, const int& nx); + GFitsImage(const int& bitpix, const int& nx, const int& ny); + GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz); + GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt); + GFitsImage(const int& bitpix, const int& naxis, const int* naxes); GFitsImage(const GFitsImage& image); virtual ~GFitsImage(void); // Operators - GFitsImage& operator= (const GFitsImage& image); + GFitsImage& operator=(const GFitsImage& image); // Pure virtual methods virtual void clear(void) = 0; @@ -65,16 +65,16 @@ public: virtual int type(void) const = 0; // Implemented pure virtual methods - HDUType exttype(void) const { return HT_IMAGE; } + HDUType exttype(void) const; // Base class methods - int size(void) const; - int bitpix(void) const; - int naxis(void) const; - int naxes(int axis) const; - int anynul(void) const; + const int& size(void) const; + const int& bitpix(void) const; + const int& naxis(void) const; + int naxes(const int& axis) const; + const int& anynul(void) const; void nulval(const void* value); - void* nulval(void); + const void* nulval(void) const; std::string print(const GChatter& chatter = NORMAL) const; protected: @@ -113,4 +113,66 @@ protected: int m_anynul; //!< Number of NULLs encountered }; + +/***********************************************************************//** + * @brief Return extension type + * + * @return Extension type (HT_IMAGE). + ***************************************************************************/ +inline +GFitsHDU::HDUType GFitsImage::exttype(void) const +{ + return (HT_IMAGE); +} + + +/***********************************************************************//** + * @brief Return size of pixel array + ***************************************************************************/ +inline +const int& GFitsImage::size(void) const +{ + return m_num_pixels; +} + + +/***********************************************************************//** + * @brief Return number of Bits per pixel (negative=floating point) + ***************************************************************************/ +inline +const int& GFitsImage::bitpix(void) const +{ + return m_bitpix; +} + + +/***********************************************************************//** + * @brief Return dimension of image + ***************************************************************************/ +inline +const int& GFitsImage::naxis(void) const +{ + return m_naxis; +} + + +/***********************************************************************//** + * @brief Return number of nul values envountered during loading + ***************************************************************************/ +inline +const int& GFitsImage::anynul(void) const +{ + return m_anynul; +} + + +/***********************************************************************//** + * @brief Return nul value + ***************************************************************************/ +inline +const void* GFitsImage::nulval(void) const +{ + return (const_cast(this)->ptr_nulval()); +} + #endif /* GFITSIMAGE_HPP */ diff --git a/include/GFitsImageByte.hpp b/include/GFitsImageByte.hpp index 8715031..1e445cb 100644 --- a/include/GFitsImageByte.hpp +++ b/include/GFitsImageByte.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageByte.hpp - FITS Byte image class * + * GFitsImageByte.hpp - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,8 +20,8 @@ ***************************************************************************/ /** * @file GFitsImageByte.hpp - * @brief GFitsImageByte class definition. - * @author J. Knodlseder + * @brief FITS Byte image class definition + * @author Juergen Knoedlseder */ #ifndef GFITSIMAGEBYTE_HPP @@ -41,24 +41,24 @@ class GFitsImageByte : public GFitsImage { public: // Constructors and destructors GFitsImageByte(void); - explicit GFitsImageByte(int nx, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, int nz, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, int nz, int nt, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int naxis, const int* naxes, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL); + GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL); GFitsImageByte(const GFitsImageByte& image); virtual ~GFitsImageByte(void); // Operators - GFitsImageByte& operator= (const GFitsImageByte& image); - unsigned char& operator() (const int& ix); - unsigned char& operator() (const int& ix, const int& iy); - unsigned char& operator() (const int& ix, const int& iy, const int& iz); - unsigned char& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const unsigned char& operator() (const int& ix) const; - const unsigned char& operator() (const int& ix, const int& iy) const; - const unsigned char& operator() (const int& ix, const int& iy, const int& iz) const; - const unsigned char& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageByte& operator=(const GFitsImageByte& image); + unsigned char& operator()(const int& ix); + unsigned char& operator()(const int& ix, const int& iy); + unsigned char& operator()(const int& ix, const int& iy, const int& iz); + unsigned char& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const unsigned char& operator()(const int& ix) const; + const unsigned char& operator()(const int& ix, const int& iy) const; + const unsigned char& operator()(const int& ix, const int& iy, const int& iz) const; + const unsigned char& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageDouble.hpp b/include/GFitsImageDouble.hpp index a97f2e6..34a0b5b 100644 --- a/include/GFitsImageDouble.hpp +++ b/include/GFitsImageDouble.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageDouble.hpp - FITS double precision image class * + * GFitsImageDouble.hpp - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageDouble.hpp - * @brief GFitsImageDouble class definition. + * @brief Double precision FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageDouble * - * @brief Implements a FITS double precision image + * @brief Double precision FITS image class ***************************************************************************/ class GFitsImageDouble : public GFitsImage { public: // Constructors and destructors GFitsImageDouble(void); - explicit GFitsImageDouble(int nx, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, int nz, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, int nz, int nt, const double* pixels = NULL); - explicit GFitsImageDouble(int naxis, const int* naxes, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL); + GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL); GFitsImageDouble(const GFitsImageDouble& image); virtual ~GFitsImageDouble(void); // Operators - GFitsImageDouble& operator= (const GFitsImageDouble& image); - double& operator() (const int& ix); - double& operator() (const int& ix, const int& iy); - double& operator() (const int& ix, const int& iy, const int& iz); - double& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const double& operator() (const int& ix) const; - const double& operator() (const int& ix, const int& iy) const; - const double& operator() (const int& ix, const int& iy, const int& iz) const; - const double& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageDouble& operator=(const GFitsImageDouble& image); + double& operator()(const int& ix); + double& operator()(const int& ix, const int& iy); + double& operator()(const int& ix, const int& iy, const int& iz); + double& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const double& operator()(const int& ix) const; + const double& operator()(const int& ix, const int& iy) const; + const double& operator()(const int& ix, const int& iy, const int& iz) const; + const double& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageFloat.hpp b/include/GFitsImageFloat.hpp index 34e7b32..00d82eb 100644 --- a/include/GFitsImageFloat.hpp +++ b/include/GFitsImageFloat.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageFloat.hpp - FITS single precision image class * + * GFitsImageFloat.hpp - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageFloat.hpp - * @brief GFitsImageFloat class definition. + * @brief Single precision FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageFloat * - * @brief Implements a FITS single precision image + * @brief Single precision FITS image class ***************************************************************************/ class GFitsImageFloat : public GFitsImage { public: // Constructors and destructors GFitsImageFloat(void); - explicit GFitsImageFloat(int nx, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, int nz, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, int nz, int nt, const float* pixels = NULL); - explicit GFitsImageFloat(int naxis, const int* naxes, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL); + GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL); GFitsImageFloat(const GFitsImageFloat& image); virtual ~GFitsImageFloat(void); // Operators - GFitsImageFloat& operator= (const GFitsImageFloat& image); - float& operator() (const int& ix); - float& operator() (const int& ix, const int& iy); - float& operator() (const int& ix, const int& iy, const int& iz); - float& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const float& operator() (const int& ix) const; - const float& operator() (const int& ix, const int& iy) const; - const float& operator() (const int& ix, const int& iy, const int& iz) const; - const float& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageFloat& operator=(const GFitsImageFloat& image); + float& operator()(const int& ix); + float& operator()(const int& ix, const int& iy); + float& operator()(const int& ix, const int& iy, const int& iz); + float& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const float& operator()(const int& ix) const; + const float& operator()(const int& ix, const int& iy) const; + const float& operator()(const int& ix, const int& iy, const int& iz) const; + const float& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageLong.hpp b/include/GFitsImageLong.hpp index a19b50a..726dfb4 100644 --- a/include/GFitsImageLong.hpp +++ b/include/GFitsImageLong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLong.hpp - FITS long integer image class * + * GFitsImageLong.hpp - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,8 +20,8 @@ ***************************************************************************/ /** * @file GFitsImageLong.hpp - * @brief GFitsImageLong class definition. - * @author J. Knoedlseder + * @brief Long integer FITS image class definition + * @author Juergen Knoedlseder */ #ifndef GFITSIMAGELONG_HPP @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageLong * - * @brief Implements a FITS long integer image + * @brief Long integer FITS image class ***************************************************************************/ class GFitsImageLong : public GFitsImage { public: // Constructors and destructors GFitsImageLong(void); - explicit GFitsImageLong(int nx, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, int nz, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, int nz, int nt, const long* pixels = NULL); - explicit GFitsImageLong(int naxis, const int* naxes, const long* pixels = NULL); + GFitsImageLong(const int& nx, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL); + GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL); GFitsImageLong(const GFitsImageLong& image); virtual ~GFitsImageLong(void); // Operators - GFitsImageLong& operator= (const GFitsImageLong& image); - long& operator() (const int& ix); - long& operator() (const int& ix, const int& iy); - long& operator() (const int& ix, const int& iy, const int& iz); - long& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const long& operator() (const int& ix) const; - const long& operator() (const int& ix, const int& iy) const; - const long& operator() (const int& ix, const int& iy, const int& iz) const; - const long& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageLong& operator=(const GFitsImageLong& image); + long& operator()(const int& ix); + long& operator()(const int& ix, const int& iy); + long& operator()(const int& ix, const int& iy, const int& iz); + long& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const long& operator()(const int& ix) const; + const long& operator()(const int& ix, const int& iy) const; + const long& operator()(const int& ix, const int& iy, const int& iz) const; + const long& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageLongLong.hpp b/include/GFitsImageLongLong.hpp index ea93817..d861c74 100644 --- a/include/GFitsImageLongLong.hpp +++ b/include/GFitsImageLongLong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLongLong.hpp - FITS long long integer image class * + * GFitsImageLongLong.hpp - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageLongLong.hpp - * @brief GFitsImageLongLong class definition. + * @brief Long long integer FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageLongLong * - * @brief Implements a FITS long long integer image + * @brief Long long integer FITS image class ***************************************************************************/ class GFitsImageLongLong : public GFitsImage { public: // Constructors and destructors GFitsImageLongLong(void); - explicit GFitsImageLongLong(int nx, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, int nz, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, int nz, int nt, const long long* pixels = NULL); - explicit GFitsImageLongLong(int naxis, const int* naxes, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL); + GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL); GFitsImageLongLong(const GFitsImageLongLong& image); virtual ~GFitsImageLongLong(void); // Operators - GFitsImageLongLong& operator= (const GFitsImageLongLong& image); - long long& operator() (const int& ix); - long long& operator() (const int& ix, const int& iy); - long long& operator() (const int& ix, const int& iy, const int& iz); - long long& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const long long& operator() (const int& ix) const; - const long long& operator() (const int& ix, const int& iy) const; - const long long& operator() (const int& ix, const int& iy, const int& iz) const; - const long long& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageLongLong& operator=(const GFitsImageLongLong& image); + long long& operator()(const int& ix); + long long& operator()(const int& ix, const int& iy); + long long& operator()(const int& ix, const int& iy, const int& iz); + long long& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const long long& operator()(const int& ix) const; + const long long& operator()(const int& ix, const int& iy) const; + const long long& operator()(const int& ix, const int& iy, const int& iz) const; + const long long& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageSByte.hpp b/include/GFitsImageSByte.hpp index 3fd5ac3..afad68c 100644 --- a/include/GFitsImageSByte.hpp +++ b/include/GFitsImageSByte.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageSByte.hpp - FITS signed Byte image class * + * GFitsImageSByte.hpp - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageSByte.hpp - * @brief GFitsImageSByte class definition. + * @brief Signed Byte FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageSByte * - * @brief Implements a FITS signed Byte image + * @brief Signed Byte FITS image class ***************************************************************************/ class GFitsImageSByte : public GFitsImage { public: // Constructors and destructors GFitsImageSByte(void); - explicit GFitsImageSByte(int nx, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, int nz, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, int nz, int nt, const char* pixels = NULL); - explicit GFitsImageSByte(int naxis, const int* naxes, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL); + GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL); GFitsImageSByte(const GFitsImageSByte& image); virtual ~GFitsImageSByte(void); // Operators - GFitsImageSByte& operator= (const GFitsImageSByte& image); - char& operator() (const int& ix); - char& operator() (const int& ix, const int& iy); - char& operator() (const int& ix, const int& iy, const int& iz); - char& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const char& operator() (const int& ix) const; - const char& operator() (const int& ix, const int& iy) const; - const char& operator() (const int& ix, const int& iy, const int& iz) const; - const char& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageSByte& operator=(const GFitsImageSByte& image); + char& operator()(const int& ix); + char& operator()(const int& ix, const int& iy); + char& operator()(const int& ix, const int& iy, const int& iz); + char& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const char& operator()(const int& ix) const; + const char& operator()(const int& ix, const int& iy) const; + const char& operator()(const int& ix, const int& iy, const int& iz) const; + const char& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageShort.hpp b/include/GFitsImageShort.hpp index 5be4b51..965fe87 100644 --- a/include/GFitsImageShort.hpp +++ b/include/GFitsImageShort.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageShort.hpp - FITS short integer image class * + * GFitsImageShort.hpp - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageShort.hpp - * @brief GFitsImageShort class definition. + * @brief Short integer FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageShort * - * @brief Implements a FITS short integer image + * @brief Short integer FITS image class ***************************************************************************/ class GFitsImageShort : public GFitsImage { public: // Constructors and destructors GFitsImageShort(void); - explicit GFitsImageShort(int nx, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, int nz, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, int nz, int nt, const short* pixels = NULL); - explicit GFitsImageShort(int naxis, const int* naxes, const short* pixels = NULL); + GFitsImageShort(const int& nx, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL); + GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL); GFitsImageShort(const GFitsImageShort& image); virtual ~GFitsImageShort(void); // Operators - GFitsImageShort& operator= (const GFitsImageShort& image); - short& operator() (const int& ix); - short& operator() (const int& ix, const int& iy); - short& operator() (const int& ix, const int& iy, const int& iz); - short& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const short& operator() (const int& ix) const; - const short& operator() (const int& ix, const int& iy) const; - const short& operator() (const int& ix, const int& iy, const int& iz) const; - const short& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageShort& operator=(const GFitsImageShort& image); + short& operator()(const int& ix); + short& operator()(const int& ix, const int& iy); + short& operator()(const int& ix, const int& iy, const int& iz); + short& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const short& operator()(const int& ix) const; + const short& operator()(const int& ix, const int& iy) const; + const short& operator()(const int& ix, const int& iy, const int& iz) const; + const short& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageULong.hpp b/include/GFitsImageULong.hpp index 9460aa2..1ab4b9c 100644 --- a/include/GFitsImageULong.hpp +++ b/include/GFitsImageULong.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageULong.hpp - FITS unsigned long image class * + * GFitsImageULong.hpp - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageULong.hpp - * @brief GFitsImageULong class definition. + * @brief Unsigned long image FITS class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageULong * - * @brief Implements a FITS unsigned long integer image + * @brief Unsigned long image FITS class ***************************************************************************/ class GFitsImageULong : public GFitsImage { public: // Constructors and destructors GFitsImageULong(void); - explicit GFitsImageULong(int nx, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, int nz, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, int nz, int nt, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int naxis, const int* naxes, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL); + GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL); GFitsImageULong(const GFitsImageULong& image); virtual ~GFitsImageULong(void); // Operators - GFitsImageULong& operator= (const GFitsImageULong& image); - unsigned long& operator() (const int& ix); - unsigned long& operator() (const int& ix, const int& iy); - unsigned long& operator() (const int& ix, const int& iy, const int& iz); - unsigned long& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const unsigned long& operator() (const int& ix) const; - const unsigned long& operator() (const int& ix, const int& iy) const; - const unsigned long& operator() (const int& ix, const int& iy, const int& iz) const; - const unsigned long& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageULong& operator=(const GFitsImageULong& image); + unsigned long& operator()(const int& ix); + unsigned long& operator()(const int& ix, const int& iy); + unsigned long& operator()(const int& ix, const int& iy, const int& iz); + unsigned long& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const unsigned long& operator()(const int& ix) const; + const unsigned long& operator()(const int& ix, const int& iy) const; + const unsigned long& operator()(const int& ix, const int& iy, const int& iz) const; + const unsigned long& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/include/GFitsImageUShort.hpp b/include/GFitsImageUShort.hpp index 939a671..7396c32 100644 --- a/include/GFitsImageUShort.hpp +++ b/include/GFitsImageUShort.hpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageUShort.hpp - FITS unsigned short image class * + * GFitsImageUShort.hpp - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageUShort.hpp - * @brief GFitsImageUShort class definition. + * @brief Unsigned short FITS image class definition * @author Juergen Knoedlseder */ @@ -34,31 +34,31 @@ /***********************************************************************//** * @class GFitsImageUShort * - * @brief Implements a FITS unsigned short integer image + * @brief Unsigned short FITS image class ***************************************************************************/ class GFitsImageUShort : public GFitsImage { public: // Constructors and destructors GFitsImageUShort(void); - explicit GFitsImageUShort(int nx, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, int nz, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, int nz, int nt, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int naxis, const int* naxes, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL); GFitsImageUShort(const GFitsImageUShort& image); virtual ~GFitsImageUShort(void); // Operators - GFitsImageUShort& operator= (const GFitsImageUShort& image); - unsigned short& operator() (const int& ix); - unsigned short& operator() (const int& ix, const int& iy); - unsigned short& operator() (const int& ix, const int& iy, const int& iz); - unsigned short& operator() (const int& ix, const int& iy, const int& iz, const int& it); - const unsigned short& operator() (const int& ix) const; - const unsigned short& operator() (const int& ix, const int& iy) const; - const unsigned short& operator() (const int& ix, const int& iy, const int& iz) const; - const unsigned short& operator() (const int& ix, const int& iy, const int& iz, const int& it) const; + GFitsImageUShort& operator=(const GFitsImageUShort& image); + unsigned short& operator()(const int& ix); + unsigned short& operator()(const int& ix, const int& iy); + unsigned short& operator()(const int& ix, const int& iy, const int& iz); + unsigned short& operator()(const int& ix, const int& iy, const int& iz, const int& it); + const unsigned short& operator()(const int& ix) const; + const unsigned short& operator()(const int& ix, const int& iy) const; + const unsigned short& operator()(const int& ix, const int& iy, const int& iz) const; + const unsigned short& operator()(const int& ix, const int& iy, const int& iz, const int& it) const; // Methods void clear(void); diff --git a/pyext/GFitsImage.i b/pyext/GFitsImage.i index 7b77ca5..14659f9 100644 --- a/pyext/GFitsImage.i +++ b/pyext/GFitsImage.i @@ -1,5 +1,5 @@ /*************************************************************************** - * GFitsImage.i - FITS abstract image base class * + * GFitsImage.i - Abstract FITS image base class * * ----------------------------------------------------------------------- * * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImage.i - * @brief GFitsImage class SWIG file. + * @brief Abstract FITS image base class definition * @author Juergen Knoedlseder */ %{ @@ -90,16 +90,17 @@ static int image_pixel_tuple(PyObject *input, int *ptr) { /***********************************************************************//** * @class GFitsImage * - * @brief Abstract SWIG interface for the FITS image classes. + * @brief Abstract FITS image base class ***************************************************************************/ class GFitsImage : public GFitsHDU { public: // Constructors and destructors GFitsImage(void); - explicit GFitsImage(int bitpix, int nx); - explicit GFitsImage(int bitpix, int nx, int ny); - explicit GFitsImage(int bitpix, int nx, int ny, int nz); - explicit GFitsImage(int bitpix, int nx, int ny, int nz, int nt); + GFitsImage(const int& bitpix, const int& nx); + GFitsImage(const int& bitpix, const int& nx, const int& ny); + GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz); + GFitsImage(const int& bitpix, const int& nx, const int& ny, const int& nz, const int& nt); + GFitsImage(const int& bitpix, const int& naxis, const int* naxes); GFitsImage(const GFitsImage& image); virtual ~GFitsImage(void); @@ -114,16 +115,16 @@ public: virtual int type(void) const = 0; // Implemented pure virtual methods - HDUType exttype(void) const { return HT_IMAGE; } + HDUType exttype(void) const; - // Methods - int size(void) const; - int bitpix(void) const; - int naxis(void) const; - int naxes(int axis) const; - int anynul(void) const; - void nulval(const void* value); - void* nulval(void); + // Base class methods + const int& size(void) const; + const int& bitpix(void) const; + const int& naxis(void) const; + int naxes(const int& axis) const; + const int& anynul(void) const; + void nulval(const void* value); + const void* nulval(void) const; }; diff --git a/pyext/GFitsImageByte.i b/pyext/GFitsImageByte.i index e1152b1..c96736b 100644 --- a/pyext/GFitsImageByte.i +++ b/pyext/GFitsImageByte.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageByte.i - FITS Byte image class SWIG interface * + * GFitsImageByte.i - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageByte.i - * @brief GFitsImageByte class SWIG file. + * @brief FITS Byte image class definition * @author Juergen Knoedlseder */ %{ @@ -32,17 +32,17 @@ /***********************************************************************//** * @class GFitsImageByte * - * @brief SWIG interface for the FITS Byte image class. + * @brief FITS Byte image class ***************************************************************************/ class GFitsImageByte : public GFitsImage { - public: // Constructors and destructors GFitsImageByte(void); - explicit GFitsImageByte(int nx, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, int nz, const unsigned char* pixels = NULL); - explicit GFitsImageByte(int nx, int ny, int nz, int nt, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels = NULL); + GFitsImageByte(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned char* pixels = NULL); + GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels = NULL); GFitsImageByte(const GFitsImageByte& image); virtual ~GFitsImageByte(void); diff --git a/pyext/GFitsImageDouble.i b/pyext/GFitsImageDouble.i index 951a538..7eee50f 100644 --- a/pyext/GFitsImageDouble.i +++ b/pyext/GFitsImageDouble.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageDouble.i - FITS double precision image class SWIG interface * + * GFitsImageDouble.i - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageDouble.i - * @brief GFitsImageDouble class SWIG file. + * @brief Double precision FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageDouble * - * @brief SWIG interface for the FITS double precision image class. + * @brief Double precision FITS image class ***************************************************************************/ class GFitsImageDouble : public GFitsImage { - public: // Constructors and destructors GFitsImageDouble(void); - explicit GFitsImageDouble(int nx, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, int nz, const double* pixels = NULL); - explicit GFitsImageDouble(int nx, int ny, int nz, int nt, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels = NULL); + GFitsImageDouble(const int& nx, const int& ny, const int& nz, const int& nt, const double* pixels = NULL); + GFitsImageDouble(const int& naxis, const int* naxes, const double* pixels = NULL); GFitsImageDouble(const GFitsImageDouble& image); virtual ~GFitsImageDouble(void); diff --git a/pyext/GFitsImageFloat.i b/pyext/GFitsImageFloat.i index cf5ca09..172e1c4 100644 --- a/pyext/GFitsImageFloat.i +++ b/pyext/GFitsImageFloat.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageFloat.i - FITS single precision image class SWIG interface * + * GFitsImageFloat.i - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageFloat.i - * @brief GFitsImageFloat class SWIG file. + * @brief Single precision FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageFloat * - * @brief SWIG interface for the FITS single precision image class. + * @brief Single precision FITS image class ***************************************************************************/ class GFitsImageFloat : public GFitsImage { - public: // Constructors and destructors GFitsImageFloat(void); - explicit GFitsImageFloat(int nx, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, int nz, const float* pixels = NULL); - explicit GFitsImageFloat(int nx, int ny, int nz, int nt, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels = NULL); + GFitsImageFloat(const int& nx, const int& ny, const int& nz, const int& nt, const float* pixels = NULL); + GFitsImageFloat(const int& naxis, const int* naxes, const float* pixels = NULL); GFitsImageFloat(const GFitsImageFloat& image); virtual ~GFitsImageFloat(void); diff --git a/pyext/GFitsImageLong.i b/pyext/GFitsImageLong.i index 540533a..4cc8fae 100644 --- a/pyext/GFitsImageLong.i +++ b/pyext/GFitsImageLong.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLong.i - FITS long integer image class SWIG interface * + * GFitsImageLong.i - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageLong.i - * @brief GFitsImageLong class SWIG file. + * @brief Long integer FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageLong * - * @brief SWIG interface for the FITS long integer image class. + * @brief Long integer FITS image class ***************************************************************************/ class GFitsImageLong : public GFitsImage { - public: // Constructors and destructors GFitsImageLong(void); - explicit GFitsImageLong(int nx, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, int nz, const long* pixels = NULL); - explicit GFitsImageLong(int nx, int ny, int nz, int nt, const long* pixels = NULL); + GFitsImageLong(const int& nx, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels = NULL); + GFitsImageLong(const int& nx, const int& ny, const int& nz, const int& nt, const long* pixels = NULL); + GFitsImageLong(const int& naxis, const int* naxes, const long* pixels = NULL); GFitsImageLong(const GFitsImageLong& image); virtual ~GFitsImageLong(void); diff --git a/pyext/GFitsImageLongLong.i b/pyext/GFitsImageLongLong.i index 886b7cb..ba6f857 100644 --- a/pyext/GFitsImageLongLong.i +++ b/pyext/GFitsImageLongLong.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLongLong.i - FITS long long image class SWIG interface * + * GFitsImageLongLong.i - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageLongLong.i - * @brief GFitsImageLongLong class SWIG file. + * @brief Long long integer FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -36,14 +36,14 @@ * @brief SWIG interface for the FITS long long image class. ***************************************************************************/ class GFitsImageLongLong : public GFitsImage { - public: // Constructors and destructors GFitsImageLongLong(void); - explicit GFitsImageLongLong(int nx, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, int nz, const long long* pixels = NULL); - explicit GFitsImageLongLong(int nx, int ny, int nz, int nt, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const long long* pixels = NULL); + GFitsImageLongLong(const int& nx, const int& ny, const int& nz, const int& nt, const long long* pixels = NULL); + GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels = NULL); GFitsImageLongLong(const GFitsImageLongLong& image); virtual ~GFitsImageLongLong(void); diff --git a/pyext/GFitsImageSByte.i b/pyext/GFitsImageSByte.i index a204841..bb0cc72 100644 --- a/pyext/GFitsImageSByte.i +++ b/pyext/GFitsImageSByte.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageSByte.i - FITS signed Byte image class SWIG interface * + * GFitsImageSByte.i - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageSByte.i - * @brief GFitsImageSByte class SWIG file. + * @brief Signed Byte FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageSByte * - * @brief SWIG interface for the FITS signed Byte image class. + * @brief Signed Byte FITS image class ***************************************************************************/ class GFitsImageSByte : public GFitsImage { - public: // Constructors and destructors GFitsImageSByte(void); - explicit GFitsImageSByte(int nx, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, int nz, const char* pixels = NULL); - explicit GFitsImageSByte(int nx, int ny, int nz, int nt, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const int& nz, const char* pixels = NULL); + GFitsImageSByte(const int& nx, const int& ny, const int& nz, const int& nt, const char* pixels = NULL); + GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels = NULL); GFitsImageSByte(const GFitsImageSByte& image); virtual ~GFitsImageSByte(void); diff --git a/pyext/GFitsImageShort.i b/pyext/GFitsImageShort.i index 825f531..4e424b9 100644 --- a/pyext/GFitsImageShort.i +++ b/pyext/GFitsImageShort.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageShort.i - FITS short integer image class SWIG interface * + * GFitsImageShort.i - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageShort.i - * @brief GFitsImageShort class SWIG file. + * @brief Short integer FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageShort * - * @brief SWIG interface for the FITS short integer image class. + * @brief Short integer FITS image class ***************************************************************************/ class GFitsImageShort : public GFitsImage { - public: // Constructors and destructors GFitsImageShort(void); - explicit GFitsImageShort(int nx, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, int nz, const short* pixels = NULL); - explicit GFitsImageShort(int nx, int ny, int nz, int nt, const short* pixels = NULL); + GFitsImageShort(const int& nx, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels = NULL); + GFitsImageShort(const int& nx, const int& ny, const int& nz, const int& nt, const short* pixels = NULL); + GFitsImageShort(const int& naxis, const int* naxes, const short* pixels = NULL); GFitsImageShort(const GFitsImageShort& image); virtual ~GFitsImageShort(void); diff --git a/pyext/GFitsImageULong.i b/pyext/GFitsImageULong.i index 0ff7702..960a89e 100644 --- a/pyext/GFitsImageULong.i +++ b/pyext/GFitsImageULong.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageULong.i - FITS unsigned long image class SWIG interface * + * GFitsImageULong.i - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageULong.i - * @brief GFitsImageULong class SWIG file. + * @brief Unsigned long image FITS class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,17 @@ /***********************************************************************//** * @class GFitsImageULong * - * @brief SWIG interface for the FITS unsigned long image class. + * @brief Unsigned long image FITS class ***************************************************************************/ class GFitsImageULong : public GFitsImage { - public: // Constructors and destructors GFitsImageULong(void); - explicit GFitsImageULong(int nx, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, int nz, const unsigned long* pixels = NULL); - explicit GFitsImageULong(int nx, int ny, int nz, int nt, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels = NULL); + GFitsImageULong(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned long* pixels = NULL); + GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels = NULL); GFitsImageULong(const GFitsImageULong& image); virtual ~GFitsImageULong(void); diff --git a/pyext/GFitsImageUShort.i b/pyext/GFitsImageUShort.i index 321299b..d40001c 100644 --- a/pyext/GFitsImageUShort.i +++ b/pyext/GFitsImageUShort.i @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageUShort.i - FITS unsigned short image class SWIG interface * + * GFitsImageUShort.i - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageUShort.i - * @brief GFitsImageUShort class SWIG file. + * @brief Unsigned short FITS image class definition * @author Juergen Knoedlseder */ %{ @@ -33,17 +33,18 @@ /***********************************************************************//** * @class GFitsImageUShort * - * @brief SWIG interface for the FITS unsigned short image class. + * @brief Unsigned short FITS image class ***************************************************************************/ class GFitsImageUShort : public GFitsImage { public: // Constructors and destructors GFitsImageUShort(void); - explicit GFitsImageUShort(int nx, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, int nz, const unsigned short* pixels = NULL); - explicit GFitsImageUShort(int nx, int ny, int nz, int nt, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& nx, const int& ny, const int& nz, const int& nt, const unsigned short* pixels = NULL); + GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels = NULL); GFitsImageUShort(const GFitsImageUShort& image); virtual ~GFitsImageUShort(void); diff --git a/src/fits/GFitsAsciiTable.cpp b/src/fits/GFitsAsciiTable.cpp index 34b2a93..ed562d7 100644 --- a/src/fits/GFitsAsciiTable.cpp +++ b/src/fits/GFitsAsciiTable.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsAsciiTable.cpp - FITS ASCII table class * + * GFitsAsciiTable.cpp - FITS ASCII table class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -44,7 +44,7 @@ ==========================================================================*/ /***********************************************************************//** - * @brief Constructor + * @brief Void constructor ***************************************************************************/ GFitsAsciiTable::GFitsAsciiTable(void) : GFitsTable() { @@ -57,11 +57,11 @@ GFitsAsciiTable::GFitsAsciiTable(void) : GFitsTable() /***********************************************************************//** - * @brief Constructor + * @brief Table constructor * * @param[in] nrows Number of rows in table. ***************************************************************************/ -GFitsAsciiTable::GFitsAsciiTable(int nrows) : GFitsTable(nrows) +GFitsAsciiTable::GFitsAsciiTable(const int& nrows) : GFitsTable(nrows) { // Initialise class members for clean destruction init_members(); @@ -74,7 +74,7 @@ GFitsAsciiTable::GFitsAsciiTable(int nrows) : GFitsTable(nrows) /***********************************************************************//** * @brief Copy constructor * - * @param[in] table Table. + * @param[in] table ASCII table. ***************************************************************************/ GFitsAsciiTable::GFitsAsciiTable(const GFitsAsciiTable& table) : GFitsTable(table) { @@ -111,7 +111,8 @@ GFitsAsciiTable::~GFitsAsciiTable() /***********************************************************************//** * @brief Assignment operator * - * @param[in] table Table. + * @param[in] table ASCII table. + * @return ASCII table. ***************************************************************************/ GFitsAsciiTable& GFitsAsciiTable::operator=(const GFitsAsciiTable& table) { @@ -144,7 +145,7 @@ GFitsAsciiTable& GFitsAsciiTable::operator=(const GFitsAsciiTable& table) ==========================================================================*/ /***********************************************************************//** - * @brief Clear instance + * @brief Clear ASCII table * * This method properly resets the object to an initial state. ***************************************************************************/ @@ -167,6 +168,8 @@ void GFitsAsciiTable::clear(void) /***********************************************************************//** * @brief Clone ASCII table + * + * @return Pointer to deep copy of ASCII table. ***************************************************************************/ GFitsAsciiTable* GFitsAsciiTable::clone(void) const { diff --git a/src/fits/GFitsBinTable.cpp b/src/fits/GFitsBinTable.cpp index ac450aa..4284068 100644 --- a/src/fits/GFitsBinTable.cpp +++ b/src/fits/GFitsBinTable.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsBinTable.cpp - FITS binary table class * + * GFitsBinTable.cpp - FITS binary table class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -48,7 +48,7 @@ ==========================================================================*/ /***********************************************************************//** - * @brief Constructor + * @brief Void constructor ***************************************************************************/ GFitsBinTable::GFitsBinTable(void) : GFitsTable() { @@ -61,11 +61,11 @@ GFitsBinTable::GFitsBinTable(void) : GFitsTable() /***********************************************************************//** - * @brief Constructor + * @brief Table constructor * * @param[in] nrows Number of rows in table ***************************************************************************/ -GFitsBinTable::GFitsBinTable(int nrows) : GFitsTable(nrows) +GFitsBinTable::GFitsBinTable(const int& nrows) : GFitsTable(nrows) { // Initialise class members for clean destruction init_members(); @@ -78,8 +78,7 @@ GFitsBinTable::GFitsBinTable(int nrows) : GFitsTable(nrows) /***********************************************************************//** * @brief Copy constructor * - * @param[in] table Table which will be used to construct GFitsBinTable - * instance + * @param[in] table Binary table. ***************************************************************************/ GFitsBinTable::GFitsBinTable(const GFitsBinTable& table) : GFitsTable(table) { @@ -116,7 +115,8 @@ GFitsBinTable::~GFitsBinTable(void) /***********************************************************************//** * @brief Assignment operator * - * @param[in] table Table which will be assigned + * @param[in] table Binary table. + * @return Binary table. ***************************************************************************/ GFitsBinTable& GFitsBinTable::operator=(const GFitsBinTable& table) { @@ -149,7 +149,7 @@ GFitsBinTable& GFitsBinTable::operator=(const GFitsBinTable& table) ==========================================================================*/ /***********************************************************************//** - * @brief Clear instance + * @brief Clear binary table * * This method properly resets the object to an initial state. ***************************************************************************/ @@ -172,6 +172,8 @@ void GFitsBinTable::clear(void) /***********************************************************************//** * @brief Clone binary table + * + * @return Pointer to deep copy of binary table. ***************************************************************************/ GFitsBinTable* GFitsBinTable::clone(void) const { diff --git a/src/fits/GFitsImage.cpp b/src/fits/GFitsImage.cpp index 5554436..676c84b 100644 --- a/src/fits/GFitsImage.cpp +++ b/src/fits/GFitsImage.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - * GFitsImage.cpp - FITS image class * + * GFitsImage.cpp - Abstract FITS image base class * * ----------------------------------------------------------------------- * * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImage.cpp - * @brief FITS image class implementation + * @brief Abstract FITS image base class implementation * @author Juergen Knoedlseder */ @@ -82,7 +82,7 @@ GFitsImage::GFitsImage(void) : GFitsHDU() * Construct 1D instance of GFitsImage by specifying the number of pixels. * This method also adds the relevant header cards. ***************************************************************************/ -GFitsImage::GFitsImage(int bitpix, int nx) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const int& nx) : GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -116,7 +116,8 @@ GFitsImage::GFitsImage(int bitpix, int nx) : GFitsHDU() * Construct 2D instance of GFitsImage by specifying the number of pixels * in each dimension. This method also adds the relevant header cards. ***************************************************************************/ -GFitsImage::GFitsImage(int bitpix, int nx, int ny) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const int& nx, const int& ny) : + GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -152,7 +153,8 @@ GFitsImage::GFitsImage(int bitpix, int nx, int ny) : GFitsHDU() * Construct 3D instance of GFitsImage by specifying the number of pixels * in each dimension. This method also adds the relevant header cards. ***************************************************************************/ -GFitsImage::GFitsImage(int bitpix, int nx, int ny, int nz) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const int& nx, const int& ny, + const int& nz) : GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -190,7 +192,8 @@ GFitsImage::GFitsImage(int bitpix, int nx, int ny, int nz) : GFitsHDU() * Construct 4D instance of GFitsImage by specifying the number of pixels * in each dimension. This method also adds the relevant header cards. ***************************************************************************/ -GFitsImage::GFitsImage(int bitpix, int nx, int ny, int nz, int nt) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const int& nx, const int& ny, + const int& nz, const int& nt) : GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -221,14 +224,15 @@ GFitsImage::GFitsImage(int bitpix, int nx, int ny, int nz, int nt) : GFitsHDU() * @brief Constructor * * @param[in] bitpix Number of Bits per pixel (negative is floating point). - * @param[in] naxis Image dimensions (0,1,2,3,4). - * @param[in] naxes Number of pixels in each dimension. + * @param[in] naxis Image dimensions [0,1,2,3,4]. + * @param[in] naxes Pointer to array giving number of pixels in each dimension. * * Construct instance of GFitsImage by specifying the image dimension and * the number of pixels in each dimension. This method also adds the relevant * header cards. ***************************************************************************/ -GFitsImage::GFitsImage(int bitpix, int naxis, const int* naxes) : GFitsHDU() +GFitsImage::GFitsImage(const int& bitpix, const int& naxis, + const int* naxes) : GFitsHDU() { // Initialise class members for clean destruction init_members(); @@ -261,7 +265,7 @@ GFitsImage::GFitsImage(int bitpix, int naxis, const int* naxes) : GFitsHDU() /***********************************************************************//** * @brief Copy constructor * - * @param[in] image FITS image which should be used for construction. + * @param[in] image FITS image. ***************************************************************************/ GFitsImage::GFitsImage(const GFitsImage& image) : GFitsHDU(image) { @@ -298,9 +302,10 @@ GFitsImage::~GFitsImage(void) /***********************************************************************//** * @brief Assignment operator * - * @param[in] image FITS image to be assigned + * @param[in] image FITS image. + * @return FITS image. ***************************************************************************/ -GFitsImage& GFitsImage::operator= (const GFitsImage& image) +GFitsImage& GFitsImage::operator=(const GFitsImage& image) { // Execute only if object is not identical if (this != &image) { @@ -331,49 +336,19 @@ GFitsImage& GFitsImage::operator= (const GFitsImage& image) ==========================================================================*/ /***********************************************************************//** - * @brief Return size of pixel array - ***************************************************************************/ -int GFitsImage::size(void) const -{ - // Return number of pixels - return m_num_pixels; -} - - -/***********************************************************************//** - * @brief Return number of Bits per pixel (negative=floating point) - ***************************************************************************/ -int GFitsImage::bitpix(void) const -{ - // Return number of Bits per pixel - return m_bitpix; -} - - -/***********************************************************************//** - * @brief Return dimension of image - ***************************************************************************/ -int GFitsImage::naxis(void) const -{ - // Return dimension - return m_naxis; -} - - -/***********************************************************************//** * @brief Return dimension of an image axis * - * @param[in] axis Image axis (starting from 0). + * @param[in] axis Image axis [0,...,naxis()-1]. * * @exception GException::out_of_range * Image axis not valid. ***************************************************************************/ -int GFitsImage::naxes(int axis) const +int GFitsImage::naxes(const int& axis) const { // Check if axis is within the range #if defined(G_RANGE_CHECK) - if (axis < 0 || axis >= m_naxis) { - throw GException::out_of_range(G_NAXES, axis, 0, m_naxis-1); + if (axis < 0 || axis >= naxis()) { + throw GException::out_of_range(G_NAXES, "Image axis", axis, naxis()); } #endif @@ -386,16 +361,6 @@ int GFitsImage::naxes(int axis) const /***********************************************************************//** - * @brief Return number of nul values envountered during loading - ***************************************************************************/ -int GFitsImage::anynul(void) const -{ - // Return number of nul values - return m_anynul; -} - - -/***********************************************************************//** * @brief Set nul value * * @param[in] value Nul value. @@ -411,7 +376,8 @@ void GFitsImage::nulval(const void* value) // Allocate nul value alloc_nulval(value); - // Update column + // Update image + //TODO // Return return; @@ -419,16 +385,6 @@ void GFitsImage::nulval(const void* value) /***********************************************************************//** - * @brief Return nul value - ***************************************************************************/ -void* GFitsImage::nulval(void) -{ - // Return - return (ptr_nulval()); -} - - -/***********************************************************************//** * @brief Print column information * * @param[in] chatter Chattiness (defaults to NORMAL). @@ -453,12 +409,15 @@ std::string GFitsImage::print(const GChatter& chatter) const result.append("\n"+print_hdu(chatter)); // Append image dimensions - result.append("\n"+gammalib::parformat("Image type")+typecode(type())); - result.append("\n"+gammalib::parformat("Number of dimensions")+gammalib::str(naxis())); - result.append("\n"+gammalib::parformat("Number of image pixels")+gammalib::str(size())); + result.append("\n"+gammalib::parformat("Image type")); + result.append(typecode(type())); + result.append("\n"+gammalib::parformat("Number of dimensions")); + result.append(gammalib::str(naxis())); + result.append("\n"+gammalib::parformat("Number of image pixels")); + result.append(gammalib::str(size())); for (int i = 0; i < naxis(); ++i) { - result.append("\n"+gammalib::parformat("Number of bins in "+gammalib::str(i)) + - gammalib::str(naxes(i))); + result.append("\n"+gammalib::parformat("Number of bins in "+gammalib::str(i))); + result.append(gammalib::str(naxes(i))); } // NORMAL: Append header information @@ -480,6 +439,66 @@ std::string GFitsImage::print(const GChatter& chatter) const ==========================================================================*/ /***********************************************************************//** + * @brief Initialise class members + ***************************************************************************/ +void GFitsImage::init_members(void) +{ + // Initialise members + m_bitpix = 8; + m_naxis = 0; + m_naxes = NULL; + m_num_pixels = 0; + m_anynul = 0; + + // Return + return; +} + + +/***********************************************************************//** + * @brief Copy class members + * + * @param[in] image FITS image to copy + ***************************************************************************/ +void GFitsImage::copy_members(const GFitsImage& image) +{ + // Copy attributes + m_bitpix = image.m_bitpix; + m_naxis = image.m_naxis; + m_num_pixels = image.m_num_pixels; + m_anynul = image.m_anynul; + + // Copy axes + m_naxes = NULL; + if (image.m_naxes != NULL && m_naxis > 0) { + m_naxes = new long[m_naxis]; + for (int i = 0; i < m_naxis; ++i) { + m_naxes[i] = image.m_naxes[i]; + } + } + + // Return + return; +} + + +/***********************************************************************//** + * @brief Delete class members + ***************************************************************************/ +void GFitsImage::free_members(void) +{ + // Free memory + if (m_naxes != NULL) delete [] m_naxes; + + // Mark memory as free + m_naxes = NULL; + + // Return + return; +} + + +/***********************************************************************//** * @brief Open FITS image * * @param[in] vptr FITS file pointer @@ -953,69 +972,3 @@ int GFitsImage::offset(const int& ix, const int& iy, const int& iz, // Return offset return (ix + m_naxes[0] * (iy + m_naxes[1] * (iz + it * m_naxes[2]))); } - - -/*========================================================================== - = = - = Private methods = - = = - ==========================================================================*/ - -/***********************************************************************//** - * @brief Initialise class members - ***************************************************************************/ -void GFitsImage::init_members(void) -{ - // Initialise members - m_bitpix = 8; - m_naxis = 0; - m_naxes = NULL; - m_num_pixels = 0; - m_anynul = 0; - - // Return - return; -} - - -/***********************************************************************//** - * @brief Copy class members - * - * @param[in] image FITS image to copy - ***************************************************************************/ -void GFitsImage::copy_members(const GFitsImage& image) -{ - // Copy attributes - m_bitpix = image.m_bitpix; - m_naxis = image.m_naxis; - m_num_pixels = image.m_num_pixels; - m_anynul = image.m_anynul; - - // Copy axes - m_naxes = NULL; - if (image.m_naxes != NULL && m_naxis > 0) { - m_naxes = new long[m_naxis]; - for (int i = 0; i < m_naxis; ++i) { - m_naxes[i] = image.m_naxes[i]; - } - } - - // Return - return; -} - - -/***********************************************************************//** - * @brief Delete class members - ***************************************************************************/ -void GFitsImage::free_members(void) -{ - // Free memory - if (m_naxes != NULL) delete [] m_naxes; - - // Mark memory as free - m_naxes = NULL; - - // Return - return; -} diff --git a/src/fits/GFitsImageByte.cpp b/src/fits/GFitsImageByte.cpp index 03fe88b..da42abd 100644 --- a/src/fits/GFitsImageByte.cpp +++ b/src/fits/GFitsImageByte.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageByte.cpp - FITS Byte image class * + * GFitsImageByte.cpp - FITS Byte image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -70,7 +70,7 @@ GFitsImageByte::GFitsImageByte(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(int nx, const unsigned char* pixels) : +GFitsImageByte::GFitsImageByte(const int& nx, const unsigned char* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -93,7 +93,8 @@ GFitsImageByte::GFitsImageByte(int nx, const unsigned char* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(int nx, int ny, const unsigned char* pixels) : +GFitsImageByte::GFitsImageByte(const int& nx, const int& ny, + const unsigned char* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -117,7 +118,7 @@ GFitsImageByte::GFitsImageByte(int nx, int ny, const unsigned char* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(int nx, int ny, int nz, +GFitsImageByte::GFitsImageByte(const int& nx, const int& ny, const int& nz, const unsigned char* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -143,8 +144,8 @@ GFitsImageByte::GFitsImageByte(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(int nx, int ny, int nz, int nt, - const unsigned char* pixels) : +GFitsImageByte::GFitsImageByte(const int& nx, const int& ny, const int& nz, + const int& nt, const unsigned char* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { // Initialise class members for clean destruction @@ -169,7 +170,7 @@ GFitsImageByte::GFitsImageByte(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageByte::GFitsImageByte(int naxis, const int* naxes, +GFitsImageByte::GFitsImageByte(const int& naxis, const int* naxes, const unsigned char* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { @@ -226,8 +227,9 @@ GFitsImageByte::~GFitsImageByte(void) * @brief Assignment operator * * @param[in] image FITS image. + * @return FITS image. ***************************************************************************/ -GFitsImageByte& GFitsImageByte::operator= (const GFitsImageByte& image) +GFitsImageByte& GFitsImageByte::operator=(const GFitsImageByte& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +261,7 @@ GFitsImageByte& GFitsImageByte::operator= (const GFitsImageByte& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -unsigned char& GFitsImageByte::operator() (const int& ix) +unsigned char& GFitsImageByte::operator()(const int& ix) { // If image pixels are not available then fetch them now load_data(); @@ -279,7 +281,7 @@ unsigned char& GFitsImageByte::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy) +unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy) { // If image pixels are not available then allocate them now load_data(); @@ -303,8 +305,8 @@ unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, - const int& iz) +unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy, + const int& iz) { // If image pixels are not available then allocate them now load_data(); @@ -329,8 +331,8 @@ unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // If image pixels are not available then allocate them now load_data(); @@ -351,7 +353,7 @@ unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const unsigned char& GFitsImageByte::operator() (const int& ix) const +const unsigned char& GFitsImageByte::operator()(const int& ix) const { // If image pixels are not available then fetch them now load_data(); @@ -371,7 +373,7 @@ const unsigned char& GFitsImageByte::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy) const +const unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy) const { // If image pixels are not available then allocate them now load_data(); @@ -395,8 +397,8 @@ const unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy) c * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, - const int& iz) const +const unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy, + const int& iz) const { // If image pixels are not available then allocate them now load_data(); @@ -421,8 +423,8 @@ const unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned char& GFitsImageByte::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const unsigned char& GFitsImageByte::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // If image pixels are not available then allocate them now load_data(); diff --git a/src/fits/GFitsImageDouble.cpp b/src/fits/GFitsImageDouble.cpp index c6a9040..2fc6559 100644 --- a/src/fits/GFitsImageDouble.cpp +++ b/src/fits/GFitsImageDouble.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageDouble.cpp - FITS double precision image class * + * GFitsImageDouble.cpp - Double precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2008-2012 by Juergen Knoedlseder * + * copyright (C) 2008-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageDouble.cpp - * @brief FITS double precision image class implementation + * @brief Double precision FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageDouble.hpp" @@ -71,7 +70,7 @@ GFitsImageDouble::GFitsImageDouble(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(int nx, const double* pixels) : +GFitsImageDouble::GFitsImageDouble(const int& nx, const double* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageDouble::GFitsImageDouble(int nx, const double* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(int nx, int ny, const double* pixels) : +GFitsImageDouble::GFitsImageDouble(const int& nx, const int& ny, + const double* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,7 @@ GFitsImageDouble::GFitsImageDouble(int nx, int ny, const double* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(int nx, int ny, int nz, +GFitsImageDouble::GFitsImageDouble(const int& nx, const int& ny, const int& nz, const double* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,8 +144,8 @@ GFitsImageDouble::GFitsImageDouble(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(int nx, int ny, int nz, int nt, - const double* pixels) : +GFitsImageDouble::GFitsImageDouble(const int& nx, const int& ny, const int& nz, + const int& nt, const double* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { // Initialise class members for clean destruction @@ -170,7 +170,8 @@ GFitsImageDouble::GFitsImageDouble(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageDouble::GFitsImageDouble(int naxis, const int* naxes, const double* pixels) : +GFitsImageDouble::GFitsImageDouble(const int& naxis, const int* naxes, + const double* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { // Initialise class members for clean destruction @@ -227,7 +228,7 @@ GFitsImageDouble::~GFitsImageDouble(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageDouble& GFitsImageDouble::operator= (const GFitsImageDouble& image) +GFitsImageDouble& GFitsImageDouble::operator=(const GFitsImageDouble& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +260,7 @@ GFitsImageDouble& GFitsImageDouble::operator= (const GFitsImageDouble& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -double& GFitsImageDouble::operator() (const int& ix) +double& GFitsImageDouble::operator()(const int& ix) { // If image pixels are not available then fetch them now load_data(); @@ -279,7 +280,7 @@ double& GFitsImageDouble::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -double& GFitsImageDouble::operator() (const int& ix, const int& iy) +double& GFitsImageDouble::operator()(const int& ix, const int& iy) { // If image pixels are not available then allocate them now load_data(); @@ -303,8 +304,8 @@ double& GFitsImageDouble::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -double& GFitsImageDouble::operator() (const int& ix, const int& iy, - const int& iz) +double& GFitsImageDouble::operator()(const int& ix, const int& iy, + const int& iz) { // If image pixels are not available then allocate them now load_data(); @@ -329,8 +330,8 @@ double& GFitsImageDouble::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -double& GFitsImageDouble::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +double& GFitsImageDouble::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // If image pixels are not available then allocate them now load_data(); @@ -351,7 +352,7 @@ double& GFitsImageDouble::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const double& GFitsImageDouble::operator() (const int& ix) const +const double& GFitsImageDouble::operator()(const int& ix) const { // If image pixels are not available then fetch them now load_data(); @@ -371,7 +372,7 @@ const double& GFitsImageDouble::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const double& GFitsImageDouble::operator() (const int& ix, const int& iy) const +const double& GFitsImageDouble::operator()(const int& ix, const int& iy) const { // If image pixels are not available then allocate them now load_data(); @@ -395,8 +396,8 @@ const double& GFitsImageDouble::operator() (const int& ix, const int& iy) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const double& GFitsImageDouble::operator() (const int& ix, const int& iy, - const int& iz) const +const double& GFitsImageDouble::operator()(const int& ix, const int& iy, + const int& iz) const { // If image pixels are not available then allocate them now load_data(); @@ -421,8 +422,8 @@ const double& GFitsImageDouble::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const double& GFitsImageDouble::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const double& GFitsImageDouble::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // If image pixels are not available then allocate them now load_data(); @@ -924,10 +925,3 @@ void GFitsImageDouble::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageFloat.cpp b/src/fits/GFitsImageFloat.cpp index 0ad2b29..3de190e 100644 --- a/src/fits/GFitsImageFloat.cpp +++ b/src/fits/GFitsImageFloat.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageFloat.cpp - FITS single precision image class * + * GFitsImageFloat.cpp - Single precision FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageFloat.cpp - * @brief FITS single precision image class implementation + * @brief Single precision FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageFloat.hpp" @@ -71,7 +70,7 @@ GFitsImageFloat::GFitsImageFloat(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(int nx, const float* pixels) : +GFitsImageFloat::GFitsImageFloat(const int& nx, const float* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageFloat::GFitsImageFloat(int nx, const float* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(int nx, int ny, const float* pixels) : +GFitsImageFloat::GFitsImageFloat(const int& nx, const int& ny, + const float* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,7 @@ GFitsImageFloat::GFitsImageFloat(int nx, int ny, const float* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(int nx, int ny, int nz, +GFitsImageFloat::GFitsImageFloat(const int& nx, const int& ny, const int& nz, const float* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,8 +144,8 @@ GFitsImageFloat::GFitsImageFloat(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(int nx, int ny, int nz, int nt, - const float* pixels) : +GFitsImageFloat::GFitsImageFloat(const int& nx, const int& ny, const int& nz, + const int& nt, const float* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { // Initialise class members for clean destruction @@ -170,7 +170,8 @@ GFitsImageFloat::GFitsImageFloat(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageFloat::GFitsImageFloat(int naxis, const int* naxes, const float* pixels) : +GFitsImageFloat::GFitsImageFloat(const int& naxis, const int* naxes, + const float* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { // Initialise class members for clean destruction @@ -227,7 +228,7 @@ GFitsImageFloat::~GFitsImageFloat(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageFloat& GFitsImageFloat::operator= (const GFitsImageFloat& image) +GFitsImageFloat& GFitsImageFloat::operator=(const GFitsImageFloat& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +260,7 @@ GFitsImageFloat& GFitsImageFloat::operator= (const GFitsImageFloat& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -float& GFitsImageFloat::operator() (const int& ix) +float& GFitsImageFloat::operator()(const int& ix) { // Load data load_data(); @@ -279,7 +280,7 @@ float& GFitsImageFloat::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -float& GFitsImageFloat::operator() (const int& ix, const int& iy) +float& GFitsImageFloat::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -303,8 +304,8 @@ float& GFitsImageFloat::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -float& GFitsImageFloat::operator() (const int& ix, const int& iy, - const int& iz) +float& GFitsImageFloat::operator()(const int& ix, const int& iy, + const int& iz) { // Load data load_data(); @@ -329,8 +330,8 @@ float& GFitsImageFloat::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -float& GFitsImageFloat::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +float& GFitsImageFloat::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -351,7 +352,7 @@ float& GFitsImageFloat::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const float& GFitsImageFloat::operator() (const int& ix) const +const float& GFitsImageFloat::operator()(const int& ix) const { // Load data load_data(); @@ -371,7 +372,7 @@ const float& GFitsImageFloat::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const float& GFitsImageFloat::operator() (const int& ix, const int& iy) const +const float& GFitsImageFloat::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -395,8 +396,8 @@ const float& GFitsImageFloat::operator() (const int& ix, const int& iy) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const float& GFitsImageFloat::operator() (const int& ix, const int& iy, - const int& iz) const +const float& GFitsImageFloat::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -421,8 +422,8 @@ const float& GFitsImageFloat::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const float& GFitsImageFloat::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const float& GFitsImageFloat::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -924,10 +925,3 @@ void GFitsImageFloat::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageLong.cpp b/src/fits/GFitsImageLong.cpp index 1c3025e..5ac32b4 100644 --- a/src/fits/GFitsImageLong.cpp +++ b/src/fits/GFitsImageLong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLong.cpp - FITS long integer image class * + * GFitsImageLong.cpp - Long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageLong.cpp - * @brief FITS long integer image class implementation + * @brief Long integer FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageLong.hpp" @@ -71,7 +70,7 @@ GFitsImageLong::GFitsImageLong(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(int nx, const long* pixels) : +GFitsImageLong::GFitsImageLong(const int& nx, const long* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,7 @@ GFitsImageLong::GFitsImageLong(int nx, const long* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(int nx, int ny, const long* pixels) : +GFitsImageLong::GFitsImageLong(const int& nx, const int& ny, const long* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +117,7 @@ GFitsImageLong::GFitsImageLong(int nx, int ny, const long* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(int nx, int ny, int nz, +GFitsImageLong::GFitsImageLong(const int& nx, const int& ny, const int& nz, const long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,8 +143,8 @@ GFitsImageLong::GFitsImageLong(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(int nx, int ny, int nz, int nt, - const long* pixels) : +GFitsImageLong::GFitsImageLong(const int& nx, const int& ny, const int& nz, + const int& nt, const long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { // Initialise class members for clean destruction @@ -170,7 +169,8 @@ GFitsImageLong::GFitsImageLong(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageLong::GFitsImageLong(int naxis, const int* naxes, const long* pixels) : +GFitsImageLong::GFitsImageLong(const int& naxis, const int* naxes, + const long* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { // Initialise class members for clean destruction @@ -227,7 +227,7 @@ GFitsImageLong::~GFitsImageLong(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageLong& GFitsImageLong::operator= (const GFitsImageLong& image) +GFitsImageLong& GFitsImageLong::operator=(const GFitsImageLong& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +259,7 @@ GFitsImageLong& GFitsImageLong::operator= (const GFitsImageLong& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -long& GFitsImageLong::operator() (const int& ix) +long& GFitsImageLong::operator()(const int& ix) { // Load data load_data(); @@ -279,7 +279,7 @@ long& GFitsImageLong::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long& GFitsImageLong::operator() (const int& ix, const int& iy) +long& GFitsImageLong::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -303,7 +303,7 @@ long& GFitsImageLong::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long& GFitsImageLong::operator() (const int& ix, const int& iy, const int& iz) +long& GFitsImageLong::operator()(const int& ix, const int& iy, const int& iz) { // Load data load_data(); @@ -328,8 +328,8 @@ long& GFitsImageLong::operator() (const int& ix, const int& iy, const int& iz) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long& GFitsImageLong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +long& GFitsImageLong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -350,7 +350,7 @@ long& GFitsImageLong::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const long& GFitsImageLong::operator() (const int& ix) const +const long& GFitsImageLong::operator()(const int& ix) const { // Load data load_data(); @@ -370,7 +370,7 @@ const long& GFitsImageLong::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long& GFitsImageLong::operator() (const int& ix, const int& iy) const +const long& GFitsImageLong::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -394,8 +394,8 @@ const long& GFitsImageLong::operator() (const int& ix, const int& iy) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long& GFitsImageLong::operator() (const int& ix, const int& iy, - const int& iz) const +const long& GFitsImageLong::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -420,8 +420,8 @@ const long& GFitsImageLong::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long& GFitsImageLong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const long& GFitsImageLong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -923,10 +923,3 @@ void GFitsImageLong::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageLongLong.cpp b/src/fits/GFitsImageLongLong.cpp index 849d1d0..c4d9037 100644 --- a/src/fits/GFitsImageLongLong.cpp +++ b/src/fits/GFitsImageLongLong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageLongLong.cpp - FITS long long image class * + * GFitsImageLongLong.cpp - Long long integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageLongLong.cpp - * @brief FITS long long integer image class implementation + * @brief Long long integer FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageLongLong.hpp" @@ -71,7 +70,7 @@ GFitsImageLongLong::GFitsImageLongLong(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(int nx, const long long* pixels) : +GFitsImageLongLong::GFitsImageLongLong(const int& nx, const long long* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageLongLong::GFitsImageLongLong(int nx, const long long* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, const long long* pixels) : +GFitsImageLongLong::GFitsImageLongLong(const int& nx, const int& ny, + const long long* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,8 @@ GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, const long long* pixels) * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, int nz, +GFitsImageLongLong::GFitsImageLongLong(const int& nx, const int& ny, + const int& nz, const long long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,7 +145,8 @@ GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, int nz, int nt, +GFitsImageLongLong::GFitsImageLongLong(const int& nx, const int& ny, + const int& nz, const int& nt, const long long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { @@ -170,7 +172,7 @@ GFitsImageLongLong::GFitsImageLongLong(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageLongLong::GFitsImageLongLong(int naxis, const int* naxes, +GFitsImageLongLong::GFitsImageLongLong(const int& naxis, const int* naxes, const long long* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { @@ -228,7 +230,7 @@ GFitsImageLongLong::~GFitsImageLongLong(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageLongLong& GFitsImageLongLong::operator= (const GFitsImageLongLong& image) +GFitsImageLongLong& GFitsImageLongLong::operator=(const GFitsImageLongLong& image) { // Execute only if object is not identical if (this != &image) { @@ -260,7 +262,7 @@ GFitsImageLongLong& GFitsImageLongLong::operator= (const GFitsImageLongLong& ima * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -long long& GFitsImageLongLong::operator() (const int& ix) +long long& GFitsImageLongLong::operator()(const int& ix) { // Load data load_data(); @@ -280,7 +282,7 @@ long long& GFitsImageLongLong::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long long& GFitsImageLongLong::operator() (const int& ix, const int& iy) +long long& GFitsImageLongLong::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -304,8 +306,8 @@ long long& GFitsImageLongLong::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, - const int& iz) +long long& GFitsImageLongLong::operator()(const int& ix, const int& iy, + const int& iz) { // Load data load_data(); @@ -330,8 +332,8 @@ long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +long long& GFitsImageLongLong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -352,7 +354,7 @@ long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const long long& GFitsImageLongLong::operator() (const int& ix) const +const long long& GFitsImageLongLong::operator()(const int& ix) const { // Load data load_data(); @@ -372,7 +374,7 @@ const long long& GFitsImageLongLong::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long long& GFitsImageLongLong::operator() (const int& ix, const int& iy) const +const long long& GFitsImageLongLong::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -396,8 +398,8 @@ const long long& GFitsImageLongLong::operator() (const int& ix, const int& iy) c * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, - const int& iz) const +const long long& GFitsImageLongLong::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -422,8 +424,8 @@ const long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const long long& GFitsImageLongLong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const long long& GFitsImageLongLong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -925,10 +927,3 @@ void GFitsImageLongLong::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageSByte.cpp b/src/fits/GFitsImageSByte.cpp index 4ef03db..ff7e70f 100644 --- a/src/fits/GFitsImageSByte.cpp +++ b/src/fits/GFitsImageSByte.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageSByte.cpp - FITS signed Byte image class * + * GFitsImageSByte.cpp - Signed Byte FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageSByte.cpp - * @brief FITS signed byte image class implementation + * @brief Signed Byte FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageSByte.hpp" @@ -71,7 +70,7 @@ GFitsImageSByte::GFitsImageSByte(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(int nx, const char* pixels) : +GFitsImageSByte::GFitsImageSByte(const int& nx, const char* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageSByte::GFitsImageSByte(int nx, const char* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(int nx, int ny, const char* pixels) : +GFitsImageSByte::GFitsImageSByte(const int& nx, const int& ny, + const char* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,8 @@ GFitsImageSByte::GFitsImageSByte(int nx, int ny, const char* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(int nx, int ny, int nz, const char* pixels) : +GFitsImageSByte::GFitsImageSByte(const int& nx, const int& ny, const int& nz, + const char* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { // Initialise class members for clean destruction @@ -143,7 +144,8 @@ GFitsImageSByte::GFitsImageSByte(int nx, int ny, int nz, const char* pixels) : * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(int nx, int ny, int nz, int nt, +GFitsImageSByte::GFitsImageSByte(const int& nx, const int& ny, const int& nz, + const int& nt, const char* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { @@ -169,7 +171,7 @@ GFitsImageSByte::GFitsImageSByte(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageSByte::GFitsImageSByte(int naxis, const int* naxes, +GFitsImageSByte::GFitsImageSByte(const int& naxis, const int* naxes, const char* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { @@ -227,7 +229,7 @@ GFitsImageSByte::~GFitsImageSByte(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageSByte& GFitsImageSByte::operator= (const GFitsImageSByte& image) +GFitsImageSByte& GFitsImageSByte::operator=(const GFitsImageSByte& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +261,7 @@ GFitsImageSByte& GFitsImageSByte::operator= (const GFitsImageSByte& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -char& GFitsImageSByte::operator() (const int& ix) +char& GFitsImageSByte::operator()(const int& ix) { // Load data load_data(); @@ -279,7 +281,7 @@ char& GFitsImageSByte::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -char& GFitsImageSByte::operator() (const int& ix, const int& iy) +char& GFitsImageSByte::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -303,7 +305,7 @@ char& GFitsImageSByte::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -char& GFitsImageSByte::operator() (const int& ix, const int& iy, const int& iz) +char& GFitsImageSByte::operator()(const int& ix, const int& iy, const int& iz) { // Load data load_data(); @@ -328,8 +330,8 @@ char& GFitsImageSByte::operator() (const int& ix, const int& iy, const int& iz) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -char& GFitsImageSByte::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +char& GFitsImageSByte::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -350,7 +352,7 @@ char& GFitsImageSByte::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const char& GFitsImageSByte::operator() (const int& ix) const +const char& GFitsImageSByte::operator()(const int& ix) const { // Load data load_data(); @@ -370,7 +372,7 @@ const char& GFitsImageSByte::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const char& GFitsImageSByte::operator() (const int& ix, const int& iy) const +const char& GFitsImageSByte::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -394,8 +396,8 @@ const char& GFitsImageSByte::operator() (const int& ix, const int& iy) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const char& GFitsImageSByte::operator() (const int& ix, const int& iy, - const int& iz) const +const char& GFitsImageSByte::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -420,8 +422,8 @@ const char& GFitsImageSByte::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const char& GFitsImageSByte::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const char& GFitsImageSByte::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -923,10 +925,3 @@ void GFitsImageSByte::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageShort.cpp b/src/fits/GFitsImageShort.cpp index 937812b..5c0776b 100644 --- a/src/fits/GFitsImageShort.cpp +++ b/src/fits/GFitsImageShort.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageShort.cpp - FITS short integer image class * + * GFitsImageShort.cpp - Short integer FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageShort.cpp - * @brief FITS short integer image class implementation + * @brief Short integer FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageShort.hpp" @@ -71,7 +70,7 @@ GFitsImageShort::GFitsImageShort(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(int nx, const short* pixels) : +GFitsImageShort::GFitsImageShort(const int& nx, const short* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageShort::GFitsImageShort(int nx, const short* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(int nx, int ny, const short* pixels) : +GFitsImageShort::GFitsImageShort(const int& nx, const int& ny, + const short* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,7 @@ GFitsImageShort::GFitsImageShort(int nx, int ny, const short* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(int nx, int ny, int nz, +GFitsImageShort::GFitsImageShort(const int& nx, const int& ny, const int& nz, const short* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,8 +144,8 @@ GFitsImageShort::GFitsImageShort(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(int nx, int ny, int nz, int nt, - const short* pixels) : +GFitsImageShort::GFitsImageShort(const int& nx, const int& ny, const int& nz, + const int& nt, const short* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { // Initialise class members for clean destruction @@ -170,7 +170,8 @@ GFitsImageShort::GFitsImageShort(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageShort::GFitsImageShort(int naxis, const int* naxes, const short* pixels) : +GFitsImageShort::GFitsImageShort(const int& naxis, const int* naxes, + const short* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { // Initialise class members for clean destruction @@ -227,7 +228,7 @@ GFitsImageShort::~GFitsImageShort(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageShort& GFitsImageShort::operator= (const GFitsImageShort& image) +GFitsImageShort& GFitsImageShort::operator=(const GFitsImageShort& image) { // Execute only if object is not identical if (this != &image) { @@ -259,7 +260,7 @@ GFitsImageShort& GFitsImageShort::operator= (const GFitsImageShort& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -short& GFitsImageShort::operator() (const int& ix) +short& GFitsImageShort::operator()(const int& ix) { // Load data load_data(); @@ -279,7 +280,7 @@ short& GFitsImageShort::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -short& GFitsImageShort::operator() (const int& ix, const int& iy) +short& GFitsImageShort::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -303,8 +304,7 @@ short& GFitsImageShort::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -short& GFitsImageShort::operator() (const int& ix, const int& iy, - const int& iz) +short& GFitsImageShort::operator()(const int& ix, const int& iy, const int& iz) { // Load data load_data(); @@ -329,8 +329,8 @@ short& GFitsImageShort::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -short& GFitsImageShort::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +short& GFitsImageShort::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -351,7 +351,7 @@ short& GFitsImageShort::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const short& GFitsImageShort::operator() (const int& ix) const +const short& GFitsImageShort::operator()(const int& ix) const { // Load data load_data(); @@ -371,7 +371,7 @@ const short& GFitsImageShort::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const short& GFitsImageShort::operator() (const int& ix, const int& iy) const +const short& GFitsImageShort::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -395,8 +395,8 @@ const short& GFitsImageShort::operator() (const int& ix, const int& iy) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const short& GFitsImageShort::operator() (const int& ix, const int& iy, - const int& iz) const +const short& GFitsImageShort::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -421,8 +421,8 @@ const short& GFitsImageShort::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const short& GFitsImageShort::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const short& GFitsImageShort::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -924,10 +924,3 @@ void GFitsImageShort::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageULong.cpp b/src/fits/GFitsImageULong.cpp index 6871318..5417df9 100644 --- a/src/fits/GFitsImageULong.cpp +++ b/src/fits/GFitsImageULong.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageULong.cpp - FITS unsigned long integer image class * + * GFitsImageULong.cpp - Unsigned long image FITS class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageULong.cpp - * @brief FITS unsigned long integer image class implementation + * @brief Unsigned long image FITS class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageULong.hpp" @@ -71,7 +70,7 @@ GFitsImageULong::GFitsImageULong(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(int nx, const unsigned long* pixels) : +GFitsImageULong::GFitsImageULong(const int& nx, const unsigned long* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +93,8 @@ GFitsImageULong::GFitsImageULong(int nx, const unsigned long* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(int nx, int ny, const unsigned long* pixels) : +GFitsImageULong::GFitsImageULong(const int& nx, const int& ny, + const unsigned long* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +118,7 @@ GFitsImageULong::GFitsImageULong(int nx, int ny, const unsigned long* pixels) : * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(int nx, int ny, int nz, +GFitsImageULong::GFitsImageULong(const int& nx, const int& ny, const int& nz, const unsigned long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,7 +144,8 @@ GFitsImageULong::GFitsImageULong(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(int nx, int ny, int nz, int nt, +GFitsImageULong::GFitsImageULong(const int& nx, const int& ny, const int& nz, + const int& nt, const unsigned long* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { @@ -170,7 +171,7 @@ GFitsImageULong::GFitsImageULong(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageULong::GFitsImageULong(int naxis, const int* naxes, +GFitsImageULong::GFitsImageULong(const int& naxis, const int* naxes, const unsigned long* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { @@ -228,7 +229,7 @@ GFitsImageULong::~GFitsImageULong(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageULong& GFitsImageULong::operator= (const GFitsImageULong& image) +GFitsImageULong& GFitsImageULong::operator=(const GFitsImageULong& image) { // Execute only if object is not identical if (this != &image) { @@ -260,7 +261,7 @@ GFitsImageULong& GFitsImageULong::operator= (const GFitsImageULong& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -unsigned long& GFitsImageULong::operator() (const int& ix) +unsigned long& GFitsImageULong::operator()(const int& ix) { // Load data load_data(); @@ -280,7 +281,7 @@ unsigned long& GFitsImageULong::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy) +unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -304,8 +305,8 @@ unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, - const int& iz) +unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy, + const int& iz) { // Load data load_data(); @@ -330,8 +331,8 @@ unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -352,7 +353,7 @@ unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const unsigned long& GFitsImageULong::operator() (const int& ix) const +const unsigned long& GFitsImageULong::operator()(const int& ix) const { // Load data load_data(); @@ -372,7 +373,7 @@ const unsigned long& GFitsImageULong::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy) const +const unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -396,8 +397,8 @@ const unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, - const int& iz) const +const unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -422,8 +423,8 @@ const unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned long& GFitsImageULong::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const unsigned long& GFitsImageULong::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -925,10 +926,3 @@ void GFitsImageULong::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/ diff --git a/src/fits/GFitsImageUShort.cpp b/src/fits/GFitsImageUShort.cpp index ef1965d..4d81606 100644 --- a/src/fits/GFitsImageUShort.cpp +++ b/src/fits/GFitsImageUShort.cpp @@ -1,7 +1,7 @@ /*************************************************************************** - * GFitsImageUShort.cpp - FITS unsigned short integer image class * + * GFitsImageUShort.cpp - Unsigned short FITS image class * * ----------------------------------------------------------------------- * - * copyright (C) 2010-2012 by Juergen Knoedlseder * + * copyright (C) 2010-2013 by Juergen Knoedlseder * * ----------------------------------------------------------------------- * * * * This program is free software: you can redistribute it and/or modify * @@ -20,7 +20,7 @@ ***************************************************************************/ /** * @file GFitsImageUShort.cpp - * @brief FITS unsigned short integer image class implementation + * @brief Unsigned short FITS image class implementation * @author Juergen Knoedlseder */ @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -#include #include "GException.hpp" #include "GFitsCfitsio.hpp" #include "GFitsImageUShort.hpp" @@ -71,7 +70,8 @@ GFitsImageUShort::GFitsImageUShort(void) : GFitsImage() * * Construct 1D instance by specifying the number of pixels in the image. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(int nx, const unsigned short* pixels) : +GFitsImageUShort::GFitsImageUShort(const int& nx, + const unsigned short* pixels) : GFitsImage(G_BITPIX, nx) { // Initialise class members for clean destruction @@ -94,7 +94,8 @@ GFitsImageUShort::GFitsImageUShort(int nx, const unsigned short* pixels) : * * Construct 2D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(int nx, int ny, const unsigned short* pixels) : +GFitsImageUShort::GFitsImageUShort(const int& nx, const int& ny, + const unsigned short* pixels) : GFitsImage(G_BITPIX, nx, ny) { // Initialise class members for clean destruction @@ -118,7 +119,7 @@ GFitsImageUShort::GFitsImageUShort(int nx, int ny, const unsigned short* pixels) * * Construct 3D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(int nx, int ny, int nz, +GFitsImageUShort::GFitsImageUShort(const int& nx, const int& ny, const int& nz, const unsigned short* pixels) : GFitsImage(G_BITPIX, nx, ny, nz) { @@ -144,7 +145,8 @@ GFitsImageUShort::GFitsImageUShort(int nx, int ny, int nz, * * Construct 4D image by specifying the number of pixels in each dimension. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(int nx, int ny, int nz, int nt, +GFitsImageUShort::GFitsImageUShort(const int& nx, const int& ny, + const int& nz, const int& nt, const unsigned short* pixels) : GFitsImage(G_BITPIX, nx, ny, nz, nt) { @@ -170,7 +172,7 @@ GFitsImageUShort::GFitsImageUShort(int nx, int ny, int nz, int nt, * the number of pixels in each dimension. Note that this constructor does * not allocate any memory for the actual image. ***************************************************************************/ -GFitsImageUShort::GFitsImageUShort(int naxis, const int* naxes, +GFitsImageUShort::GFitsImageUShort(const int& naxis, const int* naxes, const unsigned short* pixels) : GFitsImage(G_BITPIX, naxis, naxes) { @@ -228,7 +230,7 @@ GFitsImageUShort::~GFitsImageUShort(void) * * @param[in] image FITS image. ***************************************************************************/ -GFitsImageUShort& GFitsImageUShort::operator= (const GFitsImageUShort& image) +GFitsImageUShort& GFitsImageUShort::operator=(const GFitsImageUShort& image) { // Execute only if object is not identical if (this != &image) { @@ -260,7 +262,7 @@ GFitsImageUShort& GFitsImageUShort::operator= (const GFitsImageUShort& image) * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -unsigned short& GFitsImageUShort::operator() (const int& ix) +unsigned short& GFitsImageUShort::operator()(const int& ix) { // Load data load_data(); @@ -280,7 +282,7 @@ unsigned short& GFitsImageUShort::operator() (const int& ix) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy) +unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy) { // Load data load_data(); @@ -304,8 +306,8 @@ unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy) * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, - const int& iz) +unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy, + const int& iz) { // Load data load_data(); @@ -330,8 +332,8 @@ unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, - const int& iz, const int& it) +unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy, + const int& iz, const int& it) { // Load data load_data(); @@ -352,7 +354,7 @@ unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, * Provides access to an image pixel. No range checking is performed. * Use the at(ix) method if range checking is required. ***************************************************************************/ -const unsigned short& GFitsImageUShort::operator() (const int& ix) const +const unsigned short& GFitsImageUShort::operator()(const int& ix) const { // Load data load_data(); @@ -372,7 +374,7 @@ const unsigned short& GFitsImageUShort::operator() (const int& ix) const * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy) const +const unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy) const { // Load data load_data(); @@ -396,8 +398,8 @@ const unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, - const int& iz) const +const unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy, + const int& iz) const { // Load data load_data(); @@ -422,8 +424,8 @@ const unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy * dimension verification is performed. Use the at(ix,iy) method if range * checking and image dimension verification is required. ***************************************************************************/ -const unsigned short& GFitsImageUShort::operator() (const int& ix, const int& iy, - const int& iz, const int& it) const +const unsigned short& GFitsImageUShort::operator()(const int& ix, const int& iy, + const int& iz, const int& it) const { // Load data load_data(); @@ -925,10 +927,3 @@ void GFitsImageUShort::alloc_nulval(const void* value) // Return return; } - - -/*========================================================================== - = = - = Friends = - = = - ==========================================================================*/