#include <Image/PyramidImage.hh>
using namespace BIAS;
using namespace std;
void TestInit()
{
const unsigned width = 640, height = 480, channelcount=3, size = 2;
if (!(pim.
Size()==size)) { BIASABORT; }
pim.
Init(width, height, channelcount, size);
if (!(pim.
Size()==size)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if (!(pim.
Size()==size)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim.
Size()>1) && pim[1]->IsEmpty()) { BIASABORT; }
if (!(pim.
Size()==size)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim.
Size()>1) && pim[1]->IsEmpty()) { BIASABORT; }
if (!(pim2.
Size()==size)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim2.
Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
}
void TestCopy()
{
const unsigned width = 640, height = 480, channelcount=3, size = 2;
pim.
Init(width, height, channelcount, size);
if (!(pim2.
Size()==size)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim2.
Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
if (!(pim3.Size()==size)) { BIASABORT; }
if ((pim3.Size()>0) && (pim3[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim3.Size()>0) && (pim3[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim3.Size()>1) && pim3[1]->IsEmpty()) { BIASABORT; }
if (
RefCount(pim3[0])!=1) { BIASABORT; }
if (!(pim2.
Size()==size)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
if ((pim2.
Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
if ((pim2.
Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
if (
RefCount(pim2[0])!=2) { BIASABORT; }
}
void TestResize()
{
const unsigned width = 640, height = 480, channelcount=3, size = 2;
pim.
Init(width, height, channelcount, size);
if (!pim[2]) { BIASABORT; }
if (!pim[2]->IsEmpty()) { BIASABORT; }
if (pim[2]->IsEmpty()) { BIASABORT; }
if (pim.
Size()!=5u) { BIASABORT; }
}
int main(int argc, char *argv[])
{
TestInit();
TestCopy();
TestResize();
return 0;
}