#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include "./base.hpp" #ifndef __FRAME_H #define __FRAME_H typedef struct _Frame { FILE *stream; int w; int h; int depth; } Frame; FILE *make_buffer(const uint8_t *, const size_t); int read_buffer(FILE *, uint8_t **, size_t *); #ifdef __cplusplus typedef Frame CFrame; namespace DartOpenMvg { openMVG::image::Image imageFromFrame(const Frame *); class InMemoryMatcherRegions : public openMVG::matching_image_collection::Matcher { void Match( const Pair_Set &, PariWiseMatchesContainer &, ) const override; }; class Frame { protected: const CFrame *cFrame; std::stringstream mStream; int mW; int mH; int mDepth; std::unique_ptr mRegions; public: Frame(const _Frame *f) : mW(f->w), mH(f->h), mDepth(f->depth) { cFrame = f; uint8_t *buffer_data = NULL; size_t len = 0; read_buffer(f->stream, &buffer_data, &len); mStream = std::stringstream(std::string((char *)buffer_data)); } openMVG::image::Image DartOpenMvg::Frame::getMvgImage(); void calculateFeatures(); }; typedef std::pair FrameMatchKey; typedef std::map FrameFeatureMatch; class Frames : std::vector { protected: FrameFeatureMatch mFeatureMap; public: void computeMatches(); }; } #endif _FFI_PLUGIN Frame *new_frame_from_handle(FILE *, int, int, int); _FFI_PLUGIN Frame *new_frame_from_data(const uint8_t *, const size_t, int, int, int); #endif // __FRAME_H