tiny.gui.paint.cpu
Defined in paint.
API (19)
Actions
Public operations.
PackedTarget.pixelCountPackedTarget.validateTarget.byteCountTarget.validateclippedBoundspackRgbarenderCommandsrenderCommandsPackedrenderCommandsPackedRegionWithImagesrenderCommandsPackedWithImagesrenderCommandsRegionWithImagesrenderCommandsWithImagesrgba8FromPacked
Types and contracts
Public types and contracts.
Namespaces
Public namespaces.
Source
Source: lib/gui/src/paint/cpu/render.zig:33
zig
pub const PackedTarget = struct { width: u32, height: u32, pixels: []u32, pub fn pixelCount(self: PackedTarget) usize { return @as(usize, self.width) * @as(usize, self.height); } pub fn validate(self: PackedTarget) !void { if (self.pixels.len < self.pixelCount()) return error.BufferTooSmall; }};Source: lib/gui/src/paint/cpu/render.zig:19
zig
pub const Target = struct { width: u32, height: u32, rgba8: []u8, pub fn byteCount(self: Target) usize { return @as(usize, self.width) * @as(usize, self.height) * 4; } pub fn validate(self: Target) !void { if (self.rgba8.len < self.byteCount()) return error.BufferTooSmall; }};Source: lib/gui/src/paint/cpu/render.zig:47
zig
pub fn renderCommands(commands: []const Command, target: Target, clear: Color) !void { try renderCommandsWithImages(commands, target, clear, .{});}Source: lib/gui/src/paint/cpu/render.zig:62
zig
pub fn renderCommandsPacked(commands: []const Command, target: PackedTarget, clear: Color) !void { try renderCommandsPackedWithImages(commands, target, clear, .{});}Source: lib/gui/src/paint/cpu/render.zig:70
zig
pub fn renderCommandsPackedRegionWithImages(commands: []const Command, target: PackedTarget, clear: Color, images: ImageSet, region: Region) !void { try target.validate(); const active_region = region.clamped(target.width, target.height); if (active_region.pixelCount() == 0) return; span.renderRegion(pixel.WordStore, .{ .words = target.pixels }, target.width, target.height, commands, clear, images, active_region);}Source: lib/gui/src/paint/cpu/render.zig:66
zig
pub fn renderCommandsPackedWithImages(commands: []const Command, target: PackedTarget, clear: Color, images: ImageSet) !void { try renderCommandsPackedRegionWithImages(commands, target, clear, images, Region.full(target.width, target.height));}Source: lib/gui/src/paint/cpu/render.zig:55
zig
pub fn renderCommandsRegionWithImages(commands: []const Command, target: Target, clear: Color, images: ImageSet, region: Region) !void { try target.validate(); const active_region = region.clamped(target.width, target.height); if (active_region.pixelCount() == 0) return; span.renderRegion(pixel.ByteStore, .{ .bytes = target.rgba8 }, target.width, target.height, commands, clear, images, active_region);}Source: lib/gui/src/paint/cpu/render.zig:51
zig
pub fn renderCommandsWithImages(commands: []const Command, target: Target, clear: Color, images: ImageSet) !void { try renderCommandsRegionWithImages(commands, target, clear, images, Region.full(target.width, target.height));}Source: lib/gui/src/paint/cpu/render.zig:77
zig
pub fn rgba8FromPacked(dst: []u8, pixels: []const u32) !void { if (dst.len < pixels.len * 4) return error.BufferTooSmall; for (pixels, 0..) |value, index| pixel.writePacked(dst, index, value);}Source: lib/gui/src/paint/cpu/root.zig
zig
const render = @import("render.zig");pub const geometry = render.geometry;pub const pixel = render.pixel;pub const Region = render.Region;pub const Bounds = render.Bounds;pub const Target = render.Target;pub const PackedTarget = render.PackedTarget;pub const clippedBounds = render.clippedBounds;pub const packRgba = render.packRgba;pub const renderCommands = render.renderCommands;pub const renderCommandsWithImages = render.renderCommandsWithImages;pub const renderCommandsRegionWithImages = render.renderCommandsRegionWithImages;pub const renderCommandsPacked = render.renderCommandsPacked;pub const renderCommandsPackedWithImages = render.renderCommandsPackedWithImages;pub const renderCommandsPackedRegionWithImages = render.renderCommandsPackedRegionWithImages;pub const rgba8FromPacked = render.rgba8FromPacked;Source: lib/gui/src/paint/root.zig:4
zig
pub const cpu = @import("cpu/root.zig");Audit
| Definitions | 14 |
|---|---|
| Public names | 27 |
| Members | 6 |
| Version | 26.7.0 |
| Revision | daab053ee433 |