Instrument Neutral Distributed Interface INDI  2.0.2
Public Types | Public Member Functions | Friends | List of all members
INDI::CCDChip Class Reference

The CCDChip class provides functionality of a CCD Chip within a CCD. More...

#include <indiccdchip.h>

Public Types

enum  CCD_FRAME { LIGHT_FRAME = 0 , BIAS_FRAME , DARK_FRAME , FLAT_FRAME }
 
enum  CCD_FRAME_INDEX { FRAME_X , FRAME_Y , FRAME_W , FRAME_H }
 
enum  CCD_BIN_INDEX { BIN_W , BIN_H }
 
enum  CCD_INFO_INDEX {
  CCD_MAX_X , CCD_MAX_Y , CCD_PIXEL_SIZE , CCD_PIXEL_SIZE_X ,
  CCD_PIXEL_SIZE_Y , CCD_BITSPERPIXEL
}
 

Public Member Functions

 CCDChip ()
 
 ~CCDChip ()
 
bool openFITSFile (uint32_t size, int &status)
 openFITSFile Allocate memory buffer for internal FITS file structure and open More...
 
bool finishFITSFile (int &status)
 Finish any pending write to fits file. More...
 
void closeFITSFile ()
 closeFITSFile Close the in-memory FITS File. More...
 
int getXRes () const
 getXRes Get the horizontal resolution in pixels of the CCD Chip. More...
 
int getYRes () const
 Get the vertical resolution in pixels of the CCD Chip. More...
 
int getSubX () const
 getSubX Get the starting left coordinates (X) of the frame. More...
 
int getSubY () const
 getSubY Get the starting top coordinates (Y) of the frame. More...
 
int getSubW () const
 getSubW Get the width of the frame More...
 
int getSubH () const
 getSubH Get the height of the frame More...
 
int getBinX () const
 getBinX Get horizontal binning of the CCD chip. More...
 
int getBinY () const
 getBinY Get vertical binning of the CCD chip. More...
 
float getPixelSizeX () const
 getPixelSizeX Get horizontal pixel size in microns. More...
 
float getPixelSizeY () const
 getPixelSizeY Get vertical pixel size in microns. More...
 
int getBPP () const
 getBPP Get CCD Chip depth (bits per pixel). More...
 
int getFrameBufferSize () const
 getFrameBufferSize Get allocated frame buffer size to hold the CCD image frame. More...
 
double getExposureLeft () const
 getExposureLeft Get exposure time left in seconds. More...
 
double getExposureDuration () const
 getExposureDuration Get requested exposure duration for the CCD chip in seconds. More...
 
const char * getExposureStartTime ()
 getExposureStartTime More...
 
uint8_t * getFrameBuffer ()
 getFrameBuffer Get raw frame buffer of the CCD chip. More...
 
void setFrameBuffer (uint8_t *buffer)
 setFrameBuffer Set raw frame buffer pointer. More...
 
bool isCompressed () const
 isCompressed More...
 
CCD_FRAME getFrameType () const
 isInterlaced More...
 
const char * getFrameTypeName (CCD_FRAME fType)
 getFrameTypeName returns CCD Frame type name More...
 
INumberVectorPropertygetCCDInfo ()
 Return CCD Info Property. More...
 
void setResolution (uint32_t x, uint32_t y)
 setResolution set CCD Chip resolution More...
 
void setFrame (uint32_t subx, uint32_t suby, uint32_t subw, uint32_t subh)
 setFrame Set desired frame resolutoin for an exposure. More...
 
void setBin (uint8_t hor, uint8_t ver)
 setBin Set CCD Chip binnig More...
 
void setMinMaxStep (const char *property, const char *element, double min, double max, double step, bool sendToClient=true)
 setMinMaxStep for a number property element More...
 
void setPixelSize (double x, double y)
 setPixelSize Set CCD Chip pixel size More...
 
void setCompressed (bool cmp)
 setCompressed Set whether a frame is compressed after exposure? More...
 
