source: subversion/applications/lib/libimg/img2img.cpp @ 11688

Last change on this file since 11688 was 11688, checked in by nienhueser, 11 years ago

compile.

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 <cstdlib>
25#include "time.h"
26
27using std::cout;
28using std::cout;
29using std::endl;
30
31int main(int argc,char* argv[])
32{
33        if(argc<3)
34        {
35                cout<<"Usage: img2img InImgFile OutImgFile" << endl;
36                exit(1);
37        }
38
39        Img ImgFile;
40        std::ifstream in(argv[1]);
41        std::ofstream out(argv[2]);
42        cout << "Reading file " << argv[1] << endl;
43        ImgFile.ReadFile(in);
44        cout << "Done\n";
45        cout << "Writing file " << argv[2] << endl;
46        ImgFile.WriteFile(out);
47        in.close();
48        out.close();
49        return 0;
50}
Note: See TracBrowser for help on using the repository browser.