move clip_image to header

This commit is contained in:
CJ Pais 2024-02-17 12:40:34 -08:00
parent 8354b7d2ad
commit 6d9fea6aae
4 changed files with 18 additions and 42 deletions

View file

@ -34,23 +34,6 @@
//#define CLIP_DEBUG_FUNCTIONS
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
static std::string format(const char * fmt, ...) {
va_list ap;
va_list ap2;

View file

@ -3,6 +3,7 @@
#include <stddef.h>
#include <stdint.h>
#include <vector>
#ifdef LLAMA_SHARED
# if defined(_WIN32) && !defined(__MINGW32__)
@ -26,6 +27,23 @@ extern "C" {
struct clip_ctx;
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
struct clip_image_u8_batch {
struct clip_image_u8 * data;
size_t size;

View file

@ -9,23 +9,6 @@
#include <vector>
#include <numeric>
// RGB uint8 image
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
// RGB float32 image (NHWC)
// Memory layout: RGBRGBRGB...
struct clip_image_f32 {
int nx;
int ny;
std::vector<float> buf;
};
struct clip_image_grid_shape {
int first;
int second;

View file

@ -32,14 +32,6 @@
using json = nlohmann::json;
// TODO should be in clip.h?
struct clip_image_u8 {
int nx;
int ny;
std::vector<uint8_t> buf;
};
struct server_params
{
std::string hostname = "127.0.0.1";