/usr/include/rtd/LongLongImageData.h is in skycat 3.1.2+starlink1~b-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | /*
* E.S.O. - VLT project
*
* "@(#) $Id: LongLongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $"
* $Id: LongLongImageData.h,v 1.1.1.1 2009/03/31 14:11:52 cguirao Exp $
*
* LongLongImageData.h - class definitions for class LongLongImageData
*
* who when what
* -------------- -------- ----------------------------------------
* pbiereic 12/08/07 Created
*/
#include <sys/types.h>
#include "ImageData.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#define FITS_LONGLONG long long
// This class is used for images where the raw data is made up of ints
class LongLongImageData : public ImageData
{
private:
// value of blank pixel, if known (if haveBlankPixel_ is nonzero)
FITS_LONGLONG blank_;
int bias_; // offset for long to short conversion
double dbias_; // used when scale != 1.0
double scale_; // factor for long to short conversion
int scaled_; // flag, true if scale_ != 1.0
// local methods used to get short index in lookup table
short convertToShort(FITS_LONGLONG); // convert long to short by adding bias
short scaleToShort(FITS_LONGLONG); // as above, but with scaling
inline ushort convertToUshort(FITS_LONGLONG l) { // unsigned
return ushort(scaled_ ? scaleToShort(l) : convertToShort(l));
}
// return X image pixel value for raw image value
inline byte lookup(FITS_LONGLONG l) {
return lookup_[convertToUshort(l)];
}
inline unsigned long llookup(FITS_LONGLONG l) {
return lookup_[convertToUshort(l)];
}
// return NTOH converted value evtl. subtracted with corresponding bias value
FITS_LONGLONG getVal(FITS_LONGLONG* p, int idx);
int getXsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples);
int getBsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples);
int getCsamples(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples);
FITS_LONGLONG getMedian(FITS_LONGLONG *samples, int n);
FITS_LONGLONG getBoxVal(FITS_LONGLONG *rawImage, int idx, int wbox, FITS_LONGLONG *samples, int xs);
FITS_LONGLONG getRMS(FITS_LONGLONG *samples, int n);
protected:
// initialize conversion from base type to short,
void initShortConversion();
public:
// constructor
LongLongImageData(const char* name, const ImageIO& imio, int verbose)
: ImageData(name, imio, verbose),
blank_(0) {}
// return the data type of the raw data
int dataType() {return LONGLONG_IMAGE;}
// return true if the data type is signed
int isSigned() {return 1;}
// return a copy of this object
ImageData* copy() {return new LongLongImageData(*this);}
// include declarations for methods that differ only in raw data type
# include "ImageTemplates.h"
};
|