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.

参见

frc_terminate

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.

参见

frc_builder_t

Public Functions

inline int Create(frc_calibration_t calibration)

Create a frc builder.

inline int AddKeyFrame(Frame frame)

Add a keyframe to 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

class Capture
#include <frc/frc.hpp>

Wrapper for frc_capture_t

Wraps a handle for a capture. Copying/moving is cheap, copies are shallow.

参见

frc_capture_t

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(const Capture &other)

Creates a shallow copy of another capture

inline Capture(Capture &&other)

Moves another capture into a new capture

inline Capture &operator=(const Capture &other)

Sets capture to a shallow copy of the other image

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 Image getColorImage()

Get the color image associated with the capture

inline Image getDepthImage()

Get the depth image associated with the capture

inline Image getIrImage()

Get the IR image associated with the capture

inline void setColorImage(Image image)

Set / add a color image to the capture

inline void setDepthImage(Image image)

Set / add a depth image to the capture

inline void setIrImage(Image image)

Set / add an IR image to the capture

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

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.

参见

frc_frame_t

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(const Frame &other)

Creates a shallow copy of another frc frame

inline Frame(Frame &&other)

Moves another frc frame into a new frame

inline Frame &operator=(const Frame &other)

Sets frame to a shallow copy of other

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 Capture getCapture() const

Get the original capture that is used to calculate the frc frame

inline frc_keyframe_t getKeyFrame()

Get keyframe data generated by the SDK.

inline void setCapture(Capture capture)

Set or add a capture to the frame.

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

class Image
#include <frc/frc.hpp>

Wrapper for frc_image_t

Wraps a handle for an image. Copying/moving is cheap, copies are shallow.

参见

frc_image_t

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(const Image &other)

Creates a shallow copy of another image

inline Image(Image &&other)

Moves another image into a new image

inline Image &operator=(const Image &other)

Sets image to a shallow copy of the other image

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

class Scanner
#include <frc/frc.hpp>

Wrapper for frc_scanner_t

Wraps a handle for a frc scanner.

参见

frc_scanner_t

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