bioformats  5.1.2
TileInfo.h
1 /*
2  * #%L
3  * OME-BIOFORMATS 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_BIOFORMATS_TIFF_TILEINFO_H
39 #define OME_BIOFORMATS_TIFF_TILEINFO_H
40 
41 #include <ome/bioformats/PlaneRegion.h>
42 #include <ome/bioformats/tiff/Types.h>
43 
44 #include <ome/compat/memory.h>
45 
46 namespace ome
47 {
48  namespace bioformats
49  {
50  namespace tiff
51  {
52 
53  class IFD;
54 
61  class TileInfo
62  {
63  protected:
64  friend class IFD;
65 
71  TileInfo(ome::compat::shared_ptr<IFD> ifd);
72 
73  public:
75  virtual ~TileInfo();
76 
82  TileType
83  tileType() const;
84 
91  tileWidth() const;
92 
99  tileHeight() const;
100 
107  tileCount() const;
108 
115  tileRowCount() const;
116 
123  tileColumnCount() const;
124 
131  bufferSize() const;
132 
144  dimension_size_type s = 0) const;
145 
153  tileColumn(dimension_size_type index) const;
154 
162  tileRow(dimension_size_type index) const;
163 
173  tileSample(dimension_size_type index) const;
174 
194  const PlaneRegion& clip) const;
195 
212  tileRegion(dimension_size_type index) const;
213 
224  std::vector<dimension_size_type>
225  tileCoverage(PlaneRegion region) const;
226 
227  protected:
228  class Impl;
230  ome::compat::shared_ptr<Impl> impl;
231  };
232 
233  }
234  }
235 }
236 
237 #endif // OME_BIOFORMATS_TIFF_TILEINFO_H
238 
239 /*
240  * Local Variables:
241  * mode:C++
242  * End:
243  */
Tile information for an IFD.
Definition: TileInfo.h:61
dimension_size_type tileColumnCount() const
Get the total number of columns.
Definition: TileInfo.cpp:216
dimension_size_type bufferSize() const
Get the buffer size needed to contain a single tile.
Definition: TileInfo.cpp:222
Memory type substitution.
TileType tileType() const
Get the type of a tile.
Definition: TileInfo.cpp:186
dimension_size_type tileWidth() const
Get the width of a tile.
Definition: TileInfo.cpp:192
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:228
virtual ~TileInfo()
Destructor.
Definition: TileInfo.cpp:181
TileInfo(ome::compat::shared_ptr< IFD > ifd)
Constructor.
Definition: TileInfo.cpp:176
Open Microscopy Environment C++ implementation.
Definition: CoreMetadata.cpp:40
PlaneRegion tileRegion(dimension_size_type index, const PlaneRegion &clip) const
Get the region covered by the given tile index.
Definition: TileInfo.cpp:278
dimension_size_type tileHeight() const
Get the height of a tile.
Definition: TileInfo.cpp:198
dimension_size_type tileSample(dimension_size_type index) const
Get the sample index for the given tile index.
Definition: TileInfo.cpp:257
dimension_size_type tileRow(dimension_size_type index) const
Get the row index for the given tile index.
Definition: TileInfo.cpp:248
dimension_size_type tileRowCount() const
Get the total number of rows.
Definition: TileInfo.cpp:210
Image File Directory (IFD).
Definition: IFD.h:71
ome::compat::shared_ptr< Impl > impl
Private implementation details.
Definition: TileInfo.h:228
std::vector< dimension_size_type > tileCoverage(PlaneRegion region) const
Get a list of the tiles covering an image region.
Definition: TileInfo.cpp:286
std::size_t dimension_size_type
Size type for image dimensions.
Definition: Types.h:59
Internal implementation details of TileInfo.
Definition: TileInfo.cpp:62
dimension_size_type tileColumn(dimension_size_type index) const
Get the column index for the given tile index.
Definition: TileInfo.cpp:239
TileType
Type of tile.
Definition: Types.h:208
A rectangular region.
Definition: PlaneRegion.h:56
dimension_size_type tileCount() const
Get the total number of tiles.
Definition: TileInfo.cpp:204