rgba_to_yuva.h 1.3 KB

123456789101112131415161718192021222324252627282930
  1. // Copyright 2021 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 SKIA_EXT_RGBA_TO_YUVA_H_
  5. #define SKIA_EXT_RGBA_TO_YUVA_H_
  6. #include "third_party/skia/include/core/SkImage.h"
  7. #include "third_party/skia/include/core/SkRect.h"
  8. #include "third_party/skia/include/core/SkSurface.h"
  9. #include "third_party/skia/include/core/SkYUVAInfo.h"
  10. namespace skia {
  11. // Copy `src_image` from RGBA to the YUVA planes specified in `dst_surfaces`,
  12. // using the color space and plane configuration information specified in
  13. // `dst_yuva_info`. `dst_yuva_info` describes the entire destination image - the
  14. // results of the blit operation will be placed in its subregion, described by
  15. // `dst_region`. If a default-constructed `dst_region` is passed in, the entire
  16. // destination image will be written to. If `clear_destination` is true, the
  17. // entire destination image will be cleared with black before the blit.
  18. SK_API void BlitRGBAToYUVA(SkImage* src_image,
  19. SkSurface* dst_surfaces[SkYUVAInfo::kMaxPlanes],
  20. const SkYUVAInfo& dst_yuva_info,
  21. const SkRect& dst_region = SkRect::MakeEmpty(),
  22. bool clear_destination = false);
  23. } // namespace skia
  24. #endif // SKIA_EXT_RGBA_TO_YUVA_H_