FACT++  1.0
void Writer::Ppm ( const char *  fname,
const byte img,
struct timeval *  date,
const TVector2  xy 
)
static

Definition at line 142 of file Writer.cc.

References video_init::name, and t.

Referenced by ~Writer().

143 {
144  TString name = fname;
145 
146  MTime t(*date);
147 
148  TString pos;
149  pos += xy.X();
150  pos = pos.Strip(TString::kBoth);
151  pos +="_";
152  TString posy;
153  posy += xy.Y();
154  posy = posy.Strip(TString::kBoth);
155  pos +=posy;
156 
157  name += "_";
158  name += t.GetMjd()-52000;
159  name += "_";
160  name += pos;
161  name += ".ppm";
162 
163  cout << "Writing PPM '" << name << "'" << endl;
164 
165  //
166  // open file for writing
167  //
168  ofstream fout(name);
169  if (!fout)
170  {
171  cout << "Warning: Cannot open file for writing." << endl;
172  return;
173  }
174 
175  //
176  // write buffer to file
177  //
178  fout << "P6\n768 576\n255\n";
179  for (byte const *buf = img; buf < img+768*576; buf++)
180  fout << *buf << *buf << *buf;
181 }
unsigned char byte
Definition: MGImage.h:17
TT t
Definition: test_client.c:26

+ Here is the caller graph for this function: