Fawkes API
Fawkes Development Version
cmfile.h
1
2
/**************************************************************************
3
* cmfile.h - FVFF Colormap File Format
4
*
5
* Created: Sat Mar 29 12:49:48 2008
6
* Copyright 2005-2008 Tim Niemueller [www.niemueller.de]
7
*
8
***************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version. A runtime exception applies to
14
* this software (see LICENSE.GPL_WRE file mentioned below for details).
15
*
16
* This program is distributed in the hope that it will be useful,
17
* but WITHOUT ANY WARRANTY; without even the implied warranty of
18
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
* GNU Library General Public License for more details.
20
*
21
* Read the full text in the LICENSE.GPL_WRE file in the doc directory.
22
*/
23
24
#ifndef _FIREVISION_FVUTILS_COLORMAP_CMFILE_H_
25
#define _FIREVISION_FVUTILS_COLORMAP_CMFILE_H_
26
27
#include <fvutils/colormap/cmfile_block.h>
28
#include <fvutils/fileformat/fvfile.h>
29
30
#include <stdint.h>
31
#include <string>
32
#include <vector>
33
34
namespace
firevision {
35
36
class
Colormap;
37
38
#define CMFILE_MAGIC_TOKEN 0xFF01
39
#define CMFILE_CUR_VERSION 2
40
41
#define CMFILE_TYPE_YUV 1
42
43
#pragma pack(push, 4)
44
/** Block header for a Colormap header block in a ColormapFile. */
45
typedef
struct
46
{
47
uint16_t depth;
/**< Y resolution */
48
uint16_t width;
/**< U resolution */
49
uint16_t height;
/**< V resolution */
50
uint16_t reserved;
/**< reserved for future use, padding */
51
}
cmfile_header_t
;
52
#pragma pack(pop)
53
54
class
ColormapFile
:
public
FireVisionDataFile
55
{
56
public
:
57
ColormapFile
();
58
ColormapFile
(uint16_t depth, uint16_t width, uint16_t height);
59
60
class
ColormapBlockVector
:
public
std::vector<ColormapFileBlock *>
61
{
62
public
:
63
~ColormapBlockVector
();
64
};
65
66
void
add_colormap
(
Colormap
*colormap);
67
ColormapBlockVector
*
colormap_blocks
();
68
Colormap
*
get_colormap
();
69
70
uint16_t
get_depth
();
71
uint16_t
get_width
();
72
uint16_t
get_height
();
73
74
static
bool
is_colormap_file
(
const
char
*filename);
75
static
std::string
compose_filename
(
const
std::string format);
76
77
virtual
void
clear
();
78
79
private
:
80
inline
void
assert_header();
81
82
private
:
83
cmfile_header_t
*header_;
84
};
85
86
}
// end namespace firevision
87
88
#endif
firevision::ColormapFile::clear
virtual void clear()
Clear internal storage.
Definition:
cmfile.cpp:234
firevision::ColormapFile::is_colormap_file
static bool is_colormap_file(const char *filename)
Check if given file is a colormap file.
Definition:
cmfile.cpp:206
firevision::ColormapFile::get_width
uint16_t get_width()
Get width of colormap.
Definition:
cmfile.cpp:254
firevision::FireVisionDataFile
Definition:
fvfile.h:39
firevision::ColormapFile::get_colormap
Colormap * get_colormap()
Get a freshly generated colormap based on current file content.
Definition:
cmfile.cpp:168
firevision::cmfile_header_t
Block header for a Colormap header block in a ColormapFile.
Definition:
cmfile.h:49
firevision::ColormapFile::ColormapBlockVector
Definition:
cmfile.h:64
firevision::ColormapFile::get_depth
uint16_t get_depth()
Get depth of colormap.
Definition:
cmfile.cpp:244
firevision::ColormapFile::colormap_blocks
ColormapBlockVector * colormap_blocks()
Get colormap blocks.
Definition:
cmfile.cpp:135
firevision::ColormapFile::get_height
uint16_t get_height()
Get height of colormap.
Definition:
cmfile.cpp:264
firevision::ColormapFile::add_colormap
void add_colormap(Colormap *colormap)
Add colormap.
Definition:
cmfile.cpp:93
firevision::ColormapFile::compose_filename
static std::string compose_filename(const std::string format)
Compose filename.
Definition:
cmfile.cpp:217
firevision::ColormapFile::ColormapFile
ColormapFile()
Constructor.
Definition:
cmfile.cpp:80
firevision::Colormap
Definition:
colormap.h:40
firevision::ColormapFile
Definition:
cmfile.h:58
firevision::ColormapFile::ColormapBlockVector::~ColormapBlockVector
~ColormapBlockVector()
Destructor.
Definition:
cmfile.cpp:47
src
libs
fvutils
colormap
cmfile.h
Generated by
1.8.16