If I create a Halide::Buffer by constructing it with a pointer from an STB_Image function call like so:
inline Halide::Buffer<uint8_t> LoadFromFile(const char* filename)
{
int w, h, d;
unsigned char* image_data = stbi_load(filename, &w, &h, &d, 0);
Halide::Buffer buff = Halide::Buffer(image_data, std::vector<int>{w, h, d});
return buff;
}
Who is responsible for freeing the underlying buffer? I assumed it would be me since I allocated the memory so I should free it. If I am responsible, where should it be done?
Thanks