A bitmap buffer stored in the memory, not in a file. More...
#include <cubfiles.h>
Public Member Functions | |
| cubitmap (const char *buffer, const int *sizes, int dim) | |
| The constructor. | |
| int | count () const |
| How many cubes are there in the set? | |
| bool | bitmaptype () const |
| Is this a bitmap type of set of cubes? | |
| bool | elementary () const |
| Is this a set of elementary cubes, as opposed to full cubes? | |
| int | readcubes (chomp::homology::CubicalComplex &s) const |
| Reads a set of cubical cells from the file. | |
| int | readcubes (chomp::homology::SetOfCubes &s) const |
| Read a cubical set from the file. | |
| int | readcubes (int *&sizes, char *&bytes, int padding=0, bool power2=false) const |
| Reads a bitmap from a file. | |
Static Public Member Functions | |
| static const char * | name () |
| The name of this type of a cubical set. | |
| static std::ostream & | describe (std::ostream &out) |
| Describes this particular type of a set of cubes. | |
| static bool | compatible (const char *) |
| Verifies if the file format is compatible with this cubfile type. | |
Private Attributes | |
| const char * | buf |
| The actual bitmap buffer. | |
| int | buflength |
| The length of the buffer in bytes. | |
A bitmap buffer stored in the memory, not in a file.
Definition at line 783 of file cubfiles.h.
| chomp::homengin::cubitmap::cubitmap | ( | const char * | buffer, | |
| const int * | sizes, | |||
| int | dim | |||
| ) | [inline] |
The constructor.
Definition at line 843 of file cubfiles.h.
References chomp::homengin::cubfile::_dim, chomp::homengin::cubfile::_max, chomp::homengin::cubfile::_min, and buflength.
:
cubfile ("(memory)"), buf (buffer)
{
_dim = dim;
_min. assign (_dim, 0);
_max. assign (sizes, sizes + _dim);
if (sizes [0] & 0x1F)
throw "The x-size of a bitmap must be a multiple of 32.";
buflength = sizes [0] >> 3;
for (int i = 1; i < _dim; ++ i)
buflength *= sizes [i];
if (buflength <= 0)
throw "Non-positive buffer size - something went wrong.";
return;
} /* cubitmap::cubitmap */
| bool chomp::homengin::cubitmap::bitmaptype | ( | ) | const [inline, virtual] |
Is this a bitmap type of set of cubes?
Reimplemented from chomp::homengin::cubfile.
Definition at line 793 of file cubfiles.h.
{
return true;
}
| static bool chomp::homengin::cubitmap::compatible | ( | const char * | ) | [inline, static] |
Verifies if the file format is compatible with this cubfile type.
Reimplemented from chomp::homengin::cubfile.
Definition at line 814 of file cubfiles.h.
{
return false;
}
| int chomp::homengin::cubitmap::count | ( | ) | const [virtual] |
How many cubes are there in the set?
Reimplemented from chomp::homengin::cubfile.
| static std::ostream& chomp::homengin::cubitmap::describe | ( | std::ostream & | out | ) | [static] |
Describes this particular type of a set of cubes.
Reimplemented from chomp::homengin::cubfile.
| bool chomp::homengin::cubitmap::elementary | ( | ) | const [inline, virtual] |
Is this a set of elementary cubes, as opposed to full cubes?
Reimplemented from chomp::homengin::cubfile.
Definition at line 799 of file cubfiles.h.
{
return false;
}
| static const char* chomp::homengin::cubitmap::name | ( | ) | [inline, static] |
The name of this type of a cubical set.
Reimplemented from chomp::homengin::cubfile.
Definition at line 805 of file cubfiles.h.
{
return "bitmap buffer (memory)";
}
| int chomp::homengin::cubitmap::readcubes | ( | chomp::homology::CubicalComplex & | s | ) | const [inline, virtual] |
Reads a set of cubical cells from the file.
Reimplemented from chomp::homengin::cubfile.
Definition at line 820 of file cubfiles.h.
{
throw "Trying to read a set of cells from a bitmap buffer.";
}
| int chomp::homengin::cubitmap::readcubes | ( | int *& | sizes, | |
| char *& | bytes, | |||
| int | padding = 0, |
|||
| bool | power2 = false | |||
| ) | const [virtual] |
Reads a bitmap from a file.
Reimplemented from chomp::homengin::cubfile.
| int chomp::homengin::cubitmap::readcubes | ( | chomp::homology::SetOfCubes & | s | ) | const [virtual] |
Read a cubical set from the file.
Reimplemented from chomp::homengin::cubfile.
const char* chomp::homengin::cubitmap::buf [private] |
The actual bitmap buffer.
Definition at line 834 of file cubfiles.h.
int chomp::homengin::cubitmap::buflength [private] |
The length of the buffer in bytes.
Definition at line 837 of file cubfiles.h.
Referenced by cubitmap().
1.7.1