detection_utils_win.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. // Copyright 2017 The Chromium Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style license that can be
  3. // found in the LICENSE file.
  4. #ifndef SERVICES_SHAPE_DETECTION_DETECTION_UTILS_WIN_H_
  5. #define SERVICES_SHAPE_DETECTION_DETECTION_UTILS_WIN_H_
  6. #include <windows.storage.streams.h>
  7. #include <wrl/client.h>
  8. class SkBitmap;
  9. namespace shape_detection {
  10. using ABI::Windows::Graphics::Imaging::ISoftwareBitmapStatics;
  11. using ABI::Windows::Graphics::Imaging::ISoftwareBitmap;
  12. using ABI::Windows::Graphics::Imaging::BitmapPixelFormat;
  13. // Creates a Windows ISoftwareBitmap from a kN32_SkColorType |bitmap|, or
  14. // returns nullptr.
  15. Microsoft::WRL::ComPtr<ISoftwareBitmap> CreateWinBitmapFromSkBitmap(
  16. const SkBitmap& bitmap,
  17. ISoftwareBitmapStatics* bitmap_factory);
  18. // Creates a Gray8/Nv12 ISoftwareBitmap from a kN32_SkColorType |bitmap|, or
  19. // returns nullptr.
  20. Microsoft::WRL::ComPtr<ISoftwareBitmap> CreateWinBitmapWithPixelFormat(
  21. const SkBitmap& bitmap,
  22. ISoftwareBitmapStatics* bitmap_factory,
  23. BitmapPixelFormat pixel_format);
  24. } // namespace shape_detection
  25. #endif // SERVICES_SHAPE_DETECTION_DETECTION_UTILS_WIN_H_