iipsrv  0.9.9
TileManager.h
1 // Tile Cache Manager Class
2 
3 /* IIP Image Server
4 
5  Copyright (C) 2005-2010 Ruven Pillay.
6  Based on an LRU cache by Patrick Audley <http://blackcat.ca/lifeline/query.php/tag=LRU_CACHE>
7  Copyright (C) 2004 by Patrick Audley
8 
9  This program is free software; you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation; either version 2 of the License, or
12  (at your option) any later version.
13 
14  This program is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with this program; if not, write to the Free Software
21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 */
23 
24 
25 #ifndef _TILEMANAGER_H
26 #define _TILEMANAGER_H
27 
28 
29 #include <fstream>
30 
31 #include "RawTile.h"
32 #include "IIPImage.h"
33 #include "JPEGCompressor.h"
34 #include "Cache.h"
35 #include "Timer.h"
36 #include "Watermark.h"
37 
38 
39 
41 
43 
44 
45  private:
46 
47  Cache* tileCache;
48  JPEGCompressor* jpeg;
49  IIPImage* image;
50  Watermark* watermark;
51  std::ofstream* logfile;
52  int loglevel;
53  Timer compression_timer, tile_timer, insert_timer;
54 
56 
68  RawTile getNewTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
69 
70 
72 
74  void crop( RawTile* t );
75 
76 
77  public:
78 
79 
81 
89  TileManager( Cache* tc, IIPImage* im, Watermark* w, JPEGCompressor* j, std::ofstream* s, int l ){
90  tileCache = tc;
91  image = im;
92  watermark = w;
93  jpeg = j;
94  logfile = s ;
95  loglevel = l;
96  };
97 
98 
99 
101 
113  RawTile getTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
114 
115 
116 };
117 
118 
119 #endif