dymokomi/luce-browser-engine
Source of release 0.6.1
0.6.1 / src / web / platform / image_codec_plugin.lucb
#==============================================================================================
#
# image_codec_plugin - Platform::ImageCodecPlugin: the seam to the image decoders
#
# DESCRIPTION:
# Port of Libraries/LibWeb/Platform/ImageCodecPlugin.cpp (lines 1-33) and the pure
# virtuals of ImageCodecPlugin.h (lines 42-45). An embedder subclasses it (its own
# vtable) and installs it; phase 1 has no images, so none is installed yet.
#
# Copyright (c) 2021-2022, Andreas Kling <andreas@ladybird.org>
# Copyright (c) 2022, Dex♪ <dexes.ttp@gmail.com>
# SPDX-License-Identifier: BSD-2-Clause
#
#==============================================================================================
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.cpp:16 Web::Platform::ImageCodecPlugin::the.
pub func platform_image_codec_plugin_the() -> PlatformImageCodecPlugin*:
return platform_s_the else trap("VERIFY: no ImageCodecPlugin installed")
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.cpp:22 Web::Platform::ImageCodecPlugin::is_initialized.
pub func platform_image_codec_plugin_is_initialized() -> bool:
return platform_s_the != none
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.cpp:27 Web::Platform::ImageCodecPlugin::install.
pub func platform_image_codec_plugin_install(plugin: PlatformImageCodecPlugin*):
assert(platform_s_the == none)
platform_s_the = plugin
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.h:42 Web::Platform::ImageCodecPlugin::decode_image (virtual).
pub func platform_image_codec_plugin_decode_image_impl(this: PlatformImageCodecPlugin*, arg0: const u8[], on_resolved: ak.Function1[PlatformDecodedImage*, unit], on_rejected: ak.Function1[ak.AkError*, unit]) -> CorePromise[PlatformDecodedImage, ak.AkError]*:
trap("pure virtual: Web::Platform::ImageCodecPlugin::decode_image")
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.h:44 Web::Platform::ImageCodecPlugin::request_animation_frames (virtual).
pub func platform_image_codec_plugin_request_animation_frames_impl(this: PlatformImageCodecPlugin*, session_id: i64, start_frame_index: u32, count: u32):
trap("pure virtual: Web::Platform::ImageCodecPlugin::request_animation_frames")
## Ported from Libraries/LibWeb/Platform/ImageCodecPlugin.h:45 Web::Platform::ImageCodecPlugin::stop_animation_decode (virtual).
pub func platform_image_codec_plugin_stop_animation_decode_impl(this: PlatformImageCodecPlugin*, session_id: i64):
trap("pure virtual: Web::Platform::ImageCodecPlugin::stop_animation_decode")