iipsrv  0.9.9
TileManager.h
00001 // Tile Cache Manager Class
00002 
00003 /*  IIP Image Server
00004 
00005     Copyright (C) 2005-2010 Ruven Pillay.
00006     Based on an LRU cache by Patrick Audley <http://blackcat.ca/lifeline/query.php/tag=LRU_CACHE>
00007     Copyright (C) 2004 by Patrick Audley
00008 
00009     This program is free software; you can redistribute it and/or modify
00010     it under the terms of the GNU General Public License as published by
00011     the Free Software Foundation; either version 2 of the License, or
00012     (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 */
00023 
00024 
00025 #ifndef _TILEMANAGER_H
00026 #define _TILEMANAGER_H
00027 
00028 
00029 #include <fstream>
00030 
00031 #include "RawTile.h"
00032 #include "IIPImage.h"
00033 #include "JPEGCompressor.h"
00034 #include "Cache.h"
00035 #include "Timer.h"
00036 #include "Watermark.h"
00037 
00038 
00039 
00041 
00042 class TileManager{
00043 
00044 
00045  private:
00046 
00047   Cache* tileCache;
00048   JPEGCompressor* jpeg;
00049   IIPImage* image;
00050   Watermark* watermark;
00051   std::ofstream* logfile;
00052   int loglevel;
00053   Timer compression_timer, tile_timer, insert_timer;
00054 
00056 
00068   RawTile getNewTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
00069 
00070 
00072 
00074   void crop( RawTile* t );
00075 
00076 
00077  public:
00078 
00079 
00081 
00089   TileManager( Cache* tc, IIPImage* im, Watermark* w, JPEGCompressor* j, std::ofstream* s, int l ){
00090     tileCache = tc; 
00091     image = im;
00092     watermark = w;
00093     jpeg = j;
00094     logfile = s ;
00095     loglevel = l;
00096   };
00097 
00098 
00099 
00101 
00113   RawTile getTile( int resolution, int tile, int xangle, int yangle, int layers, CompressionType c );
00114 
00115 
00116 };
00117 
00118 
00119 #endif