add optimization notes
This commit is contained in:
parent
7b30811ead
commit
175899a539
|
@ -46,6 +46,10 @@ pub fn build(b: *std.build.Builder) !void {
|
|||
exe.addIncludePath("lib/i2cdriver");
|
||||
exe.install();
|
||||
|
||||
// TODO: I believe we can use runArtifact on a second
|
||||
// exe with a different source file for font generation
|
||||
// taking us to a series of 5 byte arrays for each
|
||||
// character in a font.
|
||||
exe.step.dependOn(&AsciiPrintableStep.create(b, .{ .path = "src/images" }).step);
|
||||
// exe.step.dependOn((try fontGeneration(b, target)));
|
||||
const run_cmd = exe.run();
|
||||
|
|
|
@ -277,6 +277,12 @@ fn convertImage(alloc: std.mem.Allocator, filename: [:0]u8, pixels: *[WIDTH * HE
|
|||
if (filename.len > 0) {
|
||||
status = c.MagickReadImage(mw, filename);
|
||||
} else {
|
||||
// TODO: if there is no background image AND
|
||||
// we precompute monochrome bit patterns for our font
|
||||
// we can completely avoid ImageMagick here. Even with
|
||||
// a background we can do the conversion, then do our
|
||||
// own text overlay after monochrome conversion.
|
||||
// Faster and smaller binary (maybe multi-font support?)
|
||||
const blob = @embedFile("images/blank.bmp");
|
||||
status = c.MagickReadImageBlob(mw, blob, blob.len);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user