diff --git a/src/draw.zig b/src/draw.zig index 169e316..7be6733 100644 --- a/src/draw.zig +++ b/src/draw.zig @@ -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); diff --git a/src/geometry.zig b/src/geometry.zig index 462db46..3bef74b 100644 --- a/src/geometry.zig +++ b/src/geometry.zig @@ -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 { diff --git a/src/image.zig b/src/image.zig index 8ab7cbc..9c908dd 100644 --- a/src/image.zig +++ b/src/image.zig @@ -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); diff --git a/src/matrix.zig b/src/matrix.zig index 711a176..c177de7 100644 --- a/src/matrix.zig +++ b/src/matrix.zig @@ -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 { diff --git a/src/root.zig b/src/root.zig index 2dac372..1f705f7 100644 --- a/src/root.zig +++ b/src/root.zig @@ -1,7 +1,4 @@ -//! 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; @@ -9,22 +6,6 @@ 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; @@ -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; diff --git a/src/svd.zig b/src/svd.zig index 81494e2..e3841f2 100644 --- a/src/svd.zig +++ b/src/svd.zig @@ -1,4 +1,5 @@ const std = @import("std"); + const Matrix = @import("matrix.zig").Matrix; const SvdMode = enum {