Home || Visual Search || Applications || Architecture || Important Messages || OGL || Src

virtual void Impala::Core::ImageSet::Archive::HandleNewFile ( ImageSet is,
int  fileId,
Array::Array2dVec3UInt8 im 
) [inline, virtual]

Arrived at given DB_FILE in a "normal" walk.

Reimplemented from Impala::Core::ImageSet::Listener.

Definition at line 51 of file Archive.h.

References Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CH(), CompressAndAdd(), Impala::Core::Array::Array2dTem< StorT, elemSize, ArithT >::CW(), ILOG_ERROR, ILOG_INFO, mImList, mMaxSize, mMinSize, mNrBigIm, mNrBlackIm, mNrSmallIm, Impala::Core::Geometry::NEAREST, and Impala::Core::Array::Scale().

00052     {
00053         if (im == 0)
00054         {
00055             ILOG_ERROR("No readable image, adding minSize black image");
00056             RgbImType* rgbIm = Array::MakeFromValue<RgbImType>(0, mMinSize,
00057                                                                mMinSize);
00058             CompressAndAdd(rgbIm);
00059             mNrBlackIm++;
00060             return;
00061         }
00062 
00063         if ((im->CW() < mMinSize) || (im->CH() < mMinSize))
00064         {
00065             ILOG_INFO("Image too small (" << im->CW() << "x" << im->CH() <<
00066                       "), adding minSize black image");
00067             RgbImType* rgbIm = Array::MakeFromValue<RgbImType>(0, mMinSize,
00068                                                                mMinSize);
00069             CompressAndAdd(rgbIm);
00070             mNrSmallIm++;
00071             return;
00072         }
00073 
00074         if ((mMaxSize > 0) && ((im->CW() > mMaxSize) || (im->CH() > mMaxSize)))
00075         {
00076             double scale = 1.0;
00077             while ((scale*im->CW() > mMaxSize) || (scale*im->CH() > mMaxSize))
00078                 scale *= 0.5;
00079 
00080             RgbImType* sc = 0;
00081             Scale(sc, im, scale, scale, Core::Geometry::NEAREST, true);
00082             ILOG_INFO("Image too big, scaled it from " << im->CW() << "x" <<
00083                       im->CH() << " to " << sc->CW() << "x" << sc->CH());
00084             CompressAndAdd(sc);
00085             mNrBigIm++;
00086             return;
00087         }
00088 
00089         // Image seems OK, get original (compressed) data
00090         CImType* bufIm = is->GetImageData(fileId);
00091         mImList.push_back(bufIm);
00092     }

Here is the call graph for this function:


Generated on Thu Jan 13 09:19:56 2011 for ImpalaSrc by  doxygen 1.5.1