void setFrameBufferSize (uint32_t nbuf, bool allocMem=true)
 setFrameBufferSize Set desired frame buffer size. The function will allocate memory accordingly. The frame size depends on the desired frame resolution (Left, Top, Width, Height), depth of the CCD chip (bpp), and binning settings. You must set the frame size any time any of the prior parameters gets updated. More...
 
void setBPP (uint8_t bpp)
 setBPP Set depth of CCD chip. More...
 
void setFrameType (CCD_FRAME type)
 setFrameType Set desired frame type for next exposure. More...
 
void setExposureDuration (double duration)
 setExposureDuration Set desired CCD frame exposure duration for next exposure. You must call this function immediately before starting the actual exposure as it is used to calculate the timestamp used for the FITS header. More...
 
void setExposureLeft (double duration)
 setExposureLeft Update exposure time left. Inform the client of the new exposure time left value. More...
 
void setExposureComplete ()
 setExposureComplete Mark exposure as complete by setting ImageExposure property to IPS_OK More...
 
void setExposureFailed ()
 setExposureFailed Alert the client that the exposure failed. More...
 
int getNAxis () const
 
void setNAxis (int value)
 setNAxis Set FITS number of axis More...
 
void setImageExtension (const char *ext)
 setImageExtension Set image exntension More...
 
char * getImageExtension ()
 
bool isExposing () const
 
void binFrame ()
 binFrame Perform software binning on the CCD frame. Only use this function if hardware binning is not supported. More...
 
void binBayerFrame ()
 binBayerFrame Perform software binning on a 2x2 Bayer matrix CCD frame. Only use this function if hardware binning is not supported. More...
 
fitsfile ** fitsFilePointer ()
 
size_t * fitsMemorySizePointer ()
 
void ** fitsMemoryBlockPointer ()
 

Friends

class CCD
 
class StreamRecoder
 

Detailed Description

The CCDChip class provides functionality of a CCD Chip within a CCD.

Definition at line 34 of file indiccdchip.h.

Member Enumeration Documentation

◆ CCD_BIN_INDEX

Enumerator
BIN_W 
BIN_H 

Definition at line 42 of file indiccdchip.h.

◆ CCD_FRAME

Enumerator
LIGHT_FRAME 
BIAS_FRAME 
DARK_FRAME 
FLAT_FRAME 

Definition at line 40 of file indiccdchip.h.

◆ CCD_FRAME_INDEX

Enumerator
FRAME_X 
FRAME_Y 
FRAME_W 
FRAME_H 

Definition at line 41 of file indiccdchip.h.

◆ CCD_INFO_INDEX

Enumerator
CCD_MAX_X 
CCD_MAX_Y 
CCD_PIXEL_SIZE 
CCD_PIXEL_SIZE_X 
CCD_PIXEL_SIZE_Y 
CCD_BITSPERPIXEL 

Definition at line 43 of file indiccdchip.h.

Constructor & Destructor Documentation

◆ CCDChip()

INDI::CCDChip::CCDChip ( )

Definition at line 28 of file indiccdchip.cpp.

◆ ~CCDChip()

INDI::CCDChip::~CCDChip ( )

Definition at line 33 of file indiccdchip.cpp.

Member Function Documentation

◆ binBayerFrame()

void INDI::CCDChip::binBayerFrame ( )

binBayerFrame Perform software binning on a 2x2 Bayer matrix CCD frame. Only use this function if hardware binning is not supported.

Definition at line 377 of file indiccdchip.cpp.

◆ binFrame()

void INDI::CCDChip::binFrame ( )

binFrame Perform software binning on the CCD frame. Only use this function if hardware binning is not supported.

Definition at line 284 of file indiccdchip.cpp.

◆ closeFITSFile()

void INDI::CCDChip::closeFITSFile ( )

closeFITSFile Close the in-memory FITS File.

Definition at line 72 of file indiccdchip.cpp.

◆ finishFITSFile()

bool INDI::CCDChip::finishFITSFile ( int &  status)

Finish any pending write to fits file.

Returns
True if successful, false otherwise.

