-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathStaticBackgroundCompressorLoader.cpp
More file actions
66 lines (59 loc) · 2.47 KB
/
StaticBackgroundCompressorLoader.cpp
File metadata and controls
66 lines (59 loc) · 2.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
/*
* File: StaticBackgroundCompressorLoader.cpp
* Author: Marc
*
* Created on November 5, 2010, 4:14 PM
*
* (C) Marc Gershow; licensed under the Creative Commons Attribution Share Alike 3.0 United States License.
* To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/us/ or send a letter to
* Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.
*
*/
#include "StaticBackgroundCompressorLoader.h"
using namespace std;
StaticBackgroundCompressor *StaticBackgroundCompressorLoader::fromFile(std::ifstream& is) {
uint32_t id;
ifstream::pos_type cloc = is.tellg();
is.read((char *) &id, sizeof(id));
is.seekg(cloc);
switch(id) {
case StaticBackgroundCompressor::IdCode:
return StaticBackgroundCompressor::fromDisk(is);
break;
default:
cout << "did not recognize ID code " << hex << id << dec << endl;
cout << "you may need to update the software - search for ID code " << hex << id << dec << " in source code on github." << endl;
//assert (false); // bad ID code when trying to load staticbackgroundcompressor (image stack)
return NULL; //StaticBackgroundCompressor::fromDisk(is);
break;
}
}
StaticBackgroundCompressor::HeaderInfoT StaticBackgroundCompressorLoader::getHeaderInfo(std::ifstream& is) {
uint32_t id;
ifstream::pos_type cloc = is.tellg();
is.read((char *) &id, sizeof(id));
is.seekg(cloc);
switch(id) {
case StaticBackgroundCompressor::IdCode:
return StaticBackgroundCompressor::getHeaderInfo(is);
break;
default:
cout << "did not recognize ID code " << hex << id << dec << endl;
cout << "you may need to update the software - search for ID code " << hex << id << dec << " in source code on github." << endl;
// assert (false);// bad ID code when trying to read staticbackgroundcompressor (image stack) header
// return StaticBackgroundCompressor::getHeaderInfo(is);
break;
}
StaticBackgroundCompressor::HeaderInfoT hi;
hi.numframes = 0;
hi.idcode = 0;
hi.totalSize = 0;
hi.headerSize = 0;
return hi;
}
StaticBackgroundCompressorLoader::StaticBackgroundCompressorLoader() {
}
StaticBackgroundCompressorLoader::StaticBackgroundCompressorLoader(const StaticBackgroundCompressorLoader& orig) {
}
StaticBackgroundCompressorLoader::~StaticBackgroundCompressorLoader() {
}