pattern.odin (3196B)
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 when ODIN_OS == .Windows { 8 foreign import lib "blend2d.lib" 9 } else when ODIN_OS == .Darwin { 10 foreign import lib "libblend2d.a" 11 } else when ODIN_OS == .Linux { 12 foreign import lib "libblend2d.a" 13 } 14 15 16 //! Pattern quality. 17 PatternQuality :: enum u32 { 18 //! Nearest neighbor interpolation. 19 NEAREST = 0, 20 21 //! Bilinear interpolation. 22 BILINEAR = 1, 23 24 //! Maximum value of `BLPatternQuality`. 25 MAX_VALUE = 1, 26 FORCE_UINT = 4294967295, 27 } 28 29 //! Pattern [C API]. 30 PatternCore :: struct { 31 _d: ObjectDetail, 32 } 33 34 //! \cond INTERNAL 35 //! Pattern [C API Impl]. 36 //! 37 //! The following properties are stored in BLObjectInfo: 38 //! 39 //! - Pattern extend mode is stored in BLObjectInfo's 'b' field. 40 //! - Pattern matrix type is stored in BLObjectInfo's 'c' field. 41 PatternImpl :: struct { 42 //! Image used by the pattern. 43 image: ImageCore, 44 45 //! Image area to use. 46 area: RectI, 47 48 //! Pattern transformation matrix. 49 transform: Matrix2D, 50 } 51 52 @(default_calling_convention="c", link_prefix="bl_") 53 foreign lib { 54 //! \endcond 55 pattern_init :: proc(self: ^PatternCore) -> Result --- 56 pattern_init_move :: proc(self: ^PatternCore, other: ^PatternCore) -> Result --- 57 pattern_init_weak :: proc(self: ^PatternCore, other: ^PatternCore) -> Result --- 58 pattern_init_as :: proc(self: ^PatternCore, image: ^ImageCore, area: ^RectI, extend_mode: ExtendMode, transform: ^Matrix2D) -> Result --- 59 pattern_destroy :: proc(self: ^PatternCore) -> Result --- 60 pattern_reset :: proc(self: ^PatternCore) -> Result --- 61 pattern_assign_move :: proc(self: ^PatternCore, other: ^PatternCore) -> Result --- 62 pattern_assign_weak :: proc(self: ^PatternCore, other: ^PatternCore) -> Result --- 63 pattern_assign_deep :: proc(self: ^PatternCore, other: ^PatternCore) -> Result --- 64 pattern_create :: proc(self: ^PatternCore, image: ^ImageCore, area: ^RectI, extend_mode: ExtendMode, transform: ^Matrix2D) -> Result --- 65 pattern_get_image :: proc(self: ^PatternCore, image: ^ImageCore) -> Result --- 66 pattern_set_image :: proc(self: ^PatternCore, image: ^ImageCore, area: ^RectI) -> Result --- 67 pattern_reset_image :: proc(self: ^PatternCore) -> Result --- 68 pattern_get_area :: proc(self: ^PatternCore, area_out: ^RectI) -> Result --- 69 pattern_set_area :: proc(self: ^PatternCore, area: ^RectI) -> Result --- 70 pattern_reset_area :: proc(self: ^PatternCore) -> Result --- 71 pattern_get_extend_mode :: proc(self: ^PatternCore) -> ExtendMode --- 72 pattern_set_extend_mode :: proc(self: ^PatternCore, extend_mode: ExtendMode) -> Result --- 73 pattern_get_transform :: proc(self: ^PatternCore, transform_out: ^Matrix2D) -> Result --- 74 pattern_get_transform_type :: proc(self: ^PatternCore) -> TransformType --- 75 pattern_apply_transform_op :: proc(self: ^PatternCore, op_type: TransformOp, op_data: rawptr) -> Result --- 76 pattern_equals :: proc(a: ^PatternCore, b: ^PatternCore) -> i32 --- 77 } 78