mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-05 15:18:49 +00:00
Simplify docs to hide the copyright
This commit is contained in:
@@ -5,6 +5,9 @@
|
|||||||
List of contributors:
|
List of contributors:
|
||||||
Jeroen van Rijn: Initial implementation, optimization.
|
Jeroen van Rijn: Initial implementation, optimization.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// package compress is a collection of utilities to aid with other compression packages
|
||||||
package compress
|
package compress
|
||||||
|
|
||||||
import "core:io"
|
import "core:io"
|
||||||
|
|||||||
@@ -27,7 +27,7 @@
|
|||||||
// Construction history, or BSP trees would make the format too large to serve its purpose.
|
// Construction history, or BSP trees would make the format too large to serve its purpose.
|
||||||
// The facilities of the formats to store meta data should make the format flexible enough
|
// The facilities of the formats to store meta data should make the format flexible enough
|
||||||
// for most uses. Adding HxA support should be something anyone can do in a days work.
|
// for most uses. Adding HxA support should be something anyone can do in a days work.
|
||||||
|
//
|
||||||
// Structure:
|
// Structure:
|
||||||
// ----------
|
// ----------
|
||||||
// HxA is designed to be extremely simple to parse, and is therefore based around conventions. It has
|
// HxA is designed to be extremely simple to parse, and is therefore based around conventions. It has
|
||||||
@@ -45,17 +45,17 @@
|
|||||||
// of a number of named layers. All layers in the stack have the same number of elements. Each layer
|
// of a number of named layers. All layers in the stack have the same number of elements. Each layer
|
||||||
// describes one property of the primitive. Each layer can have multiple channels and each layer can
|
// describes one property of the primitive. Each layer can have multiple channels and each layer can
|
||||||
// store data of a different type.
|
// store data of a different type.
|
||||||
|
//
|
||||||
// HaX stores 3 kinds of nodes
|
// HaX stores 3 kinds of nodes
|
||||||
// - Pixel data.
|
// - Pixel data.
|
||||||
// - Polygon geometry data.
|
// - Polygon geometry data.
|
||||||
// - Meta data only.
|
// - Meta data only.
|
||||||
|
//
|
||||||
// Pixel Nodes stores pixels in a layer stack. A layer may store things like Albedo, Roughness,
|
// Pixel Nodes stores pixels in a layer stack. A layer may store things like Albedo, Roughness,
|
||||||
// Reflectance, Light maps, Masks, Normal maps, and Displacement. Layers use the channels of the
|
// Reflectance, Light maps, Masks, Normal maps, and Displacement. Layers use the channels of the
|
||||||
// layers to store things like color. The length of the layer stack is determined by the type and
|
// layers to store things like color. The length of the layer stack is determined by the type and
|
||||||
// dimensions stored in the
|
// dimensions stored in the
|
||||||
|
//
|
||||||
// Geometry data is stored in 3 separate layer stacks for: vertex data, corner data and face data. The
|
// Geometry data is stored in 3 separate layer stacks for: vertex data, corner data and face data. The
|
||||||
// vertex data stores things like verities, blend shapes, weight maps, and vertex colors. The first
|
// vertex data stores things like verities, blend shapes, weight maps, and vertex colors. The first
|
||||||
// layer in a vertex stack has to be a 3 channel layer named "position" describing the base position
|
// layer in a vertex stack has to be a 3 channel layer named "position" describing the base position
|
||||||
@@ -63,7 +63,7 @@
|
|||||||
// for things like UV, normals, and adjacency. The first layer in a corner stack has to be a 1 channel
|
// for things like UV, normals, and adjacency. The first layer in a corner stack has to be a 1 channel
|
||||||
// integer layer named "index" describing the vertices used to form polygons. The last value in each
|
// integer layer named "index" describing the vertices used to form polygons. The last value in each
|
||||||
// polygon has a negative - 1 index to indicate the end of the polygon.
|
// polygon has a negative - 1 index to indicate the end of the polygon.
|
||||||
|
//
|
||||||
// Example:
|
// Example:
|
||||||
// A quad and a tri with the vertex index:
|
// A quad and a tri with the vertex index:
|
||||||
// [0, 1, 2, 3] [1, 4, 2]
|
// [0, 1, 2, 3] [1, 4, 2]
|
||||||
@@ -72,7 +72,7 @@
|
|||||||
// The face stack stores values per face. the length of the face stack has to match the number of
|
// The face stack stores values per face. the length of the face stack has to match the number of
|
||||||
// negative values in the index layer in the corner stack. The face stack can be used to store things
|
// negative values in the index layer in the corner stack. The face stack can be used to store things
|
||||||
// like material index.
|
// like material index.
|
||||||
|
//
|
||||||
// Storage
|
// Storage
|
||||||
// -------
|
// -------
|
||||||
// All data is stored in little endian byte order with no padding. The layout mirrors the structs
|
// All data is stored in little endian byte order with no padding. The layout mirrors the structs
|
||||||
|
|||||||
+1
-1
@@ -64,6 +64,7 @@ If not present, the width is whatever is necessary to represent the value.
|
|||||||
Precision is specified after the (optional) width followed by a period followed by a decimal number.
|
Precision is specified after the (optional) width followed by a period followed by a decimal number.
|
||||||
If no period is present, a default precision is used.
|
If no period is present, a default precision is used.
|
||||||
A period with no following number specifies a precision of 0.
|
A period with no following number specifies a precision of 0.
|
||||||
|
|
||||||
Examples:
|
Examples:
|
||||||
%f default width, default precision
|
%f default width, default precision
|
||||||
%8f width 8, default precision
|
%8f width 8, default precision
|
||||||
@@ -84,7 +85,6 @@ Other flags:
|
|||||||
add leading 0z for dozenal (%#z)
|
add leading 0z for dozenal (%#z)
|
||||||
add leading 0x or 0X for hexadecimal (%#x or %#X)
|
add leading 0x or 0X for hexadecimal (%#x or %#X)
|
||||||
remove leading 0x for %p (%#p)
|
remove leading 0x for %p (%#p)
|
||||||
|
|
||||||
' ' (space) leave a space for elided sign in numbers (% d)
|
' ' (space) leave a space for elided sign in numbers (% d)
|
||||||
0 pad with leading zeros rather than spaces
|
0 pad with leading zeros rather than spaces
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@
|
|||||||
Jeroen van Rijn: Initial implementation, optimization.
|
Jeroen van Rijn: Initial implementation, optimization.
|
||||||
Ginger Bill: Cosmetic changes.
|
Ginger Bill: Cosmetic changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// package image implements a general 2D image library to be used with other image related packages
|
||||||
package image
|
package image
|
||||||
|
|
||||||
import "core:bytes"
|
import "core:bytes"
|
||||||
|
|||||||
@@ -6,6 +6,11 @@
|
|||||||
Jeroen van Rijn: Initial implementation.
|
Jeroen van Rijn: Initial implementation.
|
||||||
Ginger Bill: Cosmetic changes.
|
Ginger Bill: Cosmetic changes.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
// package png implements a PNG image reader
|
||||||
|
//
|
||||||
|
// The PNG specification is at https://www.w3.org/TR/PNG/.
|
||||||
package png
|
package png
|
||||||
|
|
||||||
import "core:compress"
|
import "core:compress"
|
||||||
|
|||||||
@@ -2,12 +2,10 @@
|
|||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
|
|
||||||
An arbitrary precision mathematics implementation in Odin.
|
|
||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
|
||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
|
||||||
|
|
||||||
This file collects public proc maps and their aliases.
|
This file collects public proc maps and their aliases.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
/*
|
/*
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
|
|
||||||
An arbitrary precision mathematics implementation in Odin.
|
|
||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
|
||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|||||||
@@ -0,0 +1,28 @@
|
|||||||
|
/*
|
||||||
|
A BigInt implementation in Odin.
|
||||||
|
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
||||||
|
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
||||||
|
|
||||||
|
========================== Low-level routines ==========================
|
||||||
|
|
||||||
|
IMPORTANT: `internal_*` procedures make certain assumptions about their input.
|
||||||
|
|
||||||
|
The public functions that call them are expected to satisfy their sanity check requirements.
|
||||||
|
This allows `internal_*` call `internal_*` without paying this overhead multiple times.
|
||||||
|
|
||||||
|
Where errors can occur, they are of course still checked and returned as appropriate.
|
||||||
|
|
||||||
|
When importing `math:core/big` to implement an involved algorithm of your own, you are welcome
|
||||||
|
to use these procedures instead of their public counterparts.
|
||||||
|
|
||||||
|
Most inputs and outputs are expected to be passed an initialized `Int`, for example.
|
||||||
|
Exceptions include `quotient` and `remainder`, which are allowed to be `nil` when the calling code doesn't need them.
|
||||||
|
|
||||||
|
Check the comments above each `internal_*` implementation to see what constraints it expects to have met.
|
||||||
|
|
||||||
|
We pass the custom allocator to procedures by default using the pattern `context.allocator = allocator`.
|
||||||
|
This way we don't have to add `, allocator` at the end of each call.
|
||||||
|
|
||||||
|
TODO: Handle +/- Infinity and NaN.
|
||||||
|
*/
|
||||||
|
package math_big
|
||||||
@@ -1,11 +1,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
|
|
||||||
An arbitrary precision mathematics implementation in Odin.
|
|
||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
|
||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|||||||
@@ -2,33 +2,9 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
Copyright 2021 Jeroen van Rijn <nom@duclavier.com>.
|
||||||
Made available under Odin's BSD-3 license.
|
Made available under Odin's BSD-3 license.
|
||||||
|
|
||||||
A BigInt implementation in Odin.
|
|
||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
|
||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
|
||||||
|
|
||||||
========================== Low-level routines ==========================
|
|
||||||
|
|
||||||
IMPORTANT: `internal_*` procedures make certain assumptions about their input.
|
|
||||||
|
|
||||||
The public functions that call them are expected to satisfy their sanity check requirements.
|
|
||||||
This allows `internal_*` call `internal_*` without paying this overhead multiple times.
|
|
||||||
|
|
||||||
Where errors can occur, they are of course still checked and returned as appropriate.
|
|
||||||
|
|
||||||
When importing `math:core/big` to implement an involved algorithm of your own, you are welcome
|
|
||||||
to use these procedures instead of their public counterparts.
|
|
||||||
|
|
||||||
Most inputs and outputs are expected to be passed an initialized `Int`, for example.
|
|
||||||
Exceptions include `quotient` and `remainder`, which are allowed to be `nil` when the calling code doesn't need them.
|
|
||||||
|
|
||||||
Check the comments above each `internal_*` implementation to see what constraints it expects to have met.
|
|
||||||
|
|
||||||
We pass the custom allocator to procedures by default using the pattern `context.allocator = allocator`.
|
|
||||||
This way we don't have to add `, allocator` at the end of each call.
|
|
||||||
|
|
||||||
TODO: Handle +/- Infinity and NaN.
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:mem"
|
import "core:mem"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
This file contains logical operations like `and`, `or` and `xor`.
|
This file contains logical operations like `and`, `or` and `xor`.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
This file contains prime finding operations.
|
This file contains prime finding operations.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import rnd "core:math/rand"
|
import rnd "core:math/rand"
|
||||||
|
|||||||
@@ -15,6 +15,8 @@
|
|||||||
|
|
||||||
These aren't exported for the same reasons.
|
These aren't exported for the same reasons.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|||||||
@@ -8,6 +8,8 @@
|
|||||||
|
|
||||||
This file contains basic arithmetic operations like `add`, `sub`, `mul`, `div`, ...
|
This file contains basic arithmetic operations like `add`, `sub`, `mul`, `div`, ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|||||||
@@ -12,6 +12,8 @@
|
|||||||
- Use Barrett reduction for non-powers-of-two.
|
- Use Barrett reduction for non-powers-of-two.
|
||||||
- Also look at extracting and splatting several digits at once.
|
- Also look at extracting and splatting several digits at once.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:intrinsics"
|
import "core:intrinsics"
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
For the theoretical underpinnings, see Knuth's The Art of Computer Programming, Volume 2, section 4.3.
|
||||||
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
The code started out as an idiomatic source port of libTomMath, which is in the public domain, with thanks.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
package math_big
|
package math_big
|
||||||
|
|
||||||
import "core:time"
|
import "core:time"
|
||||||
|
|||||||
Reference in New Issue
Block a user