32 #include <Image/PyramidImage.hh>
39 const unsigned width = 640, height = 480, channelcount=3, size = 2;
43 if (!pim.
IsEmpty()) { BIASABORT; }
46 if (!(pim.
Size()==size)) { BIASABORT; }
47 if (pim.
Size()>0 && !pim[0]->
IsEmpty()) { BIASABORT; }
49 if (!pim.
IsEmpty()) { BIASABORT; }
51 pim.
Init(width, height, channelcount, size);
52 if (!(pim.
Size()==size)) { BIASABORT; }
53 if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
54 if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
56 if (!pim.
IsEmpty()) { BIASABORT; }
59 if (!(pim.
Size()==size)) { BIASABORT; }
60 if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
61 if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
62 if ((pim.
Size()>1) && pim[1]->IsEmpty()) { BIASABORT; }
65 if (!(pim.
Size()==size)) { BIASABORT; }
66 if ((pim.
Size()>0) && (pim[0]->GetWidth()!=width)) { BIASABORT; }
67 if ((pim.
Size()>0) && (pim[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
68 if ((pim.
Size()>1) && pim[1]->IsEmpty()) { BIASABORT; }
71 if (!(pim2.Size()==size)) { BIASABORT; }
72 if ((pim2.Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
73 if ((pim2.Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
74 if ((pim2.Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
79 const unsigned width = 640, height = 480, channelcount=3, size = 2;
81 if (!pim.
IsEmpty()) { BIASABORT; }
83 pim.
Init(width, height, channelcount, size);
86 if (!(pim2.
Size()==size)) { BIASABORT; }
87 if ((pim2.
Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
88 if ((pim2.
Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
89 if ((pim2.
Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
92 if (!(pim3.Size()==size)) { BIASABORT; }
93 if ((pim3.Size()>0) && (pim3[0]->GetWidth()!=width)) { BIASABORT; }
94 if ((pim3.Size()>0) && (pim3[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
95 if ((pim3.Size()>1) && pim3[1]->IsEmpty()) { BIASABORT; }
96 if (
RefCount(pim3[0])!=1) { BIASABORT; }
99 if (!(pim2.
Size()==size)) { BIASABORT; }
100 if ((pim2.
Size()>0) && (pim2[0]->GetWidth()!=width)) { BIASABORT; }
101 if ((pim2.
Size()>0) && (pim2[0]->GetChannelCount()!=channelcount)) { BIASABORT; }
102 if ((pim2.
Size()>1) && pim2[1]->IsEmpty()) { BIASABORT; }
103 if (
RefCount(pim2[0])!=2) { BIASABORT; }
108 const unsigned width = 640, height = 480, channelcount=3, size = 2;
111 if (!pim.
IsEmpty()) { BIASABORT; }
113 pim.
Init(width, height, channelcount, size);
115 if (!pim[2]) { BIASABORT; }
116 if (!pim[2]->IsEmpty()) { BIASABORT; }
118 if (pim[2]->IsEmpty()) { BIASABORT; }
122 if (pim.
Size()!=5u) { BIASABORT; }
126 int main(
int argc,
char *argv[])
void InitFromImageBase(const ImageBase &image, const unsigned py_size=0)
same as Init(Image) but can use different ST, e.g.
virtual void resize(const unsigned size)
int Downsample()
downsamples from (*this)[0] assumes that all pointers e.g.
void Init(const Image< StorageType > &image, const unsigned py_size=0)
copy image into level 0 and create other levels according to parameters set so far (pyramidsize...
unsigned RefCount(const SharedPtr< T > &t)
This is the base class for images in BIAS.
int CreateAdditionalLayer(unsigned int numnewLayers=1, unsigned int minImageWidth=32)
resizes this and fills correctly with smaller images
PyramidImage< StorageType > & ShallowCopy(const PyramidImage< StorageType > &pim)
sets this as shallow copy of pim