Basic Image AlgorithmS Library
2.8.0
|
An Image Package is multiple .mip images in one file. More...
#include <Image/ImagePackage.hh>
Classes | |
struct | IPFileInfo |
class | IPImageHeader |
Public Member Functions | |
int | AddImage (const ImageBase image, const std::string filename="") |
Adding an image with empty filename will use default name. More... | |
int | Close () |
close package More... | |
int | Create (const std::string filename, unsigned int num=1) |
Create image Package file. More... | |
int | GetImage (const int imageNum, ImageBase &image, std::string &filename) |
get image by given index number More... | |
int | GetNextImage (ImageBase &image, std::string &filename) |
get next image, call subsequently to walk through package file More... | |
int | GetPrevImage (ImageBase &image, std::string &filename) |
get previous image, call subsequently to walk through package file More... | |
ImagePackage () | |
An Image Package is much like an uncompressed zip file of mip images. More... | |
bool | IsOpen () |
int | Open (const std::string filename) |
open a package More... | |
int | WriteAllImages (const std::string filename="") |
write all Images from the package. More... | |
int | WriteSingleImage (const unsigned int imageNum, const std::string filename="") |
helper to write image with index imageNum, empty filename will use the one stored in package file More... | |
~ImagePackage () | |
An Image Package is multiple .mip images in one file.
This class has methods for reading and writing.
Definition at line 20 of file ImagePackage.hh.
ImagePackage::ImagePackage | ( | ) |
An Image Package is much like an uncompressed zip file of mip images.
The Package files are split at 1GB, where the files are named Images0001.pack, Images0002.pack etc. Each image inside a package can have its own filename, so writing the files to disk is made easy. Images in a package can be of any mixed size, storage type, but will always be saved uncompressed.
Definition at line 6 of file ImagePackage.cpp.
ImagePackage::~ImagePackage | ( | ) |
Definition at line 14 of file ImagePackage.cpp.
int ImagePackage::AddImage | ( | const ImageBase | image, |
const std::string | filename = "" |
||
) |
Adding an image with empty filename will use default name.
Definition at line 33 of file ImagePackage.cpp.
References BIAS::ImageBase::GetChannelCount(), BIAS::ImageBase::GetDepth(), BIAS::ImageBase::GetHeight(), BIAS::ImageBase::GetMetaData(), BIAS::ImageBase::GetWidth(), BIAS::ImagePackage::IPImageHeader::len_filename, BIAS::ImagePackage::IPImageHeader::len_metadata, BIAS::ImagePackage::IPImageHeader::len_pixeldata, and BIAS::MetaData::WriteBinary().
int ImagePackage::Close | ( | ) |
close package
Definition at line 240 of file ImagePackage.cpp.
int ImagePackage::Create | ( | const std::string | filename, |
unsigned int | num = 1 |
||
) |
Create image Package file.
num | used for numbering of .pack files, only used internally. |
Definition at line 20 of file ImagePackage.cpp.
int ImagePackage::GetImage | ( | const int | imageNum, |
ImageBase & | image, | ||
std::string & | filename | ||
) |
int ImagePackage::GetNextImage | ( | ImageBase & | image, |
std::string & | filename | ||
) |
get next image, call subsequently to walk through package file
Definition at line 113 of file ImagePackage.cpp.
References BIAS::ImageBase::IsEmpty(), and BIAS::ImageBase::Release().
int ImagePackage::GetPrevImage | ( | ImageBase & | image, |
std::string & | filename | ||
) |
get previous image, call subsequently to walk through package file
Definition at line 185 of file ImagePackage.cpp.
References BIAS::ImagePackage::IPFileInfo::fileNum, and BIAS::ImagePackage::IPFileInfo::offset.
|
inline |
Definition at line 104 of file ImagePackage.hh.
int ImagePackage::Open | ( | const std::string | filename | ) |
int ImagePackage::WriteAllImages | ( | const std::string | filename = "" | ) |
write all Images from the package.
filename can be used to overwrite the ones from the package file (numbers will be added)
Definition at line 220 of file ImagePackage.cpp.
int ImagePackage::WriteSingleImage | ( | const unsigned int | imageNum, |
const std::string | filename = "" |
||
) |
helper to write image with index imageNum, empty filename will use the one stored in package file
Definition at line 198 of file ImagePackage.cpp.
References BIAS::ImagePackage::IPFileInfo::fileNum, and BIAS::ImagePackage::IPFileInfo::offset.