iipsrv  1.1
iipsrv is an advanced high-performance feature-rich image server for web-based streamed viewing and zooming of ultra high-resolution images
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 "RawTile.h"
28 #include "IIPImage.h"
29 #include "JPEGCompressor.h"
30 #include "Cache.h"
31 #include "Timer.h"
32 #include "Watermark.h"
33 #include "Logger.h"
34 
35 
37 
39 
40 
41  private:
42 
43  Cache* tileCache;
44  Compressor* jpeg;
45  IIPImage* image;
46  Watermark* watermark;
47  Logger* logfile;
48  int loglevel;
49  Timer compression_timer, tile_timer, insert_timer;
50 
52 
64  RawTile getNewTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
65 
66 
68 
70  void crop( RawTile* t );
71 
72 
73  public:
74 
75 
77 
85  TileManager( Cache* tc, IIPImage* im, Watermark* w, Compressor* j, Logger* s, int l ){
86  tileCache = tc;
87  image = im;
88  watermark = w;
89  jpeg = j;
90  logfile = s ;
91  loglevel = l;
92  };
93 
94 
95 
97 
109  RawTile getTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
110 
111 
112 
114 
127  RawTile getRegion( unsigned int res, int xangle, int yangle, int layers, unsigned int x, unsigned int y, unsigned int w, unsigned int h );
128 
129 };
130 
131 
132 #endif
TileManager::TileManager
TileManager(Cache *tc, IIPImage *im, Watermark *w, Compressor *j, Logger *s, int l)
Constructor.
Definition: TileManager.h:85
IIPImage
Main class to handle the pyramidal image source.
Definition: IIPImage.h:62
TileManager::getRegion
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.
Compressor
Base class for IIP output images.
Definition: Compressor.h:32
TileManager::getTile
RawTile getTile(int resolution, int tile, int xangle, int yangle, int layers, CompressionType c)
Get a tile from the cache.
Timer
Simple Timer class to allow us to time our responses.
Definition: Timer.h:39
TileManager
Class to manage access to the tile cache and tile cropping.
Definition: TileManager.h:38
Watermark
Watermark class.
Definition: Watermark.h:41
RawTile
Class to represent a single image tile.
Definition: RawTile.h:45
Logger
Logger class - handles ofstreams and syslog.
Definition: Logger.h:79
Cache
Cache to store raw tile data.
Definition: Cache.h:91