gmic llibrary uses float buffers to represent the image. For example, here is the code in https://github.com/dtschump/gmic-minimal/blob/master/src/use_libgmic.cpp before calling the gmic functions:
// Fill each image buffer with sinus values (with different frequencies).
float *ptr = img;
for (unsigned int c = 0; c<img._spectrum; ++c)
for (unsigned int y = 0; y<img._height; ++y)
for (unsigned int x = 0; x<img._width; ++x)
*(ptr++) = std::cos(x/(1. + i))*std::sin(y/(1. + i + c));
}
My question is that :
If I get image as a base64 string, would representing it in bytes and then making a float array where each element is 4 bytes chunk of the bytes array be enough?