Definition at line 61 of file indiccdchip.cpp.

◆ fitsFilePointer()

fitsfile** INDI::CCDChip::fitsFilePointer ( )
inline

Definition at line 416 of file indiccdchip.h.

◆ fitsMemoryBlockPointer()

void** INDI::CCDChip::fitsMemoryBlockPointer ( )
inline

Definition at line 426 of file indiccdchip.h.

◆ fitsMemorySizePointer()

size_t* INDI::CCDChip::fitsMemorySizePointer ( )
inline

Definition at line 421 of file indiccdchip.h.

◆ getBinX()

int INDI::CCDChip::getBinX ( ) const
inline

getBinX Get horizontal binning of the CCD chip.

Returns
horizontal binning of the CCD chip.
Examples
simpleccd.cpp.

Definition at line 131 of file indiccdchip.h.

◆ getBinY()

int INDI::CCDChip::getBinY ( ) const
inline

getBinY Get vertical binning of the CCD chip.

Returns
vertical binning of the CCD chip.
Examples
simpleccd.cpp.

Definition at line 140 of file indiccdchip.h.

◆ getBPP()

int INDI::CCDChip::getBPP ( ) const
inline

getBPP Get CCD Chip depth (bits per pixel).

Returns
bits per pixel.
Examples
simpleccd.cpp.

Definition at line 167 of file indiccdchip.h.

◆ getCCDInfo()

INumberVectorProperty* INDI::CCDChip::getCCDInfo ( )
inline

Return CCD Info Property.

Definition at line 264 of file indiccdchip.h.

◆ getExposureDuration()

double INDI::CCDChip::getExposureDuration ( ) const
inline

getExposureDuration Get requested exposure duration for the CCD chip in seconds.

Returns
requested exposure duration for the CCD chip in seconds.

Definition at line 194 of file indiccdchip.h.

◆ getExposureLeft()

double INDI::CCDChip::getExposureLeft ( ) const
inline

getExposureLeft Get exposure time left in seconds.

Returns
exposure time left in seconds.

Definition at line 185 of file indiccdchip.h.

◆ getExposureStartTime()

const char * INDI::CCDChip::getExposureStartTime ( )

getExposureStartTime

Returns
exposure start time in ISO 8601 format.

Definition at line 236 of file indiccdchip.cpp.

◆ getFrameBuffer()

uint8_t* INDI::CCDChip::getFrameBuffer ( )
inline

getFrameBuffer Get raw frame buffer of the CCD chip.

Returns
raw frame buffer of the CCD chip.
Examples
simpleccd.cpp.

Definition at line 209 of file indiccdchip.h.

◆ getFrameBufferSize()

int INDI::CCDChip::getFrameBufferSize ( ) const
inline

getFrameBufferSize Get allocated frame buffer size to hold the CCD image frame.

Returns
allocated frame buffer size to hold the CCD image frame.

Definition at line 176 of file indiccdchip.h.

◆ getFrameType()

CCD_FRAME INDI::CCDChip::getFrameType ( ) const
inline

isInterlaced

Returns
True if CCD chip is Interlaced, false otherwise.

getFrameType

Returns
CCD Frame type

Definition at line 249 of file indiccdchip.h.

◆ getFrameTypeName()

const char * INDI::CCDChip::getFrameTypeName ( CCD_FRAME  fType)

getFrameTypeName returns CCD Frame type name

Parameters
fTypetype of frame
Returns
CCD Frame type name

Definition at line 231 of file indiccdchip.cpp.

◆ getImageExtension()

char* INDI::CCDChip::getImageExtension ( )
inline
Returns
Return image extension (fits, jpeg, raw..etc)

Definition at line 391 of file indiccdchip.h.

◆ getNAxis()

int INDI::CCDChip::getNAxis ( ) const
Returns
Get number of FITS axis in image. By default 2

Definition at line 269 of file indiccdchip.cpp.

◆ getPixelSizeX()

float INDI::CCDChip::getPixelSizeX ( ) const
inline

getPixelSizeX Get horizontal pixel size in microns.

