Operator Console
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Public Attributes | Protected Attributes | List of all members
ImatestLibAcq Class Reference

A class for acquiring live images through the Imatest library. More...

#include <ImatestLibAcquireImage.h>

Inheritance diagram for ImatestLibAcq:
[legend]

Public Member Functions

 ImatestLibAcq (void)
 
 ~ImatestLibAcq (void)
 
bool CaptureFrame ()
 capture a single frame into m_buf More...
 
bool Close ()
 
bool Open ()
 
 ImatestLibAcq (void)
 
 ~ImatestLibAcq (void)
 
bool CaptureFrame ()
 capture a single image into m_buf More...
 
bool Close ()
 
bool Open ()
 
 ImatestLibAcq (void)
 
 ~ImatestLibAcq (void)
 
bool CaptureFrame ()
 capture a single frame into m_buf More...
 
bool Close ()
 
bool Open ()
 
 ImatestLibAcq (void)
 
 ~ImatestLibAcq (void)
 
bool CaptureFrame ()
 capture a single image into m_buf More...
 
bool Close ()
 
bool Open ()
 
- Public Member Functions inherited from ImageAcquisition
 ImageAcquisition (void)
 
virtual ~ImageAcquisition (void)
 
void GetFrame (void *buf)
 
virtual bool Init (int width, int height, int bytesPerPixel=4)
 may be overridden, but be sure to call parent function also More...
 
unsigned int BytesPerFrame ()
 
unsigned int PixelsPerFrame ()
 
int GetHeight ()
 
CString & GetInfo ()
 
int GetWidth ()
 
void SetHeight (int height)
 
void SetWidth (int width)
 
 ImageAcquisition (void)
 
virtual ~ImageAcquisition (void)
 
void GetFrame (void *buf)
 
virtual bool Init (int width, int height, int bytesPerPixel=4)
 may be overridden, but be sure to call parent function also More...
 
unsigned int BytesPerFrame ()
 
unsigned int PixelsPerFrame ()
 
int GetHeight ()
 
CString & GetInfo ()
 
int GetWidth ()
 
void SetHeight (int height)
 
void SetWidth (int width)
 

Public Attributes

int m_source_ID
 The source ID for acquire_image() that indicates what type of device is in use. More...
 
int m_device_ID
 [Used Epiphan only]: indicates from which of the two sources to capture More...
 
std::string m_ini_file
 The fully-qualified name (including full path) of an Imatest INI file. More...
 
- Public Attributes inherited from ImageAcquisition
int m_source_ID
 The source ID for acquire_image() that indicates what type of device is in use. More...
 
int m_device_ID
 [Used Epiphan only]: indicates from which of the two sources to capture More...
 
std::string m_ini_file
 The fully-qualified name (including full path) of an Imatest INI file. More...
 

Protected Attributes

int m_numCameras
 
int m_cameraIndex
 
bool m_inited
 A boolean that is TRUE if the camera has been initialized. More...
 
- Protected Attributes inherited from ImageAcquisition
CriticalBuf m_frame
 shared memory to hold copy of current frame More...
 
int m_width
 width of image in pixels More...
 
int m_height
 height of image in pixels More...
 
unsigned int m_numBytes
 number of bytes in a frame More...
 
unsigned int m_numPixels
 number of pixels in a frame More...
 
CString m_logMsg
 error or information message More...
 
void * m_buf
 buffer to capture into More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ImageAcquisition
static UINT __cdecl ThreadProc (LPVOID param)
 
static UINT __cdecl ThreadProc (LPVOID param)
 

Detailed Description

A class for acquiring live images through the Imatest library.

Constructor & Destructor Documentation

ImatestLibAcq::ImatestLibAcq ( void  )
37 {
38  m_width = 0;
39  m_height = 0;
40  m_numBytes = 0;
41  m_numPixels = 0;
42  m_buf = NULL;
43  m_source_ID = 0;
44  m_device_ID = 0;
45  m_ini_file = "";
46 }
int m_source_ID
The source ID for acquire_image() that indicates what type of device is in use.
Definition: ImatestLibAcq.h:42
unsigned int m_numPixels
number of pixels in a frame
Definition: ImageAcquisition.h:56
int m_device_ID
[Used Epiphan only]: indicates from which of the two sources to capture
Definition: ImatestLibAcq.h:43
unsigned int m_numBytes
number of bytes in a frame
Definition: ImageAcquisition.h:55
int m_height
height of image in pixels
Definition: ImageAcquisition.h:54
std::string m_ini_file
The fully-qualified name (including full path) of an Imatest INI file.
Definition: ImatestLibAcq.h:44
void * m_buf
buffer to capture into
Definition: ImageAcquisition.h:58
int m_width
width of image in pixels
Definition: ImageAcquisition.h:53
ImatestLibAcq::~ImatestLibAcq ( void  )
50 {
51 }
ImatestLibAcq::ImatestLibAcq ( void  )
ImatestLibAcq::~ImatestLibAcq ( void  )
ImatestLibAcq::ImatestLibAcq ( void  )
ImatestLibAcq::~ImatestLibAcq ( void  )
ImatestLibAcq::ImatestLibAcq ( void  )
ImatestLibAcq::~ImatestLibAcq ( void  )

Member Function Documentation

bool ImatestLibAcq::CaptureFrame ( )
virtual

capture a single image into m_buf

Implements ImageAcquisition.

bool ImatestLibAcq::CaptureFrame ( )
virtual

