I have a question about wrapping a Halide::Image object around an already allocated C++ array that defines a 2-D double precision floating point image.
I've already looked at:
C++ array to Halide Image (and back)
This is close to what I want to do, but I'm confused by uint8_t type of the host member of buffer_t in halide and how you work with existing images that are not uint8_t.
I see that in the blur app which uses aot, the example allocates a Halide Image, and then copies elements into this halide image. I would like to do this, but without paying for the copy.
It's not an option for me to use load_image, I need to work with existing, already allocated memory defined by a double *.
Image<uint16_t> input(6408, 4802);
for (int y = 0; y < input.height(); y++) {
for (int x = 0; x < input.width(); x++) {
input(x, y) = rand() & 0xfff;
}
}