Function init [src]
Prototype
pub fn init(gpa: Allocator, value: u16, w: usize, h: usize) !Vec2d Parameters
gpa: Allocatorvalue: u16w: usizeh: usize Source
pub fn init(gpa: Allocator, value: u16, w: usize, h: usize) !Vec2d {
const len = try math.mul(usize, w, h);
const data = try gpa.alloc(u16, len);
@memset(data, value);
return .{
.data = data,
.cols = h,
};
}