I have an application that is performing some processing on some images.
Given that I know the width/height/format etc. (I do), and thinking just about defining a buffer
float
).Incidentally, though, memcpy_s
isn't the idiomatic approach here. Use std::copy
instead. Keep in mind that a pointer is an iterator.
Starting in C++17, std::byte
is the idiomatic unit of opaquely typed storage such as you are using here. char
will still work, of course, but allows unsafe usages (as char
!) which byte
does not.