Returns
horizontal pixel size in microns.

Definition at line 149 of file indiccdchip.h.

◆ getPixelSizeY()

float INDI::CCDChip::getPixelSizeY ( ) const
inline

getPixelSizeY Get vertical pixel size in microns.

Returns
vertical pixel size in microns.

Definition at line 158 of file indiccdchip.h.

◆ getSubH()

int INDI::CCDChip::getSubH ( ) const
inline

getSubH Get the height of the frame

Returns
unbinned height of the frame
Examples
simpleccd.cpp.

Definition at line 122 of file indiccdchip.h.

◆ getSubW()

int INDI::CCDChip::getSubW ( ) const
inline

getSubW Get the width of the frame

Returns
unbinned width of the frame
Examples
simpleccd.cpp.

Definition at line 113 of file indiccdchip.h.

◆ getSubX()

int INDI::CCDChip::getSubX ( ) const
inline

getSubX Get the starting left coordinates (X) of the frame.

Returns
the starting left coordinates (X) of the image.

Definition at line 95 of file indiccdchip.h.

◆ getSubY()

int INDI::CCDChip::getSubY ( ) const
inline

getSubY Get the starting top coordinates (Y) of the frame.

Returns
the starting top coordinates (Y) of the image.

Definition at line 104 of file indiccdchip.h.

◆ getXRes()

int INDI::CCDChip::getXRes ( ) const
inline

getXRes Get the horizontal resolution in pixels of the CCD Chip.

Returns
the horizontal resolution of the CCD Chip.
Examples
simpleccd.cpp.

Definition at line 77 of file indiccdchip.h.

◆ getYRes()

int INDI::CCDChip::getYRes ( ) const
inline

Get the vertical resolution in pixels of the CCD Chip.

Returns
the horizontal resolution of the CCD Chip.
Examples
simpleccd.cpp.

Definition at line 86 of file indiccdchip.h.

◆ isCompressed()

bool INDI::CCDChip::isCompressed ( ) const
inline

isCompressed

Returns
True if frame is compressed, false otherwise.

Definition at line 231 of file indiccdchip.h.

◆ isExposing()

bool INDI::CCDChip::isExposing ( ) const
inline
Returns
True if CCD is currently exposing, false otherwise.

Definition at line 399 of file indiccdchip.h.

◆ openFITSFile()

bool INDI::CCDChip::openFITSFile ( uint32_t  size,
int &  status 
)

openFITSFile Allocate memory buffer for internal FITS file structure and open

Parameters
FITSerror code in case an error happens. an in-memory FITS file as a Shared BLOB.
Returns
True if successful, false otherwise.

Definition at line 40 of file indiccdchip.cpp.

◆ setBin()

void INDI::CCDChip::setBin ( uint8_t  hor,
uint8_t  ver 
)

setBin Set CCD Chip binnig

Parameters
horHorizontal binning.
verVertical binning.

Definition at line 127 of file indiccdchip.cpp.

◆ setBPP()

void INDI::CCDChip::setBPP ( uint8_t  bpp)

setBPP Set depth of CCD chip.

Parameters
bppbits per pixel

Definition at line 180 of file indiccdchip.cpp.

◆ setCompressed()

void INDI::CCDChip::setCompressed ( bool  cmp)

setCompressed Set whether a frame is compressed after exposure?

Parameters
cmpIf true, compress frame.

◆ setExposureComplete()

void INDI::CCDChip::setExposureComplete ( )

setExposureComplete Mark exposure as complete by setting ImageExposure property to IPS_OK

Definition at line 218 of file indiccdchip.cpp.

◆ setExposureDuration()

void INDI::CCDChip::setExposureDuration ( double  duration)

setExposureDuration Set desired CCD frame exposure duration for next exposure. You must call this function immediately before starting the actual exposure as it is used to calculate the timestamp used for the FITS header.

Parameters
durationexposure duration in seconds.
Examples
simpleccd.cpp.

Definition at line 225 of file indiccdchip.cpp.

◆ setExposureFailed()

