Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

327 lines
7.0 KiB

  1. /*++
  2. Copyright (c) 1997-1998 Microsoft Corporation
  3. Module Name:
  4. digita.h
  5. Abstract:
  6. FlashPoint Digita command language
  7. Notes:
  8. Non-portable, for use with Win32 environment.
  9. CDP == Camera Device Protocol
  10. Structure types , defined in this file are used to fill protocol buffer.
  11. It is important to keep packing option set to single byte setting.
  12. Author:
  13. Vlad Sadovsky (VladS) 11/13/1998
  14. Environment:
  15. User Mode - Win32
  16. Revision History:
  17. 11/13/1998 VladS Created
  18. --*/
  19. #if !defined( _DIGITA_H_ )
  20. #define _DIGITA_H_
  21. #if _MSC_VER > 1000
  22. #pragma once
  23. #endif
  24. #ifndef RC_INVOKED
  25. #include <pshpack1.h>
  26. #endif // RC_INVOKED
  27. //
  28. // Include files
  29. //
  30. #include <digitaer.h>
  31. //
  32. // Local definitions
  33. //
  34. #define INT16 short
  35. #define UINT16 unsigned short
  36. typedef INT32 TINT32 ;
  37. typedef UINT32 TUINT32 ;
  38. typedef INT16 TINT16;
  39. typedef UINT16 TUINT16;
  40. typedef UINT32 TBITFLAGS;
  41. typedef BYTE TPName[4];
  42. typedef BYTE TDOSName[16];
  43. typedef BYTE TString[32];
  44. //
  45. // Big-endian <-> little-endian Macro DEFINITIONS
  46. //
  47. // Camera software expects big-endian representation of numbers, so when we send
  48. // integers from x86 to it, we need to do a swap. Same applies to all integers
  49. // we receive from camera
  50. //
  51. #if defined(_X86_) || defined(_IA64_)
  52. #define LB8(b) (b)
  53. #define BL8(b) LB8(b)
  54. #define LB16(w) (((INT16)(HIBYTE(w))) | ((LOBYTE(w) << 8) & 0xFF00))
  55. #define BL16(w) LB16(w)
  56. #define LB32(l) (((INT32)(LB16(HIWORD(l)))) | ((INT32)(LB16(LOWORD(l))) << 16))
  57. #define BL32(l) LB32(l)
  58. #else
  59. #define LB8(b) (b)
  60. #define BL8(b) (b)
  61. #define LB16(w) (w)
  62. #define BL16(w) (w)
  63. #define LB32(l) (l)
  64. #define BL32(l) (l)
  65. #endif
  66. //
  67. // Protocol definitions
  68. //
  69. typedef struct {
  70. ULONG ulLength; // Length of the structure minus length of this field
  71. BYTE bVersion; // the version of the CDP packet
  72. CHAR cReserved[3]; // reserved
  73. SHORT shCommand; // the command
  74. SHORT shResult; // the result code
  75. } TCDPHeader;
  76. typedef struct {
  77. TCDPHeader sCDPHeader; // the header fields of the camera device protocol
  78. BYTE bData[1]; // this is the start of the data to be sent with the message
  79. } TCDP;
  80. //
  81. // Definitions
  82. //
  83. typedef enum {
  84. VTUInt = 1,
  85. VTInt = 2,
  86. VTFixed = 3,
  87. VTBool = 4,
  88. VTBitFlags = 5,
  89. VTPname = 6,
  90. VTDOSName = 7,
  91. VTString = 8,
  92. VTUIList = 9
  93. } TValueType;
  94. typedef struct {
  95. TPName Name;
  96. TValueType Type;
  97. union {
  98. UINT fUInt;
  99. INT fInt;
  100. UINT fFixed;
  101. BOOL fBool;
  102. UINT fBitFlags;
  103. TPName fPName;
  104. TDOSName fDOSName;
  105. TString fString;
  106. } Data;
  107. //PNameValue
  108. } PNameTypeValueStruct;
  109. //
  110. // Protocol command ranges
  111. //
  112. #define CDP_CMN_HOST2CAM_MIN 0x0000
  113. #define CDP_CMN_HOST2CAM_MAX 0x5fff
  114. #define CDP_PROD_HOST2CAM_MIN 0x6000
  115. #define CDP_PROD_HOST2CAM_MAX 0x6FFF
  116. #define CDP_TEST_HOST2CAM_MIN 0x7000
  117. #define CDP_TEST_HOST2CAM_MAX 0x7FFF
  118. #define CDP_RESRV_HOST2CAM_MIN 0x8000
  119. #define CDP_RESRV_HOST2CAM_MAX 0xFFFF
  120. //
  121. // Protocol command values
  122. //
  123. typedef enum {
  124. kCDPGetProductInfo = 0x0001,
  125. kCDPGetImageSpecifications = 0x0002,
  126. kCDPGetCameraStatus = 0x0003,
  127. kCDPSetProductInfo = 0x0005,
  128. kCDPGetCameraCapabilities = 0x0010,
  129. kCDPGetCameraState = 0x0011,
  130. kCDPSetCameraState = 0x0012,
  131. kCDPGetCameraDefaults = 0x0013,
  132. kCDPSetCameraDefaults = 0x0014,
  133. kCDPRestoreCameraStates = 0x0015,
  134. kCDPGetSceneAnalysis = 0x0018,
  135. kCDPGetPowerMode = 0x0019,
  136. kCDPSetPowerMode = 0x001a,
  137. kCDPGetS1Mode = 0x001d,
  138. kCDPSetS1Mode = 0x001e,
  139. kCDPStartCapture = 0x0030,
  140. kCDPGetFileList = 0x0040,
  141. kCDPGetNewFileList = 0x0041,
  142. kCDPGetFileData = 0x0042,
  143. kCDPEraseFile = 0x0043,
  144. kCDPGetStorageStatus = 0x0044,
  145. kCDPSetFileData = 0x0047,
  146. kCDPGetFileTag = 0x0048,
  147. kCDPSetUserFileTag = 0x0049,
  148. kCDPGetClock = 0x0070,
  149. kCDPSetClock = 0x0071,
  150. kCDPGetError = 0x0078,
  151. kCDPGetInterfaceTimeout = 0x0090,
  152. kCDPSetInterfaceTimeout = 0x0091,
  153. } TCDPHostToCameraNewCommands;
  154. typedef enum {
  155. kCHNoErr = 0x0000
  156. } TCHCommonErrorCodes;
  157. //
  158. // Properties names for product info
  159. //
  160. // Nb: defined as 4 byte-long packed string , always in lowercase
  161. //
  162. #define PI_FIRMWARE (UINT32)'fwc'
  163. #define PI_PRODUCTTYPEINFO (UINT32)'pti'
  164. #define PI_IPC (UINT32)'ipc'
  165. #define PI_CARV (UINT32)'carv'
  166. //
  167. // Public functions and types
  168. //
  169. //
  170. // GetImageSpecifications
  171. //
  172. typedef struct {
  173. // CCD Specifications
  174. TUINT32 CCDPattern;
  175. TUINT32 CCDPixelsHorz;
  176. TUINT32 CCDPixelsVert;
  177. TUINT32 CCDRingPixelsHorz;
  178. TUINT32 CCDRingPixelsVert;
  179. TUINT32 BadColumns;
  180. TUINT32 BadPixels;
  181. // Thumbnail specifications
  182. TUINT32 ThumbnailType;
  183. TUINT32 ThumbnailPixelsHorz;
  184. TUINT32 ThumbnailPixelsVert;
  185. TUINT32 ThumbnailFileSize;
  186. // Screennail specifications
  187. TUINT32 ScreennailType;
  188. TUINT32 ScreennailPixelsHorz;
  189. TUINT32 ScreennailPixelsVert;
  190. // Focus zone specifications
  191. TUINT32 FocusZoneType;
  192. TUINT32 FocusZoneNumHorz;
  193. TUINT32 FocusZoneNumVert;
  194. TUINT32 FocusZoneOriginHorz;
  195. TUINT32 FocusZoneOriginVert;
  196. TUINT32 FocusZoneSizeHorz;
  197. TUINT32 FocusZoneSizeVert;
  198. // Exposure zone specifications
  199. TUINT32 ExposureZoneType;
  200. TUINT32 ExposureZoneNumHorz;
  201. TUINT32 ExposureZoneNumVert;
  202. TUINT32 ExposureZoneOriginHorz;
  203. TUINT32 ExposureZoneOriginVert;
  204. TUINT32 ExposureZoneSizeHorz;
  205. TUINT32 ExposureZoneSizeVert;
  206. } TImageSpecifications;
  207. //
  208. // GetError
  209. //
  210. typedef struct {
  211. TUINT32 Date;
  212. TUINT32 Time;
  213. TINT32 ErrorCode;
  214. TString ErrorDescription;
  215. } TErrorData;
  216. //
  217. // GetCameraState
  218. //
  219. //
  220. // GetFileList
  221. //
  222. typedef enum {
  223. kFSDriveRAM = 1 , // internal RAM disk
  224. kFSDriveRemovable = 2 // removable disk
  225. } TDriveType;
  226. typedef struct {
  227. TUINT32 DriveNo;
  228. TString PathName;
  229. TDOSName DOSName;
  230. } TFileNameStruct;
  231. typedef struct {
  232. TUINT32 DriveNo;
  233. TString PathName;
  234. TDOSName DOSName;
  235. TUINT32 FileLength;
  236. TBITFLAGS FileStatus;
  237. } TFileItem;
  238. typedef struct {
  239. TUINT32 Offset; // Starting relative position of requested data
  240. TUINT32 Length; // Byte count of requested data
  241. TUINT32 FileSize; // Total size of the file
  242. } TPartialTag;
  243. typedef struct {
  244. TUINT32 DataSize; // Length of data returned
  245. TUINT32 Height; // Height in pixels
  246. TUINT32 Width; // Width in pixels
  247. TUINT32 Type; // Format of the data
  248. BYTE Data[1]; // Actual data
  249. } TThumbnailData;
  250. #ifndef RC_INVOKED
  251. #include <poppack.h>
  252. #endif // RC_INVOKED
  253. #endif // _DIGITA_H_