QGearsCameraMatrixFileSerializer.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. * Copyright (C) 2022 The V-Gears Team
  3. *
  4. * This file is part of V-Gears
  5. *
  6. * V-Gears is free software: you can redistribute it and/or modify it under
  7. * terms of the GNU General Public License as published by the Free Software
  8. * Foundation, version 3.0 (GPLv3) of the License.
  9. *
  10. * V-Gears is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. */
  15. #pragma once
  16. #include "common/TypeDefine.h"
  17. #include "QGearsCameraMatrixFile.h"
  18. #include "QGearsSerializer.h"
  19. namespace QGears{
  20. /**
  21. * Handles the serialization of camera matrix files.
  22. */
  23. class CameraMatrixFileSerializer : public Serializer{
  24. public:
  25. /**
  26. * Constructor.
  27. */
  28. CameraMatrixFileSerializer();
  29. /**
  30. * Destructor.
  31. */
  32. virtual ~CameraMatrixFileSerializer();
  33. enum{
  34. /**
  35. * Rows in a camera matrix.
  36. *
  37. * Same as {@see CAMERA_MATRIX_COL_COUNT}.
  38. */
  39. CAMERA_MATRIX_ROW_COUNT = 3,
  40. /**
  41. * Columns in a camera matrix.
  42. *
  43. * Same as {@see CAMERA_MATRIX_ROW_COUNT}.
  44. */
  45. CAMERA_MATRIX_COL_COUNT = CAMERA_MATRIX_ROW_COUNT,
  46. /**
  47. * Elements in a camera matrix.
  48. *
  49. * Same as {@see CAMERA_MATRIX_ROW_COUNT} *
  50. * {@see CAMERA_MATRIX_COL_COUNT}.
  51. */
  52. CAMERA_MATRIX_ENTRY_COUNT
  53. = CAMERA_MATRIX_ROW_COUNT * CAMERA_MATRIX_COL_COUNT,
  54. /**
  55. * Total size of a camera matrix.
  56. */
  57. TOTAL_DATA_SIZE = 0x26,
  58. };
  59. /**
  60. * Imports an camera matrix file.
  61. *
  62. * @param stream[in] The contents of the file.
  63. * @param dest[out] The formad camera matrix file.
  64. */
  65. virtual void ImportCameraMatrixFile(
  66. Ogre::DataStreamPtr &stream, CameraMatrixFile* dest
  67. );
  68. };
  69. }