ome-files  0.5.0
TileInfo.h
1 /*
2  * #%L
3  * OME-FILES C++ library for image IO.
4  * Copyright © 2006 - 2015 Open Microscopy Environment:
5  * - Massachusetts Institute of Technology
6  * - National Institutes of Health
7  * - University of Dundee
8  * - Board of Regents of the University of Wisconsin-Madison
9  * - Glencoe Software, Inc.
10  * %%
11  * Redistribution and use in source and binary forms, with or without
12  * modification, are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30  * POSSIBILITY OF SUCH DAMAGE.
31  *
32  * The views and conclusions contained in the software and documentation are
33  * those of the authors and should not be interpreted as representing official
34  * policies, either expressed or implied, of any organization.
35  * #L%
36  */
37 
38 #ifndef OME_FILES_TIFF_TILEINFO_H
39 #define OME_FILES_TIFF_TILEINFO_H
40 
41 #include <memory>
42 
43 #include <ome/files/PlaneRegion.h>
44 #include <ome/files/tiff/Types.h>
45 
46 namespace ome
47 {
48  namespace files
49  {
50  namespace tiff
51  {
52 
53  class IFD;
54 
61  class TileInfo
62  {
63  protected:
65  friend class IFD;
66 
72  TileInfo(std::shared_ptr<IFD> ifd);
73 
74  public:
76  virtual ~TileInfo();
77 
83  TileType
84  tileType() const;
85 
92  tileWidth() const;
93 
100  tileHeight() const;
101 
108  tileCount() const;
109 
116  tileRowCount() const;
117 
124  tileColumnCount() const;
125 
132  bufferSize() const;
133 
145  dimension_size_type s = 0) const;
146 
154  tileColumn(dimension_size_type index) const;
155 
163  tileRow(dimension_size_type index) const;
164 
174  tileSample(dimension_size_type index) const;
175 
195  const PlaneRegion& clip) const;
196 
213  tileRegion(dimension_size_type index) const;
214 
225  std::vector<dimension_size_type>
226  tileCoverage(PlaneRegion region) const;
227 
228  protected:
229  class Impl;
231  std::shared_ptr<Impl> impl;
232  };
233 
234  }
235  }
236 }
237 
238 #endif // OME_FILES_TIFF_TILEINFO_H
239 
240 /*
241  * Local Variables:
242  * mode:C++
243  * End:
244  */
TileType
Type of tile.
Definition: Types.h:217
dimension_size_type tileRow(dimension_size_type index) const
Get the row index for the given tile index.
Definition: TileInfo.cpp:247
dimension_size_type tileWidth() const
Get the width of a tile.
Definition: TileInfo.cpp:191
std::size_t dimension_size_type
Size type for image dimensions.
Definition: Types.h:58
Tile information for an IFD.
Definition: TileInfo.h:61
dimension_size_type tileRowCount() const
Get the total number of rows.
Definition: TileInfo.cpp:209
dimension_size_type tileCount() const
Get the total number of tiles.
Definition: TileInfo.cpp:203
Open Microscopy Environment C++.
dimension_size_type tileIndex(dimension_size_type x, dimension_size_type y, dimension_size_type s=0) const
Get the tile index covering the given coordinates.
Definition: TileInfo.cpp:227
dimension_size_type tileSample(dimension_size_type index) const
Get the sample index for the given tile index.
Definition: TileInfo.cpp:256
std::vector< dimension_size_type > tileCoverage(PlaneRegion region) const
Get a list of the tiles covering an image region.
Definition: TileInfo.cpp:285
dimension_size_type tileColumnCount() const
Get the total number of columns.
Definition: TileInfo.cpp:215
dimension_size_type tileColumn(dimension_size_type index) const
Get the column index for the given tile index.
Definition: TileInfo.cpp:238
PlaneRegion tileRegion(dimension_size_type index, const PlaneRegion &clip) const
Get the region covered by the given tile index.
Definition: TileInfo.cpp:277
std::shared_ptr< Impl > impl
Private implementation details.
Definition: TileInfo.h:229
virtual ~TileInfo()
Destructor.
Definition: TileInfo.cpp:180
Image File Directory (IFD).
Definition: IFD.h:70
dimension_size_type bufferSize() const
Get the buffer size needed to contain a single tile.
Definition: TileInfo.cpp:221
TileInfo(std::shared_ptr< IFD > ifd)
Constructor.
Definition: TileInfo.cpp:175
Internal implementation details of TileInfo.
Definition: TileInfo.cpp:61
dimension_size_type tileHeight() const
Get the height of a tile.
Definition: TileInfo.cpp:197
A rectangular region.
Definition: PlaneRegion.h:63
TileType tileType() const
Get the type of a tile.
Definition: TileInfo.cpp:185