C++ Reference¶
-
namespace frc¶
Functions
-
static inline int setLicense(std::string appKey, std::string appSecret, std::string authCode)¶
Set the license authentication information.
-
static inline int initialize(std::string workDir = std::string())¶
Initialize the library.
-
static inline void terminate()¶
Stop using the library.
-
static inline int getVersion(frc_version_t *version)¶
Get the version numbers of the SDK.
-
class Builder¶
- #include <frc/frc.hpp>
Wrapper for frc_builder_t
Wraps a handle for a frc builder.
Public Functions
-
inline int Create(frc_calibration_t calibration)¶
Create a frc builder.
-
inline void Destroy()¶
Destroys a frc builder.
-
inline int Process(frc_build_result_t *buildresult)¶
Generate face model from keyframes.
-
inline frc_builder_t GetHandle() const¶
Returns the underlying frc_builder_t handle
-
inline bool IsValid()¶
Returns true if the builder is valid, false otherwise
-
inline int setMultiThread(bool is_multi_thread)¶
Set multi thread while reconstructing, but it will cost more cpu resource
-
inline int Create(frc_calibration_t calibration)¶
-
class Capture¶
- #include <frc/frc.hpp>
Wrapper for frc_capture_t
Wraps a handle for a capture. Copying/moving is cheap, copies are shallow.
Public Functions
-
inline Capture(frc_capture_t handle)¶
Creates a capture from a frc_capture_t Takes ownership of the handle, i.e. assuming that handle has a refcount of 1, you should not call frc_capture_release on the handle after giving it to the capture; the capture will take care of that.
-
inline Capture &operator=(Capture &&other)¶
Moves another capture into this capture; other is set to invalid
-
inline int create()¶
Create an empty capture object.
-
inline frc_capture_t getHandle() const¶
Returns the underlying frc_capture_t handle
Note that this function does not increment the reference count on the frc_capture_t. The caller is responsible for incrementing the reference count on the frc_capture_t if the caller needs the frc_capture_t to outlive this C++ object. Otherwise, the frc_capture_t will be destroyed by this C++ object.
-
inline bool isValid()¶
Returns true if the capture is valid, false otherwise
-
inline Capture(frc_capture_t handle)¶
-
class Frame¶
- #include <frc/frc.hpp>
Wrapper for frc_frame_t
Wraps a handle for a frc frame. Copying/moving is cheap, copies are shallow.
参见
Public Functions
-
inline Frame(frc_frame_t handle)¶
Creates a frc frame from a frc_frame_t. Takes ownership of the handle, i.e. assuming that handle has a refcount of 1, you should not call frc_frame_release on the handle after giving it to the frame; the frame class will take care of that.
-
inline Frame &operator=(Frame &&other)¶
Moves another frame into this frame; other is set to invalid
-
inline int create()¶
Create an empty frame object.
-
inline frc_keyframe_t getKeyFrame()¶
Get keyframe data generated by the SDK.
-
inline void setKeyFrame(frc_keyframe_t *keyframe)¶
Set or add a keyframe data to the frame.
-
inline frc_frame_t getHandle() const¶
Returns the underlying frc_frame_t handle
Note that this function does not increment the reference count on the frc_frame_t. The caller is responsible for incrementing the reference count on the frc_frame_t if the caller needs the frc_frame_t to outlive this C++ object. Otherwise, the frc_frame_t will be destroyed by this C++ object.
-
inline bool isValid()¶
Returns true if the frame is valid, false otherwise
-
inline Frame(frc_frame_t handle)¶
-
class Image¶
- #include <frc/frc.hpp>
Wrapper for frc_image_t
Wraps a handle for an image. Copying/moving is cheap, copies are shallow.
参见
Public Functions
-
inline Image(frc_image_t handle)¶
Creates an image from a frc_image_t. Takes ownership of the handle, i.e. assuming that handle has a refcount of 1, you should not call frc_image_release on the handle after giving it to the image; the image will take care of that.
-
inline Image &operator=(Image &&other)¶
Moves another image into this image; other is set to invalid
-
inline int create(frc_image_format_t format, int width_pixels, int height_pixels, int stride_bytes, const uint8_t *data)¶
Create an image from a pre-allocated buffer
-
inline uint8_t *getBuffer()¶
Get the image buffer
-
inline const uint8_t *getBuffer() const¶
Get the image buffer
-
inline size_t getSize() const¶
Get the image buffer size in bytes
-
inline frc_image_format_t getFormat() const¶
Get the image format of the image
-
inline int getWidth() const¶
Get the image width in pixels
-
inline int getHeight() const¶
Get the image height in pixels
-
inline int getStride() const¶
Get the image stride in bytes
-
inline frc_image_t getHandle() const¶
Returns the underlying frc_image_t handle
Note that this function does not increment the reference count on the frc_image_t. The caller is responsible for incrementing the reference count on the frc_image_t if the caller needs the frc_image_t to outlive this C++ object. Otherwise, the frc_image_t will be destroyed by this C++ object.
-
inline bool isValid()¶
Returns true if the image is valid, false otherwise
-
inline Image(frc_image_t handle)¶
-
class Scanner¶
- #include <frc/frc.hpp>
Wrapper for frc_scanner_t
Wraps a handle for a frc scanner.
Public Functions
-
inline int create(frc_scanner_configuration_t config, frc_calibration_t calibration)¶
Create a frc scanner.
-
inline void destroy()¶
Destroys a frc scanner.
-
inline Frame process(Capture capture, frc_scan_flag_t scan_flag)¶
Generate face frame from capture.
-
inline frc_scanner_t getHandle() const¶
Returns the underlying frc_scanner_t handle
-
inline bool isValid()¶
Returns true if the scanner is valid, false otherwise
-
inline int create(frc_scanner_configuration_t config, frc_calibration_t calibration)¶
-
static inline int setLicense(std::string appKey, std::string appSecret, std::string authCode)¶