36#ifndef VIGRA_IMAGECONTAINER_HXX
37#define VIGRA_IMAGECONTAINER_HXX
40#include "array_vector.hxx"
41#include "copyimage.hxx"
70template <
class ImageType,
71 class Alloc =
typename ImageType::allocator_type::template rebind<ImageType>::other >
87 typedef typename ImageVector::reverse_iterator reverse_iterator;
88 typedef typename ImageVector::const_reverse_iterator const_reverse_iterator;
91#if !defined(_MSC_VER) || _MSC_VER >= 1300
94 typedef typename ImageVector::difference_type difference_type;
104 for(
unsigned int i=0;
i<numImages;
i++)
113 : images_(numImages,
alloc)
122 : imageSize_(image.
size()),
123 images_(numImages, image,
alloc)
132 template<
class InputIterator>
146 return images_[index];
154 return images_[index];
162 return images_.
begin();
170 return images_.
begin();
178 return images_.
end();
186 return images_.
end();
195 return images_.rbegin();
204 return images_.rbegin();
213 return images_.rend();
220 const_reverse_iterator
rend()
const
222 return images_.rend();
230 return images_.
size();
239 return images_.max_size();
247 return images_.empty();
257 return (
imageSize() == other.imageSize())
258 && (images_ == other.images_);
265 return images_.insert(pos, image);
276 template<
class InputIterator>
287 return images_.erase(pos);
332 "trying to append images of wrong size to ImageArray with resize()");
333 images_.resize(
newSize, image);
341 return images_.front();
348 return images_.front();
355 return images_.back();
362 return images_.back();
369 images_.push_back(image);
385 images_.swap(other.images_);
386 imageSize_ = other.imageSize_;
395 return images_.capacity();
412 {
return imageSize_; }
422 for(
unsigned int i=0;
i<
size();
i++)
466template <
class ImageType,
467 class Alloc =
typename ImageType::allocator_type::template rebind<ImageType>::other >
470 int lowestLevel_, highestLevel_;
483 typedef typename ImageVector::reverse_iterator reverse_iterator;
484 typedef typename ImageVector::const_reverse_iterator const_reverse_iterator;
487#if !defined(_MSC_VER) || _MSC_VER >= 1300
490 typedef typename ImageVector::difference_type difference_type;
506 : lowestLevel_(0), highestLevel_(-1),
527 : lowestLevel_(0), highestLevel_(-1),
546 template <
class SrcIterator,
class SrcAccessor>
551 : lowestLevel_(0), highestLevel_(-1),
561 : lowestLevel_(0), highestLevel_(-1),
578 return highestLevel_;
586 return images_[index - lowestLevel_];
594 return images_[index - lowestLevel_];
602 return images_.
begin();
610 return images_.
begin();
618 return images_.
end();
626 return images_.
end();
635 return images_.rbegin();
644 return images_.rbegin();
653 return images_.rend();
660 const_reverse_iterator
rend()
const
662 return images_.rend();
670 return images_.
size();
678 return images_.empty();
688 return (lowestLevel_ == other.lowestLevel_) && (highestLevel_ == other.highestLevel_) &&
689 (images_ == other.images_);
710 "ImagePyramid::resize(): lowestLevel <= highestLevel required.");
712 "ImagePyramid::resize(): sizeAppliesToLevel must be between lowest and highest level (inclusive).");
739 return images_.front();
746 return images_.front();
753 return images_.back();
760 return images_.back();
768 images_.swap(other.images_);
769 std::swap(lowestLevel_, other.lowestLevel_);
770 std::swap(highestLevel_, other.highestLevel_);
Two dimensional difference vector.
Definition diff2d.hxx:186
Fundamental class template for arrays of equal-sized images.
Definition imagecontainer.hxx:73
void pop_back()
Definition imagecontainer.hxx:374
const_reverse_iterator rend() const
Definition imagecontainer.hxx:220
const_reference front() const
Definition imagecontainer.hxx:346
void insert(iterator pos, size_type count, const_reference image)
void resize(size_type newSize, ImageType &image)
Definition imagecontainer.hxx:327
const_iterator begin() const
Definition imagecontainer.hxx:168
void push_back(const_reference image)
Definition imagecontainer.hxx:367
bool empty()
Definition imagecontainer.hxx:245
ImageArray(unsigned int numImages, const ImageType &image, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:121
void reserve(size_type n)
Definition imagecontainer.hxx:400
iterator insert(iterator pos, const_reference image)
Definition imagecontainer.hxx:263
virtual void resizeImages(const Diff2D &newSize)
Definition imagecontainer.hxx:418
size_type size() const
Definition imagecontainer.hxx:228
const_reference back() const
Definition imagecontainer.hxx:360
reverse_iterator rend()
Definition imagecontainer.hxx:211
reference front()
Definition imagecontainer.hxx:339
void swap(const_reference other)
Definition imagecontainer.hxx:382
void resize(size_type newSize)
Definition imagecontainer.hxx:310
void resizeImages(int width, int height)
Definition imagecontainer.hxx:435
void insert(iterator pos, InputIterator begin, InputIterator end)
Definition imagecontainer.hxx:277
size_type max_size() const
Definition imagecontainer.hxx:237
reference operator[](size_type index)
Definition imagecontainer.hxx:144
ImageType value_type
Definition imagecontainer.hxx:83
Size2D imageSize() const
Definition imagecontainer.hxx:411
ImageArray(InputIterator begin, InputIterator end, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:133
void clear()
Definition imagecontainer.hxx:300
ImageArray(unsigned int numImages, const Diff2D &imageSize, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:99
iterator end()
Definition imagecontainer.hxx:176
ImageArray(unsigned int numImages=0, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:112
const_iterator end() const
Definition imagecontainer.hxx:184
reverse_iterator rbegin()
Definition imagecontainer.hxx:193
size_type capacity() const
Definition imagecontainer.hxx:393
iterator erase(iterator begin, iterator end)
Definition imagecontainer.hxx:293
iterator begin()
Definition imagecontainer.hxx:160
bool operator==(const ImageArray< ImageType, Alloc > &other)
Definition imagecontainer.hxx:255
const_reverse_iterator rbegin() const
Definition imagecontainer.hxx:202
reference back()
Definition imagecontainer.hxx:353
iterator erase(iterator pos)
Definition imagecontainer.hxx:285
Class template for logarithmically tapering image pyramids.
Definition imagecontainer.hxx:469
const_reverse_iterator rend() const
Definition imagecontainer.hxx:660
const_reference front() const
Definition imagecontainer.hxx:744
const_iterator begin() const
Definition imagecontainer.hxx:608
void resize(int lowestLevel, int highestLevel, const Diff2D &imageSize, int sizeAppliesToLevel=0)
Definition imagecontainer.hxx:706
bool empty()
Definition imagecontainer.hxx:676
ImagePyramid(int lowestLevel, int highestLevel, SrcIterator ul, SrcIterator lr, SrcAccessor src, int copyImageToLevel=0, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:547
ImagePyramid(Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:560
int highestLevel() const
Definition imagecontainer.hxx:576
size_type size() const
Definition imagecontainer.hxx:668
const_reference back() const
Definition imagecontainer.hxx:758
reverse_iterator rend()
Definition imagecontainer.hxx:651
reference front()
Definition imagecontainer.hxx:737
void swap(ImagePyramid< ImageType, Alloc > &other)
Definition imagecontainer.hxx:766
reference operator[](size_type index)
Definition imagecontainer.hxx:584
ImagePyramid(int lowestLevel, int highestLevel, const Diff2D &imageSize, int sizeAppliesToLevel=0, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:503
ImageType value_type
Definition imagecontainer.hxx:479
void clear()
Definition imagecontainer.hxx:694
bool operator==(const ImagePyramid< ImageType, Alloc > &other) const
Definition imagecontainer.hxx:686
ImagePyramid(int lowestLevel, int highestLevel, const ImageType &image, int copyImageToLevel=0, Alloc const &alloc=Alloc())
Definition imagecontainer.hxx:524
iterator end()
Definition imagecontainer.hxx:616
const_iterator end() const
Definition imagecontainer.hxx:624
reverse_iterator rbegin()
Definition imagecontainer.hxx:633
iterator begin()
Definition imagecontainer.hxx:600
int lowestLevel() const
Definition imagecontainer.hxx:569
const_reverse_iterator rbegin() const
Definition imagecontainer.hxx:642
reference back()
Definition imagecontainer.hxx:751
Class for a single RGB value.
Definition rgbvalue.hxx:128
Two dimensional size object.
Definition diff2d.hxx:483
size_type size() const
Definition tinyvector.hxx:913
iterator end()
Definition tinyvector.hxx:864
iterator begin()
Definition tinyvector.hxx:861
void copyImage(...)
Copy source image into destination image.