Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

README Covers #1

Open
meloalright opened this issue Jun 15, 2024 · 6 comments
Open

README Covers #1

meloalright opened this issue Jun 15, 2024 · 6 comments

Comments

@meloalright
Copy link
Member

here

@meloalright
Copy link
Member Author

截屏2024-06-15 18 19 44

@meloalright
Copy link
Member Author

截屏2024-06-15 19 26 35

@meloalright
Copy link
Member Author

截屏2024-06-15 19 26 35-min

@meloalright
Copy link
Member Author

截屏2024-07-21 22 22 25

@meloalright
Copy link
Member Author

public func set_rect_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ x: UInt32, _ y: UInt32, _ width: UInt32, _ height: UInt32, _ style: GenericIntoRustString, _ color: GenericIntoRustString) {
__swift_bridge__$SoftSkia$set_rect_attr(ptr, id, x, y, width, height, { let rustString = style.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }())
}
public func set_circle_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ cx: UInt32, _ cy: UInt32, _ r: UInt32, _ style: GenericIntoRustString, _ color: GenericIntoRustString) {
__swift_bridge__$SoftSkia$set_circle_attr(ptr, id, cx, cy, r, { let rustString = style.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }())
}
public func set_line_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ p1: UnsafeBufferPointer<UInt32>, _ p2: UnsafeBufferPointer<UInt32>, _ stroke_width: Optional<UInt32>, _ color: GenericIntoRustString) {
__swift_bridge__$SoftSkia$set_line_attr(ptr, id, p1.toFfiSlice(), p2.toFfiSlice(), stroke_width.intoFfiRepr(), { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }())
}
public func set_points_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ points: UnsafeBufferPointer<UInt32>, _ stroke_width: Optional<UInt32>, _ style: GenericIntoRustString, _ color: GenericIntoRustString) {
__swift_bridge__$SoftSkia$set_points_attr(ptr, id, points.toFfiSlice(), stroke_width.intoFfiRepr(), { let rustString = style.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }())
}
public func set_round_rect_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ x: UInt32, _ y: UInt32, _ r: UInt32, _ width: UInt32, _ height: UInt32, _ style: GenericIntoRustString, _ color: GenericIntoRustString) {
__swift_bridge__$SoftSkia$set_round_rect_attr(ptr, id, x, y, r, width, height, { let rustString = style.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }())
}
public func set_text_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ text: GenericIntoRustString, _ x: Int32, _ y: Int32, _ font_size: Float, _ color: GenericIntoRustString, _ max_width: Optional<Float>) {
__swift_bridge__$SoftSkia$set_text_attr(ptr, id, { let rustString = text.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), x, y, font_size, { let rustString = color.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), max_width.intoFfiRepr())
}
public func set_image_attr<GenericIntoRustString: IntoRustString>(_ id: UInt, _ image: GenericIntoRustString, _ x: Int32, _ y: Int32, _ width: UInt32, _ height: UInt32, _ blur: Optional<Float>, _ grayscale: Optional<Bool>, _ brighten: Optional<Int32>, _ invert: Optional<Bool>) {
__swift_bridge__$SoftSkia$set_image_attr(ptr, id, { let rustString = image.intoRustString(); rustString.isOwned = false; return rustString.ptr }(), x, y, width, height, blur.intoFfiRepr(), grayscale.intoFfiRepr(), brighten.intoFfiRepr(), invert.intoFfiRepr())
}

public struct Surface<Content: View>: View {
var width: UInt32
var height: UInt32
let content: Content
let ffi: FFI
@State var show: Bool = false;
@State var rasterlization: String = "";
public init(width: UInt32, height: UInt32, @ViewBuilder builder: () -> Content) {
self.width = width
self.height = height
self.content = builder()
self.ffi = FFI(soft: SwiftUISkiaBridge.SoftSkia());
self.ffi.soft.set_rect_attr(0, 0, 0, width, height, "fill", "transparent")
}

@meloalright meloalright changed the title Slogan README Covers Aug 31, 2024
@meloalright
Copy link
Member Author

public struct Points<Content: View>: View {
var points: [[UInt32]]
var strokeWidth: UInt32
var style: String
var color: String
let content: Content
@EnvironmentObject var ffi: FFI;

public struct Image<Content: View>: View {
var image: String
var x: Int32
var y: Int32
var width: UInt32
var height: UInt32
var blur: Float32?
var grayscale: Bool?
var brighten: Int32?
var invert: Bool?
let content: Content
@State var b64: String = "";
@EnvironmentObject var ffi: FFI;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant