iipsrv  1.0
TileManager.h
1 // Tile Cache Manager Class
2 
3 /* IIP Image Server
4 
5  Copyright (C) 2005-2013 Ruven Pillay.
6 
7  This program is free software; you can redistribute it and/or modify
8  it under the terms of the GNU General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software Foundation,
19  Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
20 */
21 
22 
23 #ifndef _TILEMANAGER_H
24 #define _TILEMANAGER_H
25 
26 
27 #include <fstream>
28 
29 #include "RawTile.h"
30 #include "IIPImage.h"
31 #include "JPEGCompressor.h"
32 #include "Cache.h"
33 #include "Timer.h"
34 #include "Watermark.h"
35 
36 
37 
39 
41 
42 
43  private:
44 
45  Cache* tileCache;
46  JPEGCompressor* jpeg;
47  IIPImage* image;
48  Watermark* watermark;
49  std::ofstream* logfile;
50  int loglevel;
51  Timer compression_timer, tile_timer, insert_timer;
52 
54 
66  RawTile getNewTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
67 
68 
70 
72  void crop( RawTile* t );
73 
74 
75  public:
76 
77 
79 
87  TileManager( Cache* tc, IIPImage* im, Watermark* w, JPEGCompressor* j, std::ofstream* s, int l ){
88  tileCache = tc;
89  image = im;
90  watermark = w;
91  jpeg = j;
92  logfile = s ;
93  loglevel = l;
94  };
95 
96 
97 
99 
111  RawTile getTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
112 
113 
114 
116 
129  RawTile getRegion( unsigned int res, int xangle, int yangle, int layers, unsigned int x, unsigned int y, unsigned int w, unsigned int h );
130 
131 };
132 
133 
134 #endif
Wrapper class to the IJG JPEG library.
Definition: JPEGCompressor.h:60
Cache to store raw tile data.
Definition: Cache.h:91
RawTile getRegion(unsigned int res, int xangle, int yangle, int layers, unsigned int x, unsigned int y, unsigned int w, unsigned int h)
Generate a complete region.
Class to manage access to the tile cache and tile cropping.
Definition: TileManager.h:40
Watermark class.
Definition: Watermark.h:41
Main class to handle the pyramidal image source.
Definition: IIPImage.h:61
TileManager(Cache *tc, IIPImage *im, Watermark *w, JPEGCompressor *j, std::ofstream *s, int l)
Constructor.
Definition: TileManager.h:87
RawTile getTile(int resolution, int tile, int xangle, int yangle, int layers, CompressionType c)
Get a tile from the cache.
Simple Timer class to allow us to time our responses.
Definition: Timer.h:39
Class to represent a single image tile.
Definition: RawTile.h:45