capture a single image into m_buf

Implements ImageAcquisition.

bool ImatestLibAcq::CaptureFrame ( )
virtual

capture a single frame into m_buf

Implements ImageAcquisition.

84 {
85 
86  // This required parameter will hold return data.
87  mwArray out;
88  //mwArray nover;
89 
90  // Load our file in
91  //raw_pixels_char = load_raw_file(BLEMISH_RAW_FILE, &pixel_count);
92  mwArray im_orig, vstr;
93 
94  mwArray source_id((mxDouble)m_source_ID);
95 
96  mwArray toRGBrows = mwArray(1,1,mxDOUBLE_CLASS);
97  toRGBrows=1.0;// by being TRUE we call for the image to be in column major format
98 
99  mwArray deviceID((mxDouble)m_device_ID);// select which source we are using
100 
101  mwArray ini_file(m_ini_file.c_str()); // the Omnivision part of acquire_image needs to read from
102  // the correct imatest.ini file
103  //const double varArgIn[] = {1.0, 1.0};
104  mwArray vararginParam = mwArray(1,2,mxCELL_CLASS);
105  vararginParam.Get(1,1).Set(toRGBrows);
106 
107  if ( m_source_ID == 2)
108  {
109  vararginParam.Get(1,2).Set(ini_file); // Path to INI file
110  }
111  else
112  {
113  vararginParam.Get(1,2).Set(deviceID); // 16bit RAW data
114  }
115 
116  try
117  {
118  acquire_image(2, im_orig, vstr, source_id, vararginParam);
119  }
120  catch (const mwException& e)
121  {
122  cout << "Run Error!" << endl;
123  cerr << e.what() << endl;
124  }
125 
126  //im_orig.GetData((mxUint64*)m_buf,(mwSize)im_orig.ElementSize());
127  mwSize dataSize = im_orig.NumberOfElements();
128 
129  im_orig.GetData((mxUint8*)m_buf, dataSize);
130 
131 
132 
133  //m_buf = (char*)mxGetPr(im_orig);
134  //doCapture(m_cameraIndex);
135 
136  //while (!isCaptureDone(m_cameraIndex)) // captures into m_buf
137  //{
138  // Sleep(1);
139  //}
140 
141  return true;
142 }
int m_source_ID
The source ID for acquire_image() that indicates what type of device is in use.
Definition: ImatestLibAcq.h:42
int m_device_ID
[Used Epiphan only]: indicates from which of the two sources to capture
Definition: ImatestLibAcq.h:43
std::string m_ini_file
The fully-qualified name (including full path) of an Imatest INI file.
Definition: ImatestLibAcq.h:44
void * m_buf
buffer to capture into
Definition: ImageAcquisition.h:58
bool ImatestLibAcq::CaptureFrame ( )
virtual

capture a single frame into m_buf

Implements ImageAcquisition.

bool ImatestLibAcq::Close ( )
virtual

Implements ImageAcquisition.

bool ImatestLibAcq::Close ( )
virtual

Implements ImageAcquisition.

bool ImatestLibAcq::Close ( )
virtual

Implements ImageAcquisition.

bool ImatestLibAcq::Close ( )
virtual

Implements ImageAcquisition.

74 {
75  if (m_inited)
76  {
77  //deinitCapture(m_cameraIndex);
78  }
79 
80  return true;
81 }
bool m_inited
A boolean that is TRUE if the camera has been initialized.
Definition: ImatestLibAcq.h:40
bool ImatestLibAcq::Open ( )
virtual

Implements ImageAcquisition.

bool ImatestLibAcq::Open ( )
virtual

Implements ImageAcquisition.

bool ImatestLibAcq::Open ( )
virtual

Implements ImageAcquisition.

Referenced by COperatorConsoleApp::InitCamera().

54 {
55  //struct SimpleCapParams params;
56  bool success = false;
57 
58  m_inited = true;
59 
60  if (m_width == 0 || m_height == 0) // these get set in Init()
61  {
62  m_logMsg = "Unable to Open camera: width and height are not set.";
63  }
64  else
65  {
66  }
67 
68  return m_inited;
69 }
int m_height
height of image in pixels
Definition: ImageAcquisition.h:54
CString m_logMsg
error or information message
Definition: ImageAcquisition.h:57
int m_width
width of image in pixels
Definition: ImageAcquisition.h:53
bool m_inited
A boolean that is TRUE if the camera has been initialized.
Definition: ImatestLibAcq.h:40

Here is the caller graph for this function:

bool ImatestLibAcq::Open ( )
virtual

Implements ImageAcquisition.

Member Data Documentation

int ImatestLibAcq::m_cameraIndex
protected
int ImatestLibAcq::m_device_ID

[Used Epiphan only]: indicates from which of the two sources to capture

Referenced by COperatorConsoleApp::InitCamera(), and COperatorConsoleApp::OnSetup().

std::string ImatestLibAcq::m_ini_file

The fully-qualified name (including full path) of an Imatest INI file.

Referenced by COperatorConsoleApp::InitCamera(), and COperatorConsoleApp::OnSetup().

bool ImatestLibAcq::m_inited
protected

A boolean that is TRUE if the camera has been initialized.

int ImatestLibAcq::m_numCameras
protected
int ImatestLibAcq::m_source_ID

The source ID for acquire_image() that indicates what type of device is in use.

Referenced by COperatorConsoleApp::InitCamera(), and COperatorConsoleApp::OnSetup().


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