#include #include #include "gdpp.h" using namespace std; using namespace GD; void test(int r, int g,int b, int a) { cout << "--------------------------" << endl; cout << r << "|" << g << "|" << b << "|" << a << endl; GD::Image image;// image(20,30); image.CreateTrueColor(200,300); GD::TrueColor col3(r,g,b,a); cout << col3.Int() << "\n"; cout << gdTrueColorAlpha(r,g,b,a) << "\n"; GD::TrueColor col4( image.ColorAllocate(r,g,b,a)); cout << col4.Int() << "\n"; } int main() { /* GD::Image image;// image(20,30); image.CreateTrueColor(200,300); std::ofstream out("/tmp/test.png"); image.Png(out); out.close();*/ test(1,0,0,0); test(0,1,0,0); test(0,0,1,0); test(0,0,0,1); return 0; for (int red=0; red<256; ++red) { for (int green=0; green<256; ++green) { for (int blue=0; blue<256; ++blue) { GD::TrueColor col1(red,green,blue); int col2 = gdTrueColorAlpha(red,green,blue,0); if (col1.Int() != col2) cout << "Warning " << red << "|" << green << "|" << blue << "\n"; } } } }