File indexing completed on 2024-04-28 15:16:13

0001 /*
0002     SPDX-FileCopyrightText: 2005-2007 Torsten Rahn <tackat@kde.org>
0003     SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
0004     SPDX-FileCopyrightText: 2008 Patrick Spendrin <ps_ml@gmx.de>
0005     SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <jensmh@gmx.de>
0006 
0007     SPDX-License-Identifier: LGPL-2.0-or-later
0008 */
0009 
0010 #ifndef MARBLE_TILELOADERHELPER_H
0011 #define MARBLE_TILELOADERHELPER_H
0012 
0013 #include "marble_export.h"
0014 
0015 namespace Marble
0016 {
0017 
0018 namespace TileLoaderHelper
0019 {
0020     /**
0021      * @brief Get the maximum number of tile rows for a given tile level.
0022      * @param levelZeroRows  the number of rows in level zero
0023      * @param level  the tile level
0024      * @return       the maximum number of rows that a map level was tiled into. 
0025      *               If the tile level number is invalid then "-1" gets 
0026      *               returned so this case of wrong input data can get caught 
0027      *               by the code which makes use of it.
0028      */
0029     MARBLE_EXPORT int levelToRow( int levelZeroRows, int level );
0030 
0031     /**
0032      * @brief Get the maximum number of tile columns for a given tile level.
0033      * @param levelZeroColumns  the number of columns in level zero
0034      * @param level  the tile level
0035      * @return       the maximum number of columns that a map level was tiled into. 
0036      *               If the tile level number is invalid then "-1" gets 
0037      *               returned so this case of wrong input data can get caught 
0038      *               by the code which makes use of it.
0039      */
0040     MARBLE_EXPORT int levelToColumn( int levelZeroColumns, int level );
0041 
0042     /**
0043      * @brief Get the tile level for the given maximum number of tile columns.
0044      * @param levelZeroRows  the number of rows in level zero
0045      * @param row    the maximum number of rows that a map level was tiled into.
0046      * @return       the corresponding tile level.
0047      *               If the number of rows is invalid then "-1" gets 
0048      *               returned so this case of wrong input data can get caught 
0049      *               by the code which makes use of it.
0050      */
0051     MARBLE_EXPORT int rowToLevel( int levelZeroRows, int row );
0052 
0053     /**
0054      * @brief Get the tile level for the given maximum number of tile columns.
0055      * @param levelZeroColumns  the number of columns in level zero
0056      * @param column the maximum number of columns that a map level was tiled into.
0057      * @return       the corresponding tile level.
0058      *               If the number of columns is invalid then "-1" gets 
0059      *               returned so this case of wrong input data can get caught 
0060      *               by the code which makes use of it.
0061      */
0062     MARBLE_EXPORT int columnToLevel( int levelZeroColumns, int column );
0063 }
0064 
0065 }
0066 
0067 #endif // MARBLE_TILELOADERHELPER_H