The only memory that you need to allocate is the image itself, after that you just need to get pointers to pixels and access their components.
For example
sf::Uint8* pixel(sf::Uint8* image, std::size_t width, std::size_t x, std::size_t y)
{
return image + (x + width * y) * 4;
}
sf::Uint8* image = new sf::Uint8[width * height * 4];
// ... fill image data ...
// Modify the pixel at (10, 20)
sf::Uint8* p = pixel(image, width, 10, 20);
p[0] = 255;
p[1] = 128;
p[2] = 0;
p[3] = 255;
// Print the pixel at (5, 8)
sf::Uint8* p = pixel(image, width, 5, 8);
std::cout << "r = " << p[0] << " "
<< "g = " << p[1] << " "
<< "b = " << p[2] << " "
<< "a = " << p[3] << std::endl;
Of course you should wrap all this stuff into lightweight (inlined) C++ wrappers, but that's how it should look like internally.