I'm currently working with Python to create images of gradients. However, for my uses开发者_JAVA百科 I'm afraid that Python may just be too slow. I know that Python can be extended with C++ with relative ease.
So what are some quick ways to produce images of gradients in C++?
Writing a bitmap manually is quite easy. For a Windows Bitmap you need a 54 byte header and then an array of colour values. (.bmp file specs)
So, create a file, write the header, supply the pixel array. For a gradient generating the colour values should be fairly simple.
.pgm/.ppm files are even easier as they have much simpler headers.
精彩评论