PDescriptor.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015-2018 Digital Barriers plc. All rights reserved.
3  * Contact: http://www.digitalbarriers.com/
4  *
5  * This file is part of the Papillon SDK.
6  *
7  * You can't use, modify or distribute any part of this file without
8  * the explicit written agreements of Digital Barriers.
9  */
10 
15 #pragma once
16 #include <PObject.h>
17 #include <PGuid.h>
18 
19 PAPILLON_BEGIN_NAMESPACE
20 
21 class PByteArray;
22 class PImage;
23 class PObjectType;
24 class PProperties;
25 
41 class PAPILLON_API_CORE PDescriptor : public PObject
42 {
43 public:
47  PDescriptor();
48 
52  PDescriptor(const PObjectType& objectType, const PGuid& describerId, const PGuid& descriptorId = PGuid::CreateUniqueId());
53 
57  PDescriptor(const PDescriptor& other);
58 
62  virtual ~PDescriptor();
63 
67  PDescriptor& operator=(const PDescriptor& other);
68 
72  bool operator==(const PDescriptor& other) const;
73 
77  void Reset();
78 
82  PObjectType GetObjectType() const;
83 
87  void SetObjectType(const PObjectType& objectType);
88 
93  const PGuid& GetDescribeId() const;
94 
98  void SetDescribeId(const PGuid& describeId);
99 
103  PString GetModelName() const;
104 
108  void SetModelName(const PString& modelName);
109 
113  const PGuid& GetDescriptorId() const;
114 
118  void SetDescriptorId(const PGuid& descriptorId);
119 
123  bool IsEmpty() const;
124 
129  void SetDataSource(const PByteArray & byteArray);
130 
135  void SetDataSourceAsPNGImage(const PImage& imageDataSource);
136 
141  void SetDataSourceAsJPGImage(const PImage& imageDataSource, papillon::int32 quality=95);
142 
147  PResult HasDataSource() const;
148 
153  PByteArray GetDataSource() const;
154 
159  PImage GetDataSourceAsImage() const;
160 
164  void RemoveDataSource();
165 
170  void SetDescriptor(const PByteArray& value);
171 
176  PResult GetDescriptor(PByteArray& value) const;
177 
181  void SetDescriptor(const PObject& object);
182 
187  PResult GetDescriptor(PObject& object) const;
188 
192  void SetDescriptorFormat(const PString& format);
193 
197  PString GetDescriptorFormat() const;
198 
206  PProperties GetPropertiesShared() const;
207 
211  const PProperties& GetProperties() const;
212 
213 private:
214  void SetProperties(const PProperties& p);
215 
216  friend class PDescriptorImpl;
217 };
218 
219 PAPILLON_END_NAMESPACE
220 
The PString class provides an Unicode character strings.
Definition: PString.h:37
Class PGuid: an immutable Globally Unique Identifier (GUID).
The PImage class represents a 2D-image; several pixel format and number of channels are supported (BG...
Definition: PImage.h:57
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PProperties class represents a container of properties; each property has a name (PString) and a ...
Definition: PProperties.h:38
static PGuid CreateUniqueId()
Returns a new Global Unique Identifier (GUID); thread-safe.
The PByteArray class represents a resizable array of bytes.
Definition: PByteArray.h:40
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PGuid class represents a Globally Unique Identifier (GUID); PGuid instances are immutable (thread...
Definition: PGuid.h:28
Class PObject: the root class of all Papillon classes.
The PDescriptor class represents a single descriptor of an object, for example a feature vector...
Definition: PDescriptor.h:41
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
The PObjectType class represents a type of object found in a video stream (can be Face...
Definition: PObjectType.h:26