void INDI::CCDChip::setExposureFailed ( )

setExposureFailed Alert the client that the exposure failed.

Definition at line 263 of file indiccdchip.cpp.

◆ setExposureLeft()

void INDI::CCDChip::setExposureLeft ( double  duration)

setExposureLeft Update exposure time left. Inform the client of the new exposure time left value.

Parameters
durationexposure duration left in seconds.
Examples
simpleccd.cpp.

Definition at line 211 of file indiccdchip.cpp.

◆ setFrame()

void INDI::CCDChip::setFrame ( uint32_t  subx,
uint32_t  suby,
uint32_t  subw,
uint32_t  subh 
)

setFrame Set desired frame resolutoin for an exposure.

Parameters
subxLeft position.
subyTop position.
subwunbinned width of the frame.
subhunbinned height of the frame.

Definition at line 112 of file indiccdchip.cpp.

◆ setFrameBuffer()

void INDI::CCDChip::setFrameBuffer ( uint8_t *  buffer)
inline

setFrameBuffer Set raw frame buffer pointer.

Parameters
bufferpointer to frame buffer /note CCD Chip allocates the frame buffer internally once SetFrameBufferSize is called with allocMem set to true which is the default behavior. If you allocated the memory yourself (i.e. allocMem is false), then you must call this function to set the pointer to the raw frame buffer.

Definition at line 222 of file indiccdchip.h.

◆ setFrameBufferSize()

void INDI::CCDChip::setFrameBufferSize ( uint32_t  nbuf,
bool  allocMem = true 
)

setFrameBufferSize Set desired frame buffer size. The function will allocate memory accordingly. The frame size depends on the desired frame resolution (Left, Top, Width, Height), depth of the CCD chip (bpp), and binning settings. You must set the frame size any time any of the prior parameters gets updated.

Parameters
nbufsize of buffer in bytes.
allocMemif True, it will allocate memory of nbut size bytes.
Examples
simpleccd.cpp.

Definition at line 189 of file indiccdchip.cpp.

◆ setFrameType()

void INDI::CCDChip::setFrameType ( CCD_FRAME  type)

setFrameType Set desired frame type for next exposure.

Parameters
typedesired CCD frame type.

Definition at line 85 of file indiccdchip.cpp.

◆ setImageExtension()

void INDI::CCDChip::setImageExtension ( const char *  ext)

setImageExtension Set image exntension

Parameters
extextension (fits, jpeg, raw..etc)

Definition at line 279 of file indiccdchip.cpp.

◆ setMinMaxStep()

void INDI::CCDChip::setMinMaxStep ( const char *  property,
const char *  element,
double  min,
double  max,
double  step,
bool  sendToClient = true 
)

setMinMaxStep for a number property element

Parameters
propertyProperty name
elementElement name
minMinimum element value
maxMaximum element value
stepElement step value
sendToClientIf true (default), the element limits are updated and is sent to the client. If false, the element limits are updated without getting sent to the client.

Definition at line 138 of file indiccdchip.cpp.

◆ setNAxis()

void INDI::CCDChip::setNAxis ( int  value)

setNAxis Set FITS number of axis

Parameters
valuenumber of axis

Definition at line 274 of file indiccdchip.cpp.

◆ setPixelSize()

void INDI::CCDChip::setPixelSize ( double  x,
double  y 
)

setPixelSize Set CCD Chip pixel size

Parameters
xHorziontal pixel size in microns.
yVertical pixel size in microns.

Definition at line 168 of file indiccdchip.cpp.

◆ setResolution()

void INDI::CCDChip::setResolution ( uint32_t  x,
uint32_t  y 
)

setResolution set CCD Chip resolution

Parameters
xwidth
yheight

Definition at line 90 of file indiccdchip.cpp.

Friends And Related Function Documentation

◆ CCD

friend class CCD
friend

Definition at line 539 of file indiccdchip.h.

◆ StreamRecoder

friend class StreamRecoder
friend

Definition at line 540 of file indiccdchip.h.


The documentation for this class was generated from the following files: