SqueezeBrains SDK 1.13
cs_sb.h
1#pragma once
2#include <windows.h>
3#include "sb.h"
4using namespace System;
5using namespace System::Runtime::InteropServices;
6#include "cs_common.h"
7
11namespace sb_cs
12{
39 public ref class SbVersion {
40 public:
41 int major;
42 int minor;
43 int vminor;
49 String^ ToString() override;
50 internal:
51 SbVersion(const sb_t_version* const src);
52 SbError CopyFromNative(const sb_t_version* const version);
53 };
54
58 public ref class SbRgba {
59 public:
60 unsigned char r;
61 unsigned char g;
62 unsigned char b;
63 unsigned char a;
64 SbRgba();
65 SbRgba(unsigned char r, unsigned char g, unsigned char b, unsigned char a);
66 internal:
67 SbRgba(const sb_t_rgba* const src);
68 SbError CopyFromNative(const sb_t_rgba* const src);
69 SbError CopyToNative(sb_t_rgba* dst);
70 };
71
75 public ref class SbBgra {
76 public:
77 unsigned char b;
78 unsigned char g;
79 unsigned char r;
80 unsigned char a;
81 SbBgra();
82 SbBgra(unsigned char b, unsigned char g, unsigned char r, unsigned char a);
83 internal:
84 SbBgra(const sb_t_bgra* const src);
85 SbError CopyFromNative(const sb_t_bgra* const src);
86 SbError CopyToNative(sb_t_bgra* dst);
87 };
88
92 public ref class SbSize {
93 public:
94 int width;
95 int height;
96 SbSize();
97 SbSize(int width, int height);
104 String^ ToString() override;
105 internal:
106 SbSize(const sb_t_size* const src);
107 SbError CopyFromNative(const sb_t_size* const src);
108 SbError CopyToNative(sb_t_size* dst);
109 };
110
114 public ref class SbSizeFlt {
115 public:
116 float width;
117 float height;
118 SbSizeFlt();
119 SbSizeFlt(float width, float height);
126 String^ ToString() override;
127 internal:
128 SbSizeFlt(const sb_t_size_flt* const src);
129 SbError CopyFromNative(const sb_t_size_flt* const src);
130 SbError CopyToNative(sb_t_size_flt* dst);
131 };
132
136 public ref class SbRange {
137 public:
138 int min;
139 int max;
140 SbRange();
141 SbRange(int _min, int _max);
148 String^ ToString() override;
149 internal:
150 SbRange(const sb_t_range* const src);
151 SbError CopyFromNative(const sb_t_range* const src);
152 SbError CopyToNative(sb_t_range* dst);
153 };
154
158 public ref class SbRangeFlt {
159 public:
160 float min;
161 float max;
162 SbRangeFlt();
163 SbRangeFlt(float min, float max);
170 String^ ToString() override;
171 internal:
172 SbRangeFlt(const sb_t_range_flt* const src);
173 SbError CopyFromNative(const sb_t_range_flt* const src);
174 SbError CopyToNative(sb_t_range_flt* dst);
175 };
176
180 public ref class SbPoint {
181 public:
182 int x;
183 int y;
184 SbPoint();
185 SbPoint(int x, int y);
192 String^ ToString() override;
193 internal:
194 SbPoint(const sb_t_point* const src);
195 SbError CopyFromNative(const sb_t_point* const src);
196 SbError CopyToNative(sb_t_point* dst);
197 };
198
202 public ref class SbPoint2dF {
203 public:
204 float x;
205 float y;
206 SbPoint2dF();
207 SbPoint2dF(float x, float y);
214 String^ ToString() override;
215 internal:
216 SbPoint2dF(const sb_t_point2d_f* const src);
217 SbError CopyFromNative(const sb_t_point2d_f* const src);
218 SbError CopyToNative(sb_t_point2d_f* dst);
219 };
220
224 public ref class SbRect {
225 public:
226 int x;
227 int y;
228 int width;
229 int height;
230 SbRect(int x, int y, int width, int height);
231 SbRect();
238 String^ ToString() override;
239 internal:
240 SbRect(const sb_t_rect* const src);
241 SbError CopyFromNative(const sb_t_rect* const src);
242 };
243
247 public ref class SbMemoryInfo {
248 public:
249 signed long long proc_virtual_used;
250 signed long long proc_virtual_used_max;
251 signed long long proc_virtual_max;
252 signed long long proc_physical_used;
253 signed long long proc_physical_used_max;
254 signed long long system_total;
255 signed long long system_used;
256 signed long long system_free;
257 internal:
258 SbMemoryInfo(const sb_t_memory_info* const src);
259 SbError CopyFromNative(const sb_t_memory_info* const src);
260 };
261
265 public ref class SbDeviceInfo {
266 public:
272
277 String^ name;
278
284
289 int id;
290
296 internal:
297 SbDeviceInfo(const sb_t_device_info* const src);
298 SbError CopyFromNative(const sb_t_device_info* const src);
299 };
300
305 public ref class SbInfo: SbCommon
306 {
307 public:
317 String^ version_str;
332 signed long long malloc_size;
337 signed long long malloc_size_max;
347 array<SbDeviceInfo^>^ devices;
354 SbError Refresh(int gpu_info);
362 String^ Format();
363 internal:
364 SbInfo();
365 ~SbInfo();
366 SbError CopyFromNative(sb_t_info* const src);
367 sb_t_info* sb_info;
368 };
369
373 public ref class Sb
374 {
375 public:
385 static SbError Init(String ^ license_file);
396 static SbError InitDl(String^ search_path);
402 static SbError Release();
424 static SbInfo^ GetInfo(int gpu_info);
431
435 static String^ FormatDeviceType(SbDeviceType value);
436
437 };
438
443 {
444 public:
445 static SbError StringCopyToNative(char* const dst, int dst_size, String^ src);
446 static String^ StringCopyFromNative(const char* const src);
447 static String^ StringCopyFromNative(char* const src);
448 }; // group_cs_common
450 // group_cs
452}
453
454#include "cs_folder.h"
455#include "cs_license.h"
456#include "cs_image.h"
457#include "cs_sample.h"
458#include "cs_blob.h"
459#include "cs_par.h"
460#include "cs_roi.h"
461#include "cs_res.h"
462#include "cs_project.h"
463#include "cs_solution.h"
bgra class that wraps the sb_t_bgra structure
Definition: cs_sb.h:75
unsigned char g
green component of color
Definition: cs_sb.h:78
unsigned char a
trasparency of color
Definition: cs_sb.h:80
unsigned char b
blue component of color
Definition: cs_sb.h:77
unsigned char r
red component of color
Definition: cs_sb.h:79
Common class
Definition: cs_common.h:191
Characteristics of a computing device. It wraps the sb_t_device_info structure.
Definition: cs_sb.h:265
SbMemoryInfo memory
Memory information of the device and the process.
Definition: cs_sb.h:295
int id
Identifier of the device.
Definition: cs_sb.h:289
String name
Device name.
Definition: cs_sb.h:277
SbDeviceType type
Device type.
Definition: cs_sb.h:271
String compute_capability
Device CUDA Compute capability.
Definition: cs_sb.h:283
Sb Main Class
Definition: cs_sb.h:374
static SbError Release()
Releases all the resources allocated in the library
static SbError CheckMemoryLeak()
Checks if the library has a memory leak.
static String SbInitNoLicenseKey
SB_INIT_NO_LICENSE_KEY
Definition: cs_sb.h:430
static SbError InitDl(String^ search_path)
Init the Deep Learning SB Library. The function enables the SbProject::Detection and SVL functions fo...
static String SbInitOnlySbLicenseKey
SB_INIT_ONLY_SB_LICENSE_KEY
Definition: cs_sb.h:428
static String SbInitOnlyHwLicenseKey
SB_INIT_ONLY_HW_LICENSE_KEY
Definition: cs_sb.h:426
static SbError CheckMemoryLeakReset()
Resets the memory leak control
static SbError Init(String ^ license_file)
Init the SB Library. The function initializes all the functionalities of the library including the li...
static String FormatDeviceType(SbDeviceType value)
Returns the device type description.
static SbInfo GetInfo(int gpu_info)
The function gets information of the sb library and the available computational devices
Info class that wraps the sb_t_info structure. You must call the Dispose() method to free all the re...
Definition: cs_sb.h:306
signed long long malloc_size_max
Maximum allocated memory, expressed in bytes, by sb the library. sb_t_info.malloc_size_max
Definition: cs_sb.h:337
int dl_modules_enabled
Value is different from 0 if Deep Learning modules are enabled. sb_t_info.dl_modules_enabled
Definition: cs_sb.h:342
SbVersion version
Version of the sb library. sb_t_info.version
Definition: cs_sb.h:312
String compile_time
String of the compile time of the sb library sb_t_info.compile_time
Definition: cs_sb.h:327
SbError Refresh(int gpu_info)
Refresh the sb library information
String Format()
Formats SbInfo parameters in a string.
array< SbDeviceInfo^> devices
Array of available devices sb_t_info.devices
Definition: cs_sb.h:347
String version_str
String of the version of the sb library. sb_t_info.version_str
Definition: cs_sb.h:317
String compile_date
String of the compile date of the sb library. sb_t_info.compile_date
Definition: cs_sb.h:322
signed long long malloc_size
Current allocated memory, expressed in bytes, by sb the library. sb_t_info.malloc_size
Definition: cs_sb.h:332
Memory information. It wraps the sb_t_memory_info structure.
Definition: cs_sb.h:247
signed long long proc_virtual_max
maximum virtual memory usable by the process, in bytes
Definition: cs_sb.h:251
signed long long system_total
system physical memory, in bytes
Definition: cs_sb.h:254
signed long long proc_virtual_used
virtual memory used by process, in bytes
Definition: cs_sb.h:249
signed long long proc_physical_used_max
maximum physical memory used by the process, in bytes
Definition: cs_sb.h:253
signed long long system_free
system free physical memory, in bytes
Definition: cs_sb.h:256
signed long long proc_virtual_used_max
maximum virtual memory used by the process, in bytes
Definition: cs_sb.h:250
signed long long proc_physical_used
physical memory used by the process, in bytes
Definition: cs_sb.h:252
signed long long system_used
system used physical memory, in bytes
Definition: cs_sb.h:255
Point class that wraps the sb_t_point2d_f structure
Definition: cs_sb.h:202
float y
y coordinate
Definition: cs_sb.h:205
float x
x coordinate
Definition: cs_sb.h:204
String ToString() override
Formats the sample coordinate in a readable string (x;y).
Point class that wraps the sb_t_point structure
Definition: cs_sb.h:180
String ToString() override
Formats the sample coordinate in a readable string (x;y).
int x
x coordinate
Definition: cs_sb.h:182
int y
y coordinate
Definition: cs_sb.h:183
Range value class that wraps the sb_t_range_flt structure
Definition: cs_sb.h:158
float min
minumum value
Definition: cs_sb.h:160
String ToString() override
Formats the range in a readable string (min;max).
float max
maximum value
Definition: cs_sb.h:161
Range value class that wraps the sb_t_range structure
Definition: cs_sb.h:136
String ToString() override
Formats the range in a readable string (min;max).
int min
mininum value
Definition: cs_sb.h:138
int max
maximum value
Definition: cs_sb.h:139
Rectangle class that wraps the sb_t_rect structure
Definition: cs_sb.h:224
int x
x coordinate of the upper left corner of the rectangle
Definition: cs_sb.h:226
int y
y coordinate of the upper left corner of the rectangle
Definition: cs_sb.h:227
int width
width of the rectangle
Definition: cs_sb.h:228
String ToString() override
Formats the rectangle in a readable string ul=(x;y) size=(width;height).
int height
height of the rectangle
Definition: cs_sb.h:229
rgba class that wraps the sb_t_rgba structure
Definition: cs_sb.h:58
unsigned char r
red component of color
Definition: cs_sb.h:60
unsigned char g
green component of color
Definition: cs_sb.h:61
unsigned char b
blue component of color
Definition: cs_sb.h:62
unsigned char a
trasparency of color
Definition: cs_sb.h:63
Size class that wraps the sb_t_size_flt structure
Definition: cs_sb.h:114
float width
width
Definition: cs_sb.h:116
float height
height
Definition: cs_sb.h:117
String ToString() override
Formats the size in a readable string (width;height).
Size class that wraps the sb_t_size structure
Definition: cs_sb.h:92
int height
height
Definition: cs_sb.h:95
String ToString() override
Formats the size in a readable string (width:height).
int width
width
Definition: cs_sb.h:94
Utils Class
Definition: cs_sb.h:443
Version class that wraps the sb_t_version structure
Definition: cs_sb.h:39
int major
major number, changes when there are new features
Definition: cs_sb.h:41
int build_major
build_major number, changes every time the library is built
Definition: cs_sb.h:44
int vminor
vminor number, changes on internal improvement which doesn't modify the interface
Definition: cs_sb.h:43
int minor
minor number, changes when the interface is no longer compatible
Definition: cs_sb.h:42
String ToString() override
SbError
Enum error codes
Definition: cs_common.h:13
SbDeviceType
Device type that wraps the sb_t_device_type enum
Definition: cs_common.h:181
#define SB_INIT_ONLY_HW_LICENSE_KEY
Use this define with sb_init in order to manage only hardware license keys.
Definition: sb.h:5952
#define SB_INIT_NO_LICENSE_KEY
Use this define with sb_init in order to not manage license keys.
Definition: sb.h:5964
#define SB_INIT_ONLY_SB_LICENSE_KEY
Use this define with sb_init in order to manage only SqueezeBrains software license keys.
Definition: sb.h:5958
SB Namespace
Definition: cs_common.h:3
SqueezeBrains libraries header file.
Defines the color in the format BGRA.
Definition: sb.h:6195
Information about a computing device.
Definition: sb.h:6118
General information about sb library and computing devices like CPU and GPUs.
Definition: sb.h:6180
Memory information.
Definition: sb.h:6092
Represents an ordered pair of float x and y coordinates that defines a point in a two-dimensional pla...
Definition: sb.h:5774
Represents an ordered pair of integer x and y coordinates that defines a point in a two-dimensional p...
Definition: sb.h:5765
Represents an ordered pair of float minimum and maximum values that defines a range.
Definition: sb.h:5810
Represents an ordered pair of 32 bits signed integer minimum and maximum values that defines a range.
Definition: sb.h:5801
Defines the position and size of a rectangle in a two-dimensional plane.
Definition: sb.h:5819
Defines the color in the format RGBA.
Definition: sb.h:6228
Represents an ordered pair of float x and y length that defines a rectangle in a two-dimensional plan...
Definition: sb.h:5792
Represents an ordered pair of integer x and y length that defines a rectangle in a two-dimensional pl...
Definition: sb.h:5783
Defines the version.
Definition: sb.h:6049