for (i = VG_sRGBX_8888; i <= VG_BW_1; ++i) { imgSrc = vgCreateImage(i, 256, 256, VG_IMAGE_QUALITY_NONANTIALIASED); col[0] = 1.0f; col[1] = 0.6f; col[2] = 0.3f; col[3] = 0.7f; vgSetfv(VG_CLEAR_COLOR, 4, col); vgClearImage(imgSrc, 0, 0, 256, 256); col[0] = 0.3f; col[1] = 0.6f; col[2] = 1.0f; col[3] = 0.49f; vgSetfv(VG_CLEAR_COLOR, 4, col); vgClearImage(imgSrc, 50, 50, 60, 80); col[0] = 0.8f; col[1] = 0.2f; col[2] = 0.8f; col[3] = 0.9f; vgSetfv(VG_CLEAR_COLOR, 4, col); vgClearImage(imgSrc, 120, 10, 40, 300); col[0] = 0.2f; col[1] = 0.8f; col[2] = 0.6f; col[3] = 0.3f; vgSetfv(VG_CLEAR_COLOR, 4, col); vgClearImage(imgSrc, -120, -10, 300, 40); vgGetImageSubData(imgSrc, imgOutputDataRGBA, 1024, VG_lRGBA_8888, 0, 0, 256, 256); strcpy(imgFileName, "image_clear_"); strcat(imgFileName, imageFormatToString(i)); strcat(imgFileName, ".png"); strcpy(testDesc, "Image clear over "); strcat(testDesc, imageFormatToString(i)); strcat(testDesc, " format."); // pixel format without alpha channel will be saved forcing alpha to 0xFF switch (i) { case VG_sRGBX_8888: case VG_sRGB_565: case VG_sL_8: case VG_lRGBX_8888: case VG_lL_8: case VG_BW_1: saveImage32(f, imgFileName, testDesc, 256, 256, imgOutputDataRGBA, 1); break; default: saveImage32(f, imgFileName, testDesc, 256, 256, imgOutputDataRGBA, 0); } vgDestroyImage(imgSrc); }