PPlugin.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 <PPluginInterface.h>
18 
19 PAPILLON_BEGIN_NAMESPACE
20 
21 class PGuid;
22 class PProperties;
23 class PVersion;
24 class PUri;
25 class PLogStream;
26 
45 class PAPILLON_API_CORE PPlugin : public PObject {
46  public:
51  static PResult Load(const PString& filename, PPlugin& plugin);
52 
56  static const PPlugin& Empty();
57 
63  PPlugin();
64 
68  PPlugin(const PPlugin& other);
69 
73  virtual ~PPlugin();
74 
78  PPlugin& operator=(const PPlugin& other);
79 
83  bool operator==(const PPlugin& other) const;
84 
88  bool operator!=(const PPlugin& other) const;
89 
95  PResult About(PString& productName, PVersion& productVersion, PGuid& productGuid, PString& briefDescription) const;
96 
100  PString GetAbsoluteFilename() const;
101 
106  PString GetBaseFilename() const;
107 
111  PGuid GetProductId() const;
112 
116  PString GetProductName() const;
117 
121  PVersion GetVersion() const;
122 
127  PString GetMD5() const;
128 
135  PResult CallCreateInstance(void** instance, const PProperties& parameters, const PString& parametersPrefix = PString()) const;
136 
145  PResult CallDestroyInstance(void** instance) const;
146 
152  PResult CallGetInstanceId(void* instance, PGuid& id) const;
153 
159  PResult CallGetInstanceName(void* instance, PString& name) const;
160 
166  PResult CallGetProperties(void* instance, PProperties& properties) const;
167 
173  PResult CallUpdateProperties(void* instance, const PProperties& object) const;
174 
180  PResult CallGetProperty(void* instance, const PString& property, PObject& object) const;
181 
187  PResult CallSetProperty(void* instance, const PString& property, const PObject& object) const;
188 
194  PResult CallAnalyticsApply(void* instance, const PFrame& frame, PList& events) const;
195 
201  PResult CallAnalyticsFinish(void* instance, PList& events) const;
202 
208  PResult CallAnalyticsDrawOSD(void* instance, PImage& image) const;
209 
215  PResult CallAnalyticsGetMinResolution(void* instance, PSizei& minResolution) const;
216 
222  PResult CallDetectorDetect(void* instance,
223  const PFrame& frame,
224  const PProperties& parameters,
225  const PString& parametersPrefix,
226  PDetectionList& detectionList) const;
227 
233  PResult CallDetectorLocalise(void* instance, PDetectionList& detectionList) const;
234 
240  PResult CallDescriberGetObjectType(void* instance, PObjectType& objectType) const;
241 
247  PResult CallDescriberGetDescribeId(void* instance, PGuid& describeId) const;
248 
254  PResult CallDescriberGetModelName(void* instance, PString& modelName) const;
255 
261  PResult CallDescriberApply(void* instance, const PExampleSet& exampleSet, PDescription& outputDescription) const;
262 
268  PResult CallDescriberApplyBatch(void* instance, const PDetectionList& detectionList, PDescriptionList& descriptionList) const;
269 
275  PResult CallF2FTrackerApply(void* instance, const PFrame& frame, PDetectionList& detectionList) const;
276 
282  PResult CallImageFilterApply(void* instance, const PImage& source, PImage& destination) const;
283 
290  PResult CallVideoStreamAcceptURI(const PUri& uri) const;
291 
297  PResult CallVideoStreamOpen(void* instance, const PUri& uri) const;
298 
304  PResult CallVideoStreamClose(void* instance) const;
305 
311  PResult CallVideoStreamIsOpened(void* instance, bool& isOpened) const;
312 
318  PResult CallVideoStreamCanSeek(void* instance, bool& canSeek) const;
319 
325  PResult CallVideoStreamGetFrame(void* instance, PFrame& frame, papillon::int32 timeOutMs) const;
326 
332  PResult CallVideoStreamPutFrame(void* instance, const PFrame& frame, papillon::int32 timeOutMs) const;
333 
337  bool IsEmpty() const;
338 
342  bool IsAnalyticsPlugin() const;
343 
347  bool IsDescriberPlugin() const;
348 
352  bool IsDetectorPlugin() const;
353 
357  bool IsFrameToFrameTrackerPlugin() const;
358 
362  bool IsImageFilterPlugin() const;
363 
367  bool IsInputVideoStreamPlugin() const;
368 
372  bool IsOutputVideoStreamPlugin() const;
373 
377  void PrintFunctionPointers(const PLogStream& os) const;
378 
379 };
380 
381 PAPILLON_END_NAMESPACE
The PUri class represents an Unified Resource Identifier (URI), this class can also be used to handle...
Definition: PUri.h:43
The PString class provides an Unicode character strings.
Definition: PString.h:37
The PFrame class represents any 2D-image (RGB, gray-scale, ...) with a container of additional data p...
Definition: PFrame.h:50
The PSizei class represents the size of an image or a rectangle: width (int) and height (int); PSizei...
Definition: PSizei.h:27
The PLogStream class represents a log stream used by log macros (should not be used directly...
Definition: PLog.h:263
The PDescription class represents a set of features that have been computed on an identity (it is a b...
Definition: PDescription.h:59
The PVersion class represents a software version number: major.minor[.maintenance[.build]]; immutable, so thread-safe.
Definition: PVersion.h:26
The PDetectionList class represents nothing more than a collection of detections (PDetection), Typically PDetectionList&#39;s are returned from a PDetector.
The PImage class represents a 2D-image; several pixel format and number of channels are supported (BG...
Definition: PImage.h:57
Pure "C" interface for all Papillon plugins.
The PResult class represents the result returned by most of Papillon functions; this class is used to...
Definition: PResult.h:159
The PList class represents a generic container which handle an ordered collection of PObject; NOT thr...
Definition: PList.h:46
The PProperties class represents a container of properties; each property has a name (PString) and a ...
Definition: PProperties.h:38
The PObject class is the root class of all Papillon classes; all PObject behaves like shared referenc...
Definition: PObject.h:27
The PPlugin class represents a Papillon plugin (input video source, detector, describer, ...); thread-safe.
Definition: PPlugin.h:45
The PDescriptionList class represents nothing more than a collection of descriptions (PDescription)...
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.
PObject & operator=(const PObject &obj)
Performs a shared copy of other to this object.
Definition: PObject.h:45
The PExampleSet class represents a collection of PDetection&#39;s of the same identity (unknown or known)...
Definition: PExampleSet.h:51
The PObjectType class represents a type of object found in a video stream (can be Face...
Definition: PObjectType.h:26