1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
|
// MoneyTest.cpp
#include "ILUTest.h"
#include <IL/il.h>
#include <IL/ilu.h>
// Registers the fixture into the 'registry'
CPPUNIT_TEST_SUITE_REGISTRATION( ILUTest );
void ILUTest::setUp()
{
ilInit();
iluInit();
}
void ILUTest::tearDown()
{
const ILenum lResult = ilGetError();
while (ilGetError() != IL_NO_ERROR) {;}
ilResetMemory();
CPPUNIT_ASSERT(ilGetError() == IL_NO_ERROR);
CPPUNIT_ASSERT_MESSAGE("Received Error from ilGetError", lResult == IL_NO_ERROR);
}
void ILUTest::LoadStandardImage()
{
ilLoadImage(".\\Data\\Logo.png");
}
void ILUTest::TestiluSaturate4f()
{
ILuint MainImage = 0;
FILE * lBuffer = fopen(".\\results\\result.bmp", "wb");
ilGenImages(1, &MainImage);
ilBindImage(MainImage);
LoadStandardImage();
ilConvertImage(IL_RGB,IL_BYTE);
iluSaturate4f(-1.0, 0.0, 0.0, -1.0);
iluMirror();
iluBlurAvg(3);
ilSaveF(IL_BMP,lBuffer);
fclose(lBuffer);
}
void ILUTest::TestiluReplaceColour()
{
ILuint MainImage = 0;
FILE * lBuffer = fopen(".\\results\\result.bmp", "wb");
ilGenImages(1, &MainImage);
ilBindImage(MainImage);
LoadStandardImage();
ilConvertImage(IL_RGB,IL_BYTE);
iluReplaceColour(1.0, 0.0, 0.0, 0.0);
ilSaveF(IL_BMP,lBuffer);
fclose(lBuffer);
}
|