PlayerGlobalInfo.cpp 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. #include "PlayerGlobalInfo.h"
  2. /* 移动构造函数 */
  3. Image_YUV420::Image_YUV420(Image_YUV420&& other)
  4. {
  5. yData = std::move(other.yData);
  6. uData = std::move(other.uData);
  7. vData = std::move(other.vData);
  8. width = other.width;
  9. height = other.height;
  10. }
  11. /* 拷贝构造函数 */
  12. Image_YUV420::Image_YUV420(const Image_YUV420& other)
  13. {
  14. yData = other.yData;
  15. uData = other.uData;
  16. vData = other.vData;
  17. width = other.width;
  18. height = other.height;
  19. }
  20. /* 重载= */
  21. Image_YUV420& Image_YUV420::operator=(const Image_YUV420& other)
  22. {
  23. yData = other.yData;
  24. uData = other.uData;
  25. vData = other.vData;
  26. width = other.width;
  27. height = other.height;
  28. return *this;
  29. }
  30. /* 移动幅值函数 */
  31. Image_YUV420& Image_YUV420::operator=(Image_YUV420&& other)
  32. {
  33. yData = std::move(other.yData);
  34. uData = std::move(other.uData);
  35. vData = std::move(other.vData);
  36. width = other.width;
  37. height = other.height;
  38. return *this;
  39. }
  40. Image_QImage::Image_QImage()
  41. {
  42. width = 0;
  43. height = 0;
  44. /* 设置为RGB888 */
  45. image = QImage(1, 1, QImage::Format_RGB888);
  46. }
  47. /* 移动构造函数 */
  48. Image_QImage::Image_QImage(Image_QImage&& other)
  49. {
  50. width = other.width;
  51. height = other.height;
  52. image = std::move(other.image);
  53. }
  54. /* 拷贝构造函数 */
  55. Image_QImage::Image_QImage(const Image_QImage& other)
  56. {
  57. width = other.width;
  58. height = other.height;
  59. image = other.image;
  60. }
  61. /* 重载= */
  62. Image_QImage& Image_QImage::operator=(const Image_QImage& other)
  63. {
  64. width = other.width;
  65. height = other.height;
  66. image = other.image;
  67. return *this;
  68. }
  69. /* 移动幅值函数 */
  70. void Image_QImage::moveFrom(Image_QImage& other)
  71. {
  72. width = other.width;
  73. height = other.height;
  74. image = std::move(other.image);
  75. }