imageencoder.odin (2110B)
1 // This file is part of Blend2D project <https://blend2d.com> 2 // 3 // See blend2d.h or LICENSE.md for license and copyright information 4 // SPDX-License-Identifier: Zlib 5 package blend2d 6 7 import "core:c" 8 9 when ODIN_OS == .Windows { 10 foreign import lib "blend2d.lib" 11 } else when ODIN_OS == .Darwin { 12 foreign import lib "libblend2d.a" 13 } else when ODIN_OS == .Linux { 14 foreign import lib "libblend2d.a" 15 } 16 17 18 //! Image encoder [C API]. 19 ImageEncoderCore :: struct { 20 _d: ObjectDetail, 21 } 22 23 //! \cond INTERNAL 24 //! Image encoder [Virtual Function Table]. 25 ImageEncoderVirt :: struct { 26 base: ObjectVirtBase, 27 restart: proc "c" (impl: ^ImageEncoderImpl) -> Result, 28 write_frame: proc "c" (impl: ^ImageEncoderImpl, dst: ^ArrayCore, image: ^ImageCore) -> Result, 29 } 30 31 //! Image encoder [Impl]. 32 ImageEncoderImpl :: struct { 33 //! \name Members 34 //! \{ 35 36 //! Virtual function table. 37 virt: ^ImageEncoderVirt, 38 39 //! Image codec that created this encoder. 40 codec: ImageCodecCore, 41 42 //! Last faulty result (if failed). 43 last_result: Result, 44 45 //! Handle in case that this encoder wraps a third-party library. 46 handle: rawptr, 47 48 //! Current frame index. 49 frame_index: u64, 50 51 //! Position in source buffer. 52 buffer_index: c.size_t, 53 } 54 55 @(default_calling_convention="c", link_prefix="bl_") 56 foreign lib { 57 //! \endcond 58 image_encoder_init :: proc(self: ^ImageEncoderCore) -> Result --- 59 image_encoder_init_move :: proc(self: ^ImageEncoderCore, other: ^ImageEncoderCore) -> Result --- 60 image_encoder_init_weak :: proc(self: ^ImageEncoderCore, other: ^ImageEncoderCore) -> Result --- 61 image_encoder_destroy :: proc(self: ^ImageEncoderCore) -> Result --- 62 image_encoder_reset :: proc(self: ^ImageEncoderCore) -> Result --- 63 image_encoder_assign_move :: proc(self: ^ImageEncoderCore, other: ^ImageEncoderCore) -> Result --- 64 image_encoder_assign_weak :: proc(self: ^ImageEncoderCore, other: ^ImageEncoderCore) -> Result --- 65 image_encoder_restart :: proc(self: ^ImageEncoderCore) -> Result --- 66 image_encoder_write_frame :: proc(self: ^ImageEncoderCore, dst: ^ArrayCore, image: ^ImageCore) -> Result --- 67 } 68