-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy path1394CameraControlSize.h
128 lines (109 loc) · 4.18 KB
/
1394CameraControlSize.h
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
/**\file 1394CameraControlSize.h
* \brief Declares C1394CameraControlSize
* \ingroup camfmr
*/
//////////////////////////////////////////////////////////////////////
//
// Version 6.4
//
// Copyright 8/2006
//
// Christopher Baker
// Robotics Institute
// Carnegie Mellon University
// Pittsburgh, PA
//
// Copyright 5/2000
//
// Iwan Ulrich
// Robotics Institute
// Carnegie Mellon University
// Pittsburgh, PA
//
// This file is part of the CMU 1394 Digital Camera Driver
//
// The CMU 1394 Digital Camera Driver is free software; you can redistribute
// it and/or modify it under the terms of the GNU Lesser General Public License
// as published by the Free Software Foundation; either version 2.1 of the License,
// or (at your option) any later version.
//
// The CMU 1394 Digital Camera Driver is distributed in the hope that it will
// be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with the CMU 1394 Digital Camera Driver; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//////////////////////////////////////////////////////////////////////
#ifndef __1394CAMERACONTROLSIZE_H__
#define __1394CAMERACONTROLSIZE_H__
class C1394Camera;
/**\brief Scalable Image Format (Format 7) Control Class
*
* This class does its best to manage and maintain internal consistency for
* format 7 video modes, though doing so is troublesome at best
*/
class CAMAPI C1394CameraControlSize
{
public:
C1394CameraControlSize(C1394Camera *pCamera);
~C1394CameraControlSize();
void GetSizeLimits(unsigned short *hMax, unsigned short *vMax);
void GetSizeUnits(unsigned short *hUnit, unsigned short *vUnit);
void GetSize(unsigned short *width, unsigned short *height);
int SetSize(unsigned short width, unsigned short height);
void GetPosLimits(unsigned short *hMax, unsigned short *vMax);
void GetPosUnits(unsigned short *hUnit, unsigned short *vUnit);
void GetPos(unsigned short *left, unsigned short *top);
int SetPos(unsigned short left, unsigned short top);
bool HasColorCode(COLOR_CODE code);
void GetColorCode(COLOR_CODE *code);
int SetColorCode(COLOR_CODE code);
void GetPixelsPerFrame(unsigned long *ppf);
void GetBytesPerFrame(unsigned long *lo32, unsigned long *hi32 = NULL);
void GetBytesPerPacketRange(unsigned short *min, unsigned short *max);
void GetBytesPerPacket(unsigned short *current, unsigned short *recommended = NULL);
void GetPacketsPerFrame(unsigned long *ppf);
int SetBytesPerPacket(unsigned short bpp);
void GetDataDepth(unsigned short *depth);
void GetColorFilter(unsigned short *filter);
void GetFrameInterval(float *interval);
bool CheckError1();
bool CheckError2();
private:
friend class C1394Camera; // the less ugly of the two to allow SetOffset
int SetOffset(unsigned long offset);
int UpdateStatic();
int UpdateTier1(BOOL SetValues = FALSE);
int UpdateTier2(BOOL SetValues = FALSE);
int SetValues();
// container camera
C1394Camera* m_pCamera;
// offset into the register space
unsigned long m_offset;
// static inquiry registers per mode
unsigned long m_InqMaxSize;
unsigned long m_InqUnitSize;
unsigned long m_InqColorCodes;
unsigned long m_InqUnitPos; //1.30
// tier 1 status registers, happiness will be reflected in Error 1
unsigned long m_StaImagePos;
unsigned long m_StaImageSize;
unsigned long m_StaColorCode;
unsigned long m_StaValueSetting; //1.30
// tier 1 inquiry registers, updated on change of some tier 1 status registers
unsigned long m_InqPixels;
unsigned long m_InqBytesHi;
unsigned long m_InqBytesLo;
unsigned long m_InqPacketParam;
unsigned long m_InqDataDepth; //1.31
unsigned long m_InqColorFilter; //1.31
// tier 2 status registers, happiness will be indicated in Error 2
unsigned long m_StaBytesPerPacket;
// tier 2 inquiry registers, updated on change of tier 2 status registers
unsigned long m_InqPacketsPerFrame; //1.30
unsigned long m_InqFrameInterval; //1.31
};
#endif // __1394CAMERACONTROLSIZE_H__