I am working on an image processing project in C++. I have the following struct to represent each pixel in my image.
struct Pixel16
{
uint16_t red;
uint16_t green;
uint16_t blue;
}
The size of this struct is 6 bytes. In my Image class I plan to have an array of most likely millions of these depending on the size of the image. I was wondering if I need to be worried about memory alignment? Should I align the memory to be on 8 byte boundaries. Will this increase the performance?