24 #include <core/exception.h>
25 #include <fvutils/colormap/cmfile.h>
26 #include <fvutils/colormap/cmfile_yuvblock.h>
27 #include <fvutils/colormap/colormap.h>
28 #include <fvutils/colormap/yuvcm.h>
29 #include <sys/utsname.h>
33 namespace firevision {
45 for (iterator i = begin(); i != end(); ++i) {
68 header_->
depth = depth;
69 header_->
width = width;
107 "Colormap dimensions %dx%dx%d do not match expected dimensions %dx%dx%d",
116 printf(
"Adding colormap with dimensions %dx%dx%d\n",
122 for (std::list<ColormapFileBlock *>::iterator i =
blocks.begin(); i !=
blocks.end(); ++i) {
135 for (std::list<FireVisionDataFileBlock *>::iterator i = b.begin(); i != b.end(); ++i) {
136 if ((*i)->type() == CMFILE_TYPE_YUV) {
146 ColormapFile::assert_header()
150 throw fawkes::Exception(
"Cannot get header information, invalid ctor used or file not read?");
170 for (BlockList::iterator b = bl.begin(); b != bl.end(); ++b) {
171 if ((*b)->type() != CMFILE_TYPE_YUV) {
183 unsigned int level = 0;
184 for (BlockList::iterator b = bl.begin(); b != bl.end(); ++b) {
191 cm->
copy_uvplane((
unsigned char *)(*b)->data_ptr(), level++);
215 std::string rv = format;
217 struct utsname uname_info;
220 size_t loc = rv.find(
"%h");
221 while (loc != std::string::npos) {
222 rv.replace(loc, 2, uname_info.nodename);
243 return header_->
depth;
253 return header_->
width;