1//
2// SPDX-License-Identifier: BSD-3-Clause
3// Copyright (c) Contributors to the OpenEXR Project.
4//
5
6#ifndef INCLUDED_IMF_TILE_DESCRIPTION_H
7#define INCLUDED_IMF_TILE_DESCRIPTION_H
8
9//-----------------------------------------------------------------------------
10//
11// class TileDescription and enum LevelMode
12//
13//-----------------------------------------------------------------------------
14#include "ImfExport.h"
15#include "ImfNamespace.h"
16
17OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_ENTER
18
19
20enum IMF_EXPORT_ENUM LevelMode
21{
22 ONE_LEVEL = 0,
23 MIPMAP_LEVELS = 1,
24 RIPMAP_LEVELS = 2,
25
26 NUM_LEVELMODES // number of different level modes
27};
28
29
30enum IMF_EXPORT_ENUM LevelRoundingMode
31{
32 ROUND_DOWN = 0,
33 ROUND_UP = 1,
34
35 NUM_ROUNDINGMODES // number of different rounding modes
36};
37
38
39class IMF_EXPORT_TYPE TileDescription
40{
41 public:
42
43 unsigned int xSize; // size of a tile in the x dimension
44 unsigned int ySize; // size of a tile in the y dimension
45 LevelMode mode;
46 LevelRoundingMode roundingMode;
47
48 TileDescription (unsigned int xs = 32,
49 unsigned int ys = 32,
50 LevelMode m = ONE_LEVEL,
51 LevelRoundingMode r = ROUND_DOWN)
52 :
53 xSize (xs),
54 ySize (ys),
55 mode (m),
56 roundingMode (r)
57 {
58 // empty
59 }
60
61 bool
62 operator == (const TileDescription &other) const
63 {
64 return xSize == other.xSize &&
65 ySize == other.ySize &&
66 mode == other.mode &&
67 roundingMode == other.roundingMode;
68 }
69};
70
71
72OPENEXR_IMF_INTERNAL_NAMESPACE_HEADER_EXIT
73
74
75
76
77
78#endif
79

source code of include/OpenEXR/ImfTileDescription.h