1 Unibrain Fire-i X™ SDK documentation Programmer’s Manual
10 End If The above code fragment will iterate through the connected cameras, and stop at the first camera that is made by Unibrain. With the additi
11 If the user didn’t select a camera, the SelectCamera call will return False, in which case we exit the application. The FireiGUID object is const
12 The available choice will of course vary depending on which camera this is called upon; only supported formats will be presented. Also, the above
13 Me.Caption = Camera.FriendlyName Me.Icon = Camera.Icon This will change the form caption to look like: By default, the Fire-iX SDK will
14 Dim FeaturesEnum As EnumFireiXFeatures Set FeaturesEnum = Camera.GetFeaturesEnumerator(True, fgAll) Do While FeaturesEnum.Next(Feature) If Feature
15 Firstly, we enlarge our form, to make way for the new controls: Then, we add the two controls. It is also a good idea to change their correspondi
16 Do While FeaturesEnum.Next(Feature) = True FeaturesList.AddItem Feature.Name Loop Set FeaturesEnum = Nothing Set Feature = Nothing This takes car
17 Now we can safely override the FrameReceived event: Private Sub Camera_FrameReceived(ByVal Frame As FireiXLibCtl.IFireiXFrame) End Sub As shown a
18 NOTE: The aliasing of the drawn lines and text is due to the enlargement of the picture in order for it to fit in our selected preview control. Th
19 h = StreamFormat.UserDefined.MaxHeight StreamFormat.UserDefined.SetROI 0, 0, w, h Camera.StreamFormat = StreamFormat Set StreamFormat = Nothing I
2 Table of ContentsTABLE OF CONTENTS ... 2 INTRODUCTION ...
20 Reference In the following reference of all interfaces implemented, “Long” is defined as a 32-bit signed integer value, and “Integer” is defined a
21 Visual Basic 6.0 syntax FireiXPreviewCtrl1.AttachCamera Camera C++ syntax HRESULT hr = pIPreviewCtrl1->AttachCamera(pICamera); LeftClick event
22 FireiGUID The FireiGUID object is a helper object, making the camera GUID easier to manipulate, store and retrieve. It can be constructed directly
23 Comments The FromString method can be used to initialize a FireiGUID object with an 8-byte GUID represented as a string, with each byte being repr
24 FireiXManager The FireiXManager object is the starting point for the selection and construction of cameras. It itself can be constructed either di
25 The dialog presented looks similar to: The method returns True if a selection was made by the user and False if “Cancel” was pressed (no selectio
26 Comments This method constructs a FireiXCamera object and returns it, given an Index number. This number must be less than GetNumOfConnectedCamera
27 It is also mated to the SelectCamera method, as the FireiGUID returned by that method can be passed directly in GetCameraFromGUID to create the se
28 FireiXRegister The FireiXRegister object is a helper object designed to make reading and writing values contained in a 4-byte register easy. It ca
29 the field. So for instance, the examples below, which define a field of length of 3 bits can store a value from 0 to 7. If a value of 8 or greater
3 HasManual property ... 61 MinValue property ... 61 MaxValue proper
30 FireiXTrigger The FireiXTrigger object encapsulates all the Trigger functionality that the camera may support. An instance cannot be constructed d
31 C++ syntax VARIANT_BOOL bOn; HRESULT hr = pITrigger->get_Enabled(&bOn); //get hr = pITrigger ->put_Enabled(bOn); //set Polarit
32 Value property Prototype Boolean Value Comments This is a read only property that reflects the Trigger_Value field of the camera trigger control r
33 IsSupported property Prototype Boolean IsSupported Comments This is a read only property that reflects the Presence_Inq field of the camera trigge
34 HasOnOff property Prototype Boolean HasOnOff Comments This is a read only property that reflects the On/Off_Inq field of the camera trigger inquir
35 Parameter property Prototype Integer Parameter Comments This property reads/sets the Parameter field of the camera trigger control register (bits
36 Supported = Trigger.IsModeSupported(tmMode_0) C++ syntax VARIANT_BOOL bSupported; HRESULT hr = pITrigger->get_IsModeSupported(tmMode_0, &bS
37 FireiXStreamFormat The FireiXStreamFormat object encapsulates the video format settings relevant a given camera. A FireiXStreamFormat object insta
38 pfYUV_422, pfYUV_444, pfRGB_24, pfY_MONO_16, pfRGB_48, pfS_Y_MONO_16, pfS_RGB_48, pfRAW_8, pfRAW_16 Visual Basic 6.0 syntax Dim PixelFormat As Fir
39 Resolution = StreamFormat.Resolution C++ syntax FireiXResolution Resolution; HRESULT hr = pIStreamFormat->get_Resolution(&Resolution); IsUs
4 Introduction The Fire-iX SDK is the latest addition to ubCore™ and the Unibrain APIs. It provides an entirely new and comprehensive way to interact
40 Comments This is a read only property that returns a textual representation of the FireiXStreamFormat. The text contains the pixel format and the
41 Comments This is a read only property that returns the associated FireiXFixedStreamFormat object with this FireiXStreamFormat. It is only valid if
42 rmAuto, rmNone, rmRGGB, rmGRBG, rmGBRG, rmBGGR Visual Basic 6.0 syntax Dim RawMode As FireiXRawMode RawMode = StreamFormat.RawModeOverride
43 Save method Prototype Save() Comments This method sets this FireiXStreamFormat to the camera, including any selected attributes, whether Fixed or
44 FireiXFixedStreamFormat The FireiXFixedStreamFormat object is derived from FireiXStreamFormat. It carries any additional functionality that pertai
45 Comments This is a read/write property that can be used to retrieve or set the frame rate of the FireiXFixedStreamFormat. It is represented by an
46 Comments This is a read only property that returns the resolution height of the streaming format. This will be constant between successive reads,
47 Description property Prototype String Description Comments This is a read only property that returns a textual representation of the FireiXFixedSt
48 Save method Prototype Save() Comments This method sets this FireiXFixedStreamFormat to the camera, including the selected frame rate. If for some
49 FireiXUserDefinedStreamFormat The FireiXUserDefinedStreamFormat object is derived from FireiXStreamFormat. It carries any additional functionality
5 Technical Details Architecture The following illustration shows how the various Unibrain APIs interact with each other, and how they are abstracted
50 Comments This is a read only property that can be used to read the currently set top coordinate of the Region of Interest set in the FireiXUserDef
51 Height property Prototype Integer Height Comments This is a read only property that can be used to read the currently set height of the Region of
52 HRESULT hr = pIUserDefined->get_MaxHeight(&shMaxHeight); HorizontalPositionUnit property Prototype Integer HorizontalPositionUnit Comments
53 C++ syntax SHORT shWUnit; HRESULT hr = pIUserDefined->get_WidthUnit(&shWUnit); HeightUnit property Prototype Integer HeightUnit Comments Th
54 PacketSizeUnit = UserDefined.PacketSizeUnit C++ syntax LONG lPacketSizeUnit; HRESULT hr = pIUserDefined->get_PacketSizeUnit(&lPacketSizeUni
55 C++ syntax BSTR Description; HRESULT hr = pIUserDefined->get_Description(&Description); SetROI method Prototype Boolean SetROI( IN Integer
56 This is useful in those cases where the camera reported acceptable values are not 100% correct. For instance, even though theoretically a camera s
57 EnumFireiXStreamFormats The EnumFireiXStreamFormats enumerator can be used to iterate between a set of FireiXStreamFormat objects. It cannot be co
58 FireiXFeature The FireiXFeature object encapsulates all functionality related to a camera feature. It contains all the information available throu
59 If this property is False, no other property or method of FireiXFeature should be called, otherwise an error would occur. Visual Basic 6.0 syntax
6 Installation No specific installation of Fire-iX SDK is necessary. It is included with both ubCore Setup and Firei MS Stack Setup. The FireiX.dll m
60 CanRead property Prototype Boolean CanRead Comments This is a read-only property that will return whether this FireiXFeature supports reading its
61 Visual Basic 6.0 syntax Dim HasAuto As Boolean HasAuto = Feature.HasAuto C++ syntax VARIANT_BOOL bHasAuto; HRESULT hr = pIFeature->get_HasAuto(
62 Comments This is a read-only property that will return the maximum value that can be set to this FireiXFeature, through the Value property. Visual
63 C++ syntax VARIANT_BOOL bEnabled; HRESULT hr = pIFeature->get_Enabled(&bEnabled); //get hr = pIFeature->put_Enabled(VARIANT_TRUE);
64 HasSoftAbsolute property Prototype Boolean HasSoftAbsolute Comments This is a read-only property that will return whether this FireiXFeature suppo
65 Comments This is a read/write property that will retrieve or set the value of the feature through a textual representation of it. The string will
66 MaxValueString = Feature.MaxValueString C++ syntax BSTR MaxValueString; HRESULT hr = pIFeature->get_MaxValueString(&MaxValueString); Unit p
67 Visual Basic 6.0 syntax Dim Value As Single Value = Feature.AbsoluteValue 'get Feature.Value = Feature.AboluteValue 'set C+
68 Reload method Prototype Reload() Comments This method can be used to read the current value and absolute value (if applicable, along with the mini
69 EnumFireiXFeatures The EnumFireiXFeatures enumerator can be used to iterate between a set of FireiXFeature objects. It cannot be constructed direc
7 Usage Scenario I – Simple video viewer Let’s start Visual Basic 6.0. Create a new empty project, of the “Standard EXE” variety: This should produc
70 FireiXFrame The FireiXFrame object contains a single camera frame, allowing the programmer to read and write the image data pixel by pixel. It als
71 GetRGB method Prototype GetRGB( IN Integer X, IN Integer Y, OUT Byte Red, OUT Byte Green, OUT Byte Blue ) Comments This method returns the color v
72 SaveToFile method Prototype Long SaveToFile(IN String Filename) Comments This method will save the contents of the FireiXFrame to disk, as a regul
73 Negative method Prototype Negative() Comments This method will invert the color information of the frame. The result will be similar to a photogra
74 Visual Basic 6.0 syntax Frame.DrawLine 0, 0, 50, 50, 0 C++ syntax HRESULT hr = pIFrame->DrawLine(0, 0, 50, 50, 0); DrawString method Prototype
75 The coordinates defined by the 4 parameters given must reside in the frame boundaries, otherwise an error will occur. Visual Basic 6.0 syntax Fram
76 The coordinates given as the 2 parameters must reside in the frame boundaries, otherwise an error will occur. Visual Basic 6.0 syntax Frame.DrawSt
77 FireiXCamera The FireiXCamera object encapsulates all functionality pertaining to the camera itself; therefore it could be considered to be the “c
78 Model property Prototype String Model Comments This is a read-only property that can be used to retrieve the model name of the camera, as a string
79 HRESULT hr = pICamera->get_FriendlyName(&FriendlyName); StreamFormat property Prototype FireiXStreamFormat StreamFormat Comments This is a
8 This will bring up the components selection dialog of VB. In the “Controls” tab, select the “FireiX 1.0 Type Library” and click on OK: This will ad
80 Comments This is a read-only property that can be used to retrieve directly the FireiXFeature object for the AutoExposure feature of the camera. V
81 Comments This is a read-only property that can be used to retrieve directly the FireiXFeature object for the Iris feature of the camera. Visual Ba
82 Comments This is a read-only property that can be used to retrieve directly the FireiXFeature object for the Hue feature of the camera. Visual Bas
83 Comments This is a read-only property that can be used to retrieve directly the FireiXFeature object for the Zoom feature of the camera. Visual Ba
84 Comments This is a read-only property that can be used to retrieve directly the FireiXFeature object for the Gamma feature of the camera. Visual B
85 The three implemented algorithms are ordered “Best Performance → Best Quality”. rcBilinearInterpolation is the default setting. Please note that
86 Comments This is a read/write property that can be used to retrieve or set any command register of the camera, given its offset as a parameter. As
87 Comments This is a read-only property that can be used to retrieve the number of available memory presets of the camera. If this number is 0, the
88 If on the other hand the DirectShow API is currently running, the dialog will look similar to: Upon the return of the method, the streaming format
89 Visual Basic 6.0 syntax Camera.AttachPreviewCtrl FireiXPreviewCtrl1 C++ syntax HRESULT hr = pICamera->AttachPreviewCtrl(pIFireiXPreviewCtrl); R
9 VB automatically sets the name of the object to be “FireiXPreviewCtrl1”, which for our purpose will do nicely. Now it’s time to edit the form code.
90 IsRunning method Prototype Boolean IsRunning() Comments This method will return whether the camera is currently running. Please note that IsRunnin
91 Comments This method when called will bring up a “Display Properties” dialog for the camera. This dialog can then be used to set the various featu
92 Visual Basic 6.0 syntax Dim Supported As Boolean Supported = Camera.IsFeatureSupported("Shutter") C++ syntax VARIANT_BOOL bSupported; HR
93 GetCurrentResolution method Prototype GetCurrentResolution(OUT Integer Width, OUT Integer Height) Comments This method will return (by reference)
94 Comments This method will save all current features to a memory preset channel on the camera. Since channel 0 is reserved for the camera default v
95 Visual Basic 6.0 syntax Camera.SaveToXML "c:\settings.xml" C++ syntax HRESULT hr = pICamera->SaveToXML(_T("c:\settings.xml"
96 RetrieveStreamFormatFromIdentifier method Prototype FireiXStreamFormat RetrieveStreamFormatFromIdentifier( IN Long Identifier ) Comments This me
97 Comments This event is only ever fired once during the lifecycle of the FireiXCamera object, if the camera is physically removed from the system.
Komentáře k této Příručce