/usr/include/pbihdf/HDFMovieInfoGroup.hpp is in libpbihdf-dev 0~20151014+gitbe5d1bf-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 | #ifndef HDF_MOVIE_INFO_GROUP_H_
#define HDF_MOVIE_INFO_GROUP_H_
#include "HDFGroup.hpp"
#include "HDFArray.hpp"
#include "saf/MovieInfo.hpp"
class HDFMovieInfoGroup {
public:
HDFGroup movieInfoGroup;
HDFArray<UInt> idArray;
HDFStringArray nameArray;
HDFStringArray whenStartedArray;
HDFArray<float> frameRateArray;
~HDFMovieInfoGroup() {
movieInfoGroup.Close();
}
bool Create(HDFGroup &parentGroup) {
parentGroup.AddGroup("MovieInfo");
if (movieInfoGroup.Initialize(parentGroup.group, "MovieInfo") == 0) { return 0; }
idArray.Create(movieInfoGroup, "ID");
nameArray.Create(movieInfoGroup, "Name");
return true;
}
int Initialize(HDFGroup &parentGroup) {
if (movieInfoGroup.Initialize(parentGroup.group, "MovieInfo") == 0) { return 0; }
if (idArray.Initialize(movieInfoGroup, "ID") == 0) { return 0; }
if (nameArray.Initialize(movieInfoGroup, "Name") == 0) { return 0; }
return 1;
}
void Read(MovieInfo &movieInfo) {
int nId = idArray.arrayLength;
movieInfo.id.resize(nId);
idArray.Read(0, nId, &movieInfo.id[0]);
int nName = nameArray.arrayLength;
movieInfo.name.resize(nName);
int i;
for (i = 0; i < nName; i++ ){
nameArray.Read(i,i+1,&movieInfo.name[i]);
}
}
int AddMovie(string &movieName) {
nameArray.Write(&movieName, 1);
unsigned int id = nameArray.size();
idArray.Write(&id, 1);
return id;
}
void StoreFrameRate(int movieIndex, float frameRate) {
if (movieIndex < 0) {
cout << "ERROR. Invalid movie index " << movieIndex << endl;
exit(1);
}
if (!frameRateArray.IsInitialized()) {
if (!movieInfoGroup.ContainsObject("FrameRate")) {
frameRateArray.Create(movieInfoGroup, "FrameRate");
}
else {
frameRateArray.Initialize(movieInfoGroup, "FrameRate");
}
}
frameRateArray.WriteToPos(&frameRate, 1, movieIndex);
}
};
#endif
|