我正在寻找一个允许我通过像素信息生成图像的库,采用这种样式(虚拟函数):
/*
coord_x = X coordinate
coord_y = Y coordinate
red = red part of RGB
green = green part of RGB
blue = blue part of RGB
*/
setPixel(int coord_x, int coord_y, int red, int green, int blue)
有这样的功能吗?我搜索了libpng,但它似乎不允许手动设置像素(虽然可能是错误的)......
首选的输出格式是 PNG,可以接受 GIF,JPG 可能不起作用(由于压缩和 PNG 和 GIF 中缺乏透明度)。