Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Classes | Public Member Functions | List of all members
BIAS::ImagePackage Class Reference

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 ()
 

Detailed Description

An Image Package is multiple .mip images in one file.

This class has methods for reading and writing.

Author
fkellner, 2008

Definition at line 20 of file ImagePackage.hh.

Constructor & Destructor Documentation

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.

Member Function Documentation

int ImagePackage::AddImage ( const ImageBase  image,
const std::string  filename = "" 
)
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.

Parameters
numused 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 
)

get image by given index number

Returns
0 on success

Definition at line 92 of file ImagePackage.cpp.

int ImagePackage::GetNextImage ( ImageBase image,
std::string &  filename 
)

get next image, call subsequently to walk through package file

Returns
0 if image exists

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

Returns
0 if image exists

Definition at line 185 of file ImagePackage.cpp.

References BIAS::ImagePackage::IPFileInfo::fileNum, and BIAS::ImagePackage::IPFileInfo::offset.

bool BIAS::ImagePackage::IsOpen ( )
inline

Definition at line 104 of file ImagePackage.hh.

int ImagePackage::Open ( const std::string  filename)

open a package

Returns
0 on success

Definition at line 66 of file ImagePackage.cpp.

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.


The documentation for this class was generated from the following files: