1 /*
2     File raster_image.hh: implementation of the RasterImage class.
3 
4     The RasterImage objects
5  */
6 
7 /*
8 
9     Copyright (C) 2014 Ferrero Andrea
10 
11     This program is free software: you can redistribute it and/or modify
12     it under the terms of the GNU General Public License as published by
13     the Free Software Foundation, either version 3 of the License, or
14     (at your option) any later version.
15 
16     This program is distributed in the hope that it will be useful,
17     but WITHOUT ANY WARRANTY; without even the implied warranty of
18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19     GNU General Public License for more details.
20 
21     You should have received a copy of the GNU General Public License
22     along with this program. If not, see <http://www.gnu.org/licenses/>.
23 
24 
25  */
26 
27 /*
28 
29     These files are distributed with PhotoFlow - http://aferrero2707.github.io/PhotoFlow/
30 
31  */
32 
33 #ifndef PF_RASTER_IMAGE_H
34 #define PF_RASTER_IMAGE_H
35 
36 #include <string>
37 
38 #include <vips/vips.h>
39 
40 #include <glibmm.h>
41 
42 //#include <gexiv2/gexiv2-metadata.h>
43 
44 #include "../base/operation.hh"
45 #include "../base/processor.hh"
46 #include "../base/imagepyramid.hh"
47 #include "../base/photoflow.hh"
48 #include "../base/exif_data.hh"
49 
50 
51 namespace PF
52 {
53 
54   class RasterImage
55   {
56     int nref;
57 		std::string file_name;
58     std::string file_name_real;
59 
60 		// VipsImage storing the raster data
61     VipsImage* image;
62 
63     exif_data_t exif_data;
64 
65     PF::ExifOrientation orientation;
66 
67     ImagePyramid pyramid;
68 
69   public:
70     RasterImage( const std::string name );
71     ~RasterImage();
72 
ref()73     void ref() { nref += 1; }
unref()74     void unref() { nref -= 1; }
get_nref()75     int get_nref() { return nref; }
76 
get_file_name()77     std::string get_file_name() { return file_name_real; }
78     VipsImage* get_image(unsigned int& level);
79 
get_orientation()80     PF::ExifOrientation get_orientation() { return orientation; }
81 
82     void print_exif( PF::exif_data_t* data );
83     void print_exif();
84     void print_icc();
85     void print_icc( VipsImage* img );
86   };
87 
88 	extern std::map<Glib::ustring, PF::RasterImage*> raster_images;
89 
90 }
91 
92 #endif
93