00001 //Copyright 1999-2008 Catherine Pelachaud - c.pelachaud@iut.univ-paris8.fr 00002 // 00003 //This file is part of Greta. 00004 // 00005 //Greta is free software; you can redistribute it and/or modify 00006 //it under the terms of the GNU General Public License as published by 00007 //the Free Software Foundation; either version 2 of the License, or 00008 //(at your option) any later version. 00009 // 00010 //Greta is distributed in the hope that it will be useful, 00011 //but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 //MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00013 //GNU General Public License for more details. 00014 // 00015 //You should have received a copy of the GNU General Public License 00016 //along with Greta; if not, write to the Free Software 00017 //Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 00019 00020 #ifndef FAPS_H 00021 #define FAPS_H 00022 00023 #define _CRT_SECURE_NO_DEPRECATE 00024 00025 #include "SO3Loader3d.h" 00026 #include "FAPU_FDPs.h" 00027 #include "FAPFrame.h" 00028 00029 //Animation of the model is described only by the FAPs 00030 //Define the displacements of the feature points in relation to their positions in the neutral face 00031 //FAPs usually encode magnitude of displacement of a feature point along one of the three Cartesian axes 00032 //(except in cases where it encodes rotation of whole head, eyeball, etc) 00033 //FAPs: 68 parameters categorised into 10 groups related to parts of the face 00034 //Example: FAP 3 = open jaw, FDP: Grp 2, Subgrp 1 (2.1), pos motion: down, units: MNS, Unidir 00035 //replaces FAPtype 00036 //FAPs 48, 49, 50 are the head rotation 00042 class FAPdata 00043 { 00044 public: 00045 00051 FAPdata(); 00052 00057 ~FAPdata(); 00058 00059 bool header_file_init(char*filename); //fill in the numFrames, fps and version from a header file 00060 void allocate_FAP_data(void); //allocate main structures 00061 void deallocate_FAP_data(void); //deallocate main structures 00062 00063 00072 bool ReadFapFile(char*fapfilename); 00073 00082 int ReadFapBuffer(std::string buffer1,std::string buffer2); 00083 00093 float CalibrateFaps(int fapnum, const FAPUdata *FAPUs); 00094 00104 void ScaleFAPs(int frameind, FDPdata*FDPs, const FAPUdata *FAPUs); 00105 00116 void Fap2LFap(int fapnum, int frameind, FDPdata*FDPs, const FAPUdata *FAPUs); 00117 00127 void LoadFAPFrame(FAPFrame*frame, FDPdata*FDPs, const FAPUdata *FAPUs); 00128 00129 00130 00138 void print(void); 00139 00140 FAPFrameVector frames; 00141 std::vector<float>lfaps; 00142 int numberofframes; 00143 int fps; 00144 00145 float version; 00146 00147 private: 00148 char*basename; /*[256]*/ 00149 }; 00150 00151 00152 #endif
1.6.3