iipsrv 1.3
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-2025 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 "TIFFCompressor.h"
31#ifdef HAVE_PNG
32#include "PNGCompressor.h"
33#endif
34#ifdef HAVE_WEBP
35#include "WebPCompressor.h"
36#endif
37#ifdef HAVE_AVIF
38#include "AVIFCompressor.h"
39#endif
40#include "Cache.h"
41#include "Timer.h"
42#include "Logger.h"
43
44
46
48
49
50 private:
51
52 Cache* tileCache;
53 Compressor* compressor;
54 IIPImage* image;
55 Logger* logfile;
56 int loglevel;
57 Timer compression_timer, tile_timer, insert_timer;
58
60
72 RawTile getNewTile( int resolution, int tile, int xangle, int yangle, int layers, ImageEncoding e );
73
74
75 public:
76
77
79
86 TileManager( Cache* tc, IIPImage* im, Compressor* c, Logger* s, int l ) :
87 tileCache( tc ),
88 compressor( c ),
89 image( im ),
90 logfile( s ),
91 loglevel( l ) {};
92
93
94
96
108 RawTile getTile( int resolution, int tile, int xangle, int yangle, int layers, ImageEncoding c );
109
110
111
113
126 RawTile getRegion( unsigned int res, int xangle, int yangle, int layers, unsigned int x, unsigned int y, unsigned int w, unsigned int h );
127
128};
129
130
131#endif
Cache to store raw tile data.
Definition Cache.h:90
Base class for IIP output images.
Definition Compressor.h:31
Base class to handle the input image sources.
Definition IIPImage.h:69
Logger class - handles ofstreams and syslog.
Definition Logger.h:79
Class to represent a single image tile.
Definition RawTile.h:45
Class to manage access to the tile cache.
Definition TileManager.h:47
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.
Definition TileManager.cc:294
RawTile getTile(int resolution, int tile, int xangle, int yangle, int layers, ImageEncoding c)
Get a tile from the cache.
Definition TileManager.cc:133
TileManager(Cache *tc, IIPImage *im, Compressor *c, Logger *s, int l)
Constructor.
Definition TileManager.h:86
Simple Timer class to allow us to time our responses.
Definition Timer.h:40