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
TPTImage.h
1// Tiled Pyramidal Tiff class interface
2
3/* IIPImage Tiled Pyramidal TIFF Class
4
5 Copyright (C) 2000-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 _TPTIMAGE_H
24#define _TPTIMAGE_H
25
26
27#include "IIPImage.h"
28#include <tiffio.h>
29
30
31
32
34class TPTImage : public IIPImage {
35
36 private:
37
39 TIFF *tiff;
40
42 std::vector<uint32_t> subifds;
43
45 tdir_t subifd_ifd;
46
48 void loadSubIFDs();
49
51 void loadStackInfo();
52
53
54 public:
55
57 TPTImage():IIPImage(), tiff( NULL ) {};
58
59
61
63 TPTImage( const std::string& path ): IIPImage(path), tiff(NULL), subifd_ifd(0) {};
64
65
67
69 TPTImage( const TPTImage& image ): IIPImage(image), tiff(NULL), subifd_ifd(0) {};
70
71
73
76 if( this != &image ){
77 closeImage();
79 tiff = image.tiff;
80 }
81 return *this;
82 }
83
84
86
88 TPTImage( const IIPImage& image ): IIPImage(image), tiff(NULL), subifd_ifd(0) {};
89
90
93
94
96 static void setupLogging();
97
98
100
101 static std::string getCodecVersion(){
102 std::string version = std::string( TIFFGetVersion() );
103 // Strip off everything after newline
104 version = version.substr( 0, version.find_first_of("\n") );
105 return version;
106 }
107
108
110 void openImage();
111
112
114
117 void loadImageInfo( int x, int y );
118
119
121 void closeImage();
122
123
125
132 RawTile getTile( int x, int y, unsigned int r, int l, unsigned int t, ImageEncoding e = ImageEncoding::RAW );
133
134};
135
136
137#endif
Base class to handle the input image sources.
Definition IIPImage.h:69
IIPImage & operator=(IIPImage image)
Assignment operator.
Definition IIPImage.h:459
Class to represent a single image tile.
Definition RawTile.h:45
Image class for Tiled Pyramidal TIFF Images: Inherits from IIPImage. Uses libtiff.
Definition TPTImage.h:34
TPTImage()
Constructor.
Definition TPTImage.h:57
void loadImageInfo(int x, int y)
Overloaded function for loading TIFF image information.
Definition TPTImage.cc:92
RawTile getTile(int x, int y, unsigned int r, int l, unsigned int t, ImageEncoding e=ImageEncoding::RAW)
Overloaded function for getting a particular tile.
Definition TPTImage.cc:346
static void setupLogging()
Overloaded static function for seting up logging for codec library.
Definition TPTImage.cc:58
TPTImage(const std::string &path)
Constructor.
Definition TPTImage.h:63
void closeImage()
Overloaded function for closing a TIFF image.
Definition TPTImage.cc:336
TPTImage(const IIPImage &image)
Construct from an IIPImage object.
Definition TPTImage.h:88
~TPTImage()
Destructor.
Definition TPTImage.h:92
TPTImage & operator=(TPTImage image)
Assignment Operator.
Definition TPTImage.h:75
static std::string getCodecVersion()
Get codec version.
Definition TPTImage.h:101
void openImage()
Overloaded function for opening a TIFF image.
Definition TPTImage.cc:64
TPTImage(const TPTImage &image)
Copy Constructor.
Definition TPTImage.h:69