cisst-saw
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
svlSampleTargets.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /* ex: set filetype=cpp softtabstop=4 shiftwidth=4 tabstop=4 cindent expandtab: */
3 
4 /*
5 
6  Author(s): Balazs Vagvolgyi
7  Created on: 2010
8 
9  (C) Copyright 2006-2010 Johns Hopkins University (JHU), All Rights
10  Reserved.
11 
12 --- begin cisst license - do not edit ---
13 
14 This software is provided "as is" under an open source license, with
15 no warranty. The complete license can be found in license.txt and
16 http://www.cisst.org/cisst/license.txt.
17 
18 --- end cisst license ---
19 
20 */
21 
22 #ifndef _svlSampleTargets_h
23 #define _svlSampleTargets_h
24 
26 
27 // Always include last!
29 
30 
32 {
34 
35 public:
37  svlSampleTargets(const svlSampleTargets & other);
39 
40  svlSample* GetNewInstance() const;
41  svlStreamType GetType() const;
42  int SetSize(const svlSample* sample);
43  int SetSize(const svlSample& sample);
44  int CopyOf(const svlSample* sample);
45  int CopyOf(const svlSample& sample);
46  bool IsInitialized() const;
47  unsigned char* GetUCharPointer();
48  const unsigned char* GetUCharPointer() const;
49  unsigned int GetDataSize() const;
50  void SerializeRaw(std::ostream & outputStream) const;
51  void DeSerializeRaw(std::istream & inputStream);
52 
53  svlSampleTargets(unsigned int dimensions, unsigned int maxtargets, unsigned int channels);
54  void SetSize(unsigned int dimensions, unsigned int maxtargets, unsigned int channels);
55  void SetDimensions(unsigned int dimensions);
56  unsigned int GetDimensions() const;
57  void SetMaxTargets(unsigned int maxtargets);
58  unsigned int GetMaxTargets() const;
59  void SetChannels(unsigned int channels);
60  unsigned int GetChannels() const;
61 
62  vctDynamicVectorRef<int> GetFlagVectorRef();
63  const vctDynamicConstVectorRef<int> GetFlagVectorRef() const;
64  vctDynamicVectorRef<int> GetConfidenceVectorRef(unsigned int channel = 0);
65  const vctDynamicConstVectorRef<int> GetConfidenceVectorRef(unsigned int channel = 0) const;
66  vctDynamicMatrixRef<int> GetPositionMatrixRef(unsigned int channel = 0);
67  const vctDynamicConstMatrixRef<int> GetPositionMatrixRef(unsigned int channel = 0) const;
68  int* GetFlagPointer();
69  const int* GetFlagPointer() const;
70  int* GetConfidencePointer(unsigned int channel = 0);
71  const int* GetConfidencePointer(unsigned int channel = 0) const;
72  int* GetPositionPointer(unsigned int channel = 0);
73  const int* GetPositionPointer(unsigned int channel = 0) const;
74  void ResetTargets();
75 
76  void SetFlag(unsigned int targetid, int value);
77  int GetFlag(unsigned int targetid) const;
78  void SetConfidence(unsigned int targetid, int value, unsigned int channel = 0);
79  int GetConfidence(unsigned int targetid, unsigned int channel = 0) const;
80  void SetPosition(unsigned int targetid, const vctInt2& value, unsigned int channel = 0);
81  void SetPosition(unsigned int targetid, const vctInt3& value, unsigned int channel = 0);
82  int GetPosition(unsigned int targetid, vctInt2& value, unsigned int channel = 0) const;
83  int GetPosition(unsigned int targetid, vctInt3& value, unsigned int channel = 0) const;
84 
85 protected:
86  unsigned int Channels;
87  unsigned int Dimensions;
89 };
90 
92 
93 #endif // _svlSampleTargets_h
94 
#define CISST_EXPORT
Definition: cmnExportMacros.h:50
virtual svlSample * GetNewInstance() const =0
svlStreamType
Definition: svlDefinitions.h:193
Dynamic vector referencing existing memory (const)
Definition: vctDynamicConstVectorRef.h:79
#define CMN_DECLARE_SERVICES_INSTANTIATION_EXPORT(className)
Definition: cmnClassRegisterMacros.h:209
virtual svlStreamType GetType() const =0
virtual int CopyOf(const svlSample *sample)=0
Dynamic vector referencing existing memory.
Definition: vctDynamicVectorRef.h:77
virtual unsigned char * GetUCharPointer()=0
unsigned int Channels
Definition: svlSampleTargets.h:86
virtual unsigned int GetDataSize() const =0
Dynamic matrix referencing existing memory.
Definition: vctDynamicMatrixRef.h:74
svlSample & operator=(const svlSample &other)
virtual void SerializeRaw(std::ostream &outputStream) const =0
virtual int SetSize(const svlSample *sample)=0
Dynamic matrix referencing existing memory (const)
Definition: vctDynamicConstMatrixRef.h:79
virtual void DeSerializeRaw(std::istream &inputStream)=0
Macros to export the symbols of cisstStereoVision (in a Dll).
#define CMN_DECLARE_SERVICES(hasDynamicCreation, lod)
Definition: cmnClassRegisterMacros.h:116
unsigned int Dimensions
Definition: svlSampleTargets.h:87
Definition: svlSampleTargets.h:31
virtual bool IsInitialized() const
const int CMN_DYNAMIC_CREATION
Definition: cmnClassRegisterMacros.h:331
vctDynamicMatrix< int > Matrix
Definition: svlSampleTargets.h:88
#define CMN_LOG_ALLOW_DEFAULT
Definition: cmnLogLoD.h:76
Definition: svlSample.h:31