source: subversion/lib/libimg/img2img.cpp @ 2485

Last change on this file since 2485 was 2092, checked in by enxrah, 13 years ago

Nick didn't write this. I did :-)

File size: 1.3 KB
Line 
1/*
2    Copyright (C) 2007 Robert Hart, rob@bathterror.free-online.co.uk
3
4    This program is free software; you can redistribute it and/or modify
5    it under the terms of the GNU General Public License as published by
6    the Free Software Foundation; either version 2 of the License, or
7    (at your option) any later version.
8
9    This program is distributed in the hope that it will be useful,
10    but WITHOUT ANY WARRANTY; without even the implied warranty of
11    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12    GNU Lesser General Public License for more details.
13
14    You should have received a copy of the GNU General Public License
15    along with this program; if not, write to the Free Software
16    Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111 USA
17
18 */
19#include "Img.h"
20#include <iostream>
21#include <fstream>
22#include <sstream>
23#include <string>
24#include "time.h"
25
26using std::cout;
27using std::cout;
28using std::endl;
29
30int main(int argc,char* argv[])
31{
32        if(argc<3)
33        {
34                cout<<"Usage: img2img InImgFile OutImgFile" << endl;
35                exit(1);
36        }
37
38        Img ImgFile;
39        std::ifstream in(argv[1]);
40        std::ofstream out(argv[2]);
41        cout << "Reading file " << argv[1] << endl;
42        ImgFile.ReadFile(in);
43        cout << "Done\n";
44        cout << "Writing file " << argv[2] << endl;
45        ImgFile.WriteFile(out);
46        in.close();
47        out.close();
48        return 0;
49}
Note: See TracBrowser for help on using the repository browser.