ImfTileDescription.h 1.5 KB

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