caps_su.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. // SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include "core/hle/service/caps/caps_types.h"
  5. #include "core/hle/service/cmif_types.h"
  6. #include "core/hle/service/service.h"
  7. namespace Core {
  8. class System;
  9. }
  10. namespace Service::Capture {
  11. enum class AlbumReportOption : s32;
  12. class AlbumManager;
  13. class IScreenShotApplicationService final : public ServiceFramework<IScreenShotApplicationService> {
  14. public:
  15. explicit IScreenShotApplicationService(Core::System& system_,
  16. std::shared_ptr<AlbumManager> album_manager);
  17. ~IScreenShotApplicationService() override;
  18. void CaptureAndSaveScreenshot(AlbumReportOption report_option);
  19. private:
  20. static constexpr std::size_t screenshot_width = 1280;
  21. static constexpr std::size_t screenshot_height = 720;
  22. static constexpr std::size_t bytes_per_pixel = 4;
  23. Result SetShimLibraryVersion(ShimLibraryVersion library_version,
  24. ClientAppletResourceUserId aruid);
  25. Result SaveScreenShotEx0(
  26. Out<ApplicationAlbumEntry> out_entry, const ScreenShotAttribute& attribute,
  27. AlbumReportOption report_option, ClientAppletResourceUserId aruid,
  28. InBuffer<BufferAttr_HipcMapTransferAllowsNonSecure | BufferAttr_HipcMapAlias>
  29. image_data_buffer);
  30. Result SaveScreenShotEx1(
  31. Out<ApplicationAlbumEntry> out_entry, const ScreenShotAttribute& attribute,
  32. AlbumReportOption report_option, ClientAppletResourceUserId aruid,
  33. const InLargeData<ApplicationData, BufferAttr_HipcMapAlias> app_data_buffer,
  34. const InBuffer<BufferAttr_HipcMapTransferAllowsNonSecure | BufferAttr_HipcMapAlias>
  35. image_data_buffer);
  36. std::array<u8, screenshot_width * screenshot_height * bytes_per_pixel> image_data;
  37. std::shared_ptr<AlbumManager> manager;
  38. };
  39. } // namespace Service::Capture