fix refactored code.

This commit is contained in:
Jordan
2024-03-13 10:26:37 -07:00
parent cc317d0d24
commit 9f641ffbf7
6 changed files with 78 additions and 55 deletions
-1
View File
@@ -93,7 +93,6 @@ set_target_properties(${LIBDART_OPENMVG}
OUTPUT_NAME ${LIBDART_OPENMVG}
)
target_link_options(${LIBDART_OPENMVG} PRIVATE "-Wl,-Bstatic")
target_link_options(${LIBDART_OPENMVG} PRIVATE "-Wl,-Bdynamic")
add_executable(
+13 -12
View File
@@ -1,14 +1,5 @@
#include "frame.h"
const Frame *new_frame_from_handle(FILE *stream, int w, int h, int depth)
{
Frame *f = (Frame *)malloc(sizeof(Frame));
f->stream = stream;
f->w = w;
f->h = h;
f->depth = depth;
return f;
}
FILE *make_buffer(const uint8_t *data, const size_t data_len)
{
@@ -29,10 +20,20 @@ FILE *make_buffer(const uint8_t *data, const size_t data_len)
return file;
}
_FFI_PLUGIN
const Frame *
new_frame_from_data(const uint8_t *data, const size_t data_len, int w, int h, int depth)
const Frame *new_frame_from_data(const uint8_t *data, const size_t data_len, int w, int h, int depth)
{
FILE *buf = make_buffer(data, data_len);
return new_frame_from_handle(buf, w, h, depth);
}
const Frame *new_frame_from_handle(FILE *stream, int w, int h, int depth)
{
Frame *f = (Frame *)malloc(sizeof(Frame));
f->stream = stream;
f->w = w;
f->h = h;
f->depth = depth;
return f;
}
+2 -2
View File
@@ -15,6 +15,6 @@ FILE *make_buffer(const uint8_t *, const size_t);
_FFI_PLUGIN
const Frame *new_frame_from_handle(FILE *, int, int, int);
_FFI_PLUGIN
const Frame *
new_frame_from_data(const uint8_t *, const size_t, int, int, int);
const Frame *new_frame_from_data(const uint8_t *, const size_t, int, int, int);
+4
View File
@@ -34,6 +34,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <error.h>
#include <png.h>
#if defined(__cplusplus)
@@ -42,8 +43,11 @@ extern "C" {
auto png_sig_cm = png_sig_cmp;
}
#endif // __cplusplus
#define error_t int
#ifdef __cplusplus
class StreamedView : openMVG::sfm::View {