Skip to content

Commit

Permalink
zignal: organize imports with zls
Browse files Browse the repository at this point in the history
  • Loading branch information
arrufat committed Nov 9, 2024
1 parent c8aeb8d commit 3a204d6
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 26 deletions.
4 changes: 3 additions & 1 deletion src/draw.zig
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
const std = @import("std");
const assert = std.debug.assert;

const as = @import("meta.zig").as;
const colorspace = @import("colorspace.zig");
const Rgba = @import("colorspace.zig").Rgba;
const Image = @import("image.zig").Image;
const Rgba = @import("colorspace.zig").Rgba;

const Point2d = @import("point.zig").Point2d(f32);
const Rectangle = @import("geometry.zig").Rectangle(f32);

Expand Down
5 changes: 3 additions & 2 deletions src/geometry.zig
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
const std = @import("std");
const assert = std.debug.assert;
const expectEqual = std.testing.expectEqual;
const expectEqualDeep = std.testing.expectEqualDeep;

const as = @import("meta.zig").as;
const Matrix = @import("matrix.zig").Matrix;
const Point2d = @import("point.zig").Point2d;
const svd = @import("svd.zig").svd;
const expectEqual = std.testing.expectEqual;
const expectEqualDeep = std.testing.expectEqualDeep;

/// A generic rectangle object with some convenience functionality.
pub fn Rectangle(comptime T: type) type {
Expand Down
6 changes: 4 additions & 2 deletions src/image.zig
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ const std = @import("std");
const assert = std.debug.assert;
const expectEqual = std.testing.expectEqual;
const Allocator = std.mem.Allocator;
const Rgba = @import("colorspace.zig").Rgba;
const convert = @import("colorspace.zig").convert;

const as = @import("meta.zig").as;
const convert = @import("colorspace.zig").convert;
const isScalar = @import("meta.zig").isScalar;
const isStruct = @import("meta.zig").isStruct;
const Rgba = @import("colorspace.zig").Rgba;

const Rectangle = @import("geometry.zig").Rectangle(f32);
const Point2d = @import("point.zig").Point2d(f32);

Expand Down
2 changes: 1 addition & 1 deletion src/matrix.zig
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
const std = @import("std");
const builtin = @import("builtin");
const assert = std.debug.assert;
const expectEqual = std.testing.expectEqual;
const expectEqualDeep = std.testing.expectEqualDeep;
const builtin = @import("builtin");

/// Creates a Matrix with elements of type T and size rows times cols.
pub fn Matrix(comptime T: type, comptime rows: usize, comptime cols: usize) type {
Expand Down
32 changes: 12 additions & 20 deletions src/root.zig
Original file line number Diff line number Diff line change
@@ -1,30 +1,11 @@
//! Zignal is an image processing library inspired by dlib.

const std = @import("std");

//! Zignal is an image processing library inspired by dlib.const std = @import("std");
pub const colorspace = @import("colorspace.zig");
pub const Rgb = colorspace.Rgb;
pub const Rgba = colorspace.Rgba;
pub const Hsl = colorspace.Hsl;
pub const Hsv = colorspace.Hsv;
pub const Xyz = colorspace.Xyz;
pub const Lab = colorspace.Lab;

pub const Point2d = @import("point.zig").Point2d;
pub const Point3d = @import("point.zig").Point3d;

pub const Matrix = @import("matrix.zig").Matrix;

pub const Image = @import("image.zig").Image;

pub const svd = @import("svd.zig").svd;

const geometry = @import("geometry.zig");
pub const Rectangle = geometry.Rectangle;
pub const ProjectiveTransform = geometry.ProjectiveTransform;
pub const SimilarityTransform = geometry.SimilarityTransform;
pub const ConvexHull = geometry.ConvexHull;

const draw = @import("draw.zig");
pub const drawCircle = draw.drawCircle;
pub const drawCircleFast = draw.drawCircleFast;
Expand All @@ -34,5 +15,16 @@ pub const drawLineFast = draw.drawLineFast;
pub const drawRectangle = draw.drawRectangle;
pub const drawPolygon = draw.drawPolygon;
pub const fillPolygon = draw.fillPolygon;
const geometry = @import("geometry.zig");
pub const Rectangle = geometry.Rectangle;
pub const AffineTransform = geometry.AffineTransform;
pub const ProjectiveTransform = geometry.ProjectiveTransform;
pub const SimilarityTransform = geometry.SimilarityTransform;
pub const ConvexHull = geometry.ConvexHull;
pub const Image = @import("image.zig").Image;
pub const Matrix = @import("matrix.zig").Matrix;
pub const meta = @import("meta.zig");
pub const perlin = @import("perlin.zig");
pub const Point2d = @import("point.zig").Point2d;
pub const Point3d = @import("point.zig").Point3d;
pub const svd = @import("svd.zig").svd;
1 change: 1 addition & 0 deletions src/svd.zig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const std = @import("std");

const Matrix = @import("matrix.zig").Matrix;

const SvdMode = enum {
Expand Down

0 comments on commit 3a204d6

Please sign in to comment.