geirs2Panic
Richard J. Mathar
Fits header keyword batch editor
|
A rectangular 2-dimensional array of pixels with individual values. More...
#include <PixImage.h>
Public Member Functions | |
PixImage (const int ncols, const int nrows) | |
Create an empty image with all values set to zero. More... | |
PixImage () | |
Create an image of zero size (without pixels). More... | |
PixImage (FITS &fit, int slic=0) | |
Read the pixel values from a slice of a FITS cube. More... | |
~PixImage () | |
operator Bbox2D () const | |
Generate the bounding box of this pixel array. More... | |
FITS * | toFits (const char *foutname) const |
Generate a FITS file with this image as the primary HDU. More... | |
PixImage * | apply (const RotTrans2D &rt) const |
double | at (const int row, const int col) const |
Read/get the value of the intensity at a specific pixel. More... | |
int | idx (const int row, const int col) const |
Obtain the flat index of a (x,y) pair of indices. More... | |
Square2D | hull (const RotTrans2D &rt, const int row, const int col, int idxReg[2][2], const Bbox2D &bbrot) const |
Public Attributes | |
valarray< double > | vals |
The values (intensities) within the pixels. More... | |
int | rows |
Number of rows. More... | |
int | cols |
Number of columns. More... | |
A rectangular 2-dimensional array of pixels with individual values.
PixImage::PixImage | ( | const int | ncols, |
const int | nrows | ||
) |
Create an empty image with all values set to zero.
[in] | ncols | The number of columns in the image. The same as the number of pixels along x. |
[out] | nrows | The number of rows in the image. The same as the number of pixels along y. |
PixImage::PixImage | ( | ) |
Create an image of zero size (without pixels).
PixImage::PixImage | ( | FITS & | fit, |
int | slic = 0 |
||
) |
Read the pixel values from a slice of a FITS cube.
fit | The FITS object with at least one image plane in the Primary HDU. |
slic | The 0-based index into the FITS cube. |
PixImage::~PixImage | ( | ) |
Destructor. Release the allocated memory areas.
PixImage::operator Bbox2D | ( | ) | const |
Generate the bounding box of this pixel array.
FITS * PixImage::toFits | ( | const char * | foutname | ) | const |
Generate a FITS file with this image as the primary HDU.
[in] | foutname |
PixImage * PixImage::apply | ( | const RotTrans2D & | rt | ) | const |
Generate a quadrangle of pixels by rotation and translation of a indexed pixel.
double PixImage::at | ( | const int | row, |
const int | col | ||
) | const |
Read/get the value of the intensity at a specific pixel.
[in] | row | |
[in] | col |
int PixImage::idx | ( | const int | row, |
const int | col | ||
) | const |
Obtain the flat index of a (x,y) pair of indices.
[in] | row | |
[in] | col |
Square2D PixImage::hull | ( | const RotTrans2D & | rt, |
const int | row, | ||
const int | col, | ||
int | idxReg[2][2], | ||
const Bbox2D & | bbrot | ||
) | const |
Generate a hull (an encompassing integer rectangle) of the image of a pixel
[in] | rt | The rotation-translation to be applied to the pixel. |
[in] | row | The row index of the pixel. |
[in] | col | The column index of the pixel. |
[in] | bbrot | The boundary box of the rotated entire original array. |
[out] | idxReg | The index region of the image of the pixel under the operation. idxReg[0][] refers to the lower left corner, idxReg[1][] to the upper right. idxReg[][0] refers to the x coordinates, idxReg[][1] to the y coordinates. idx[1][] is non-incluse (as usual in C/C++/Java): The pixel (row,col) will cover parts of idxReg[0][0]..idxReg[0][1]-1 along x and idxReg[1][0]..idxRe[1][1]-1 along y after rotation. |
valarray<double> PixImage::vals |
The values (intensities) within the pixels.
int PixImage::rows |
Number of rows.
int PixImage::cols |
Number of columns.