{"id":30806791,"url":"https://github.com/mintlu8/garray2d","last_synced_at":"2025-10-24T21:36:03.909Z","repository":{"id":303084662,"uuid":"1014086776","full_name":"mintlu8/garray2d","owner":"mintlu8","description":"Game focused 2d array with signed index and offset support.","archived":false,"fork":false,"pushed_at":"2025-07-05T16:09:43.000Z","size":13,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-07-05T16:19:24.578Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/mintlu8.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-07-05T03:10:32.000Z","updated_at":"2025-07-05T16:14:58.000Z","dependencies_parsed_at":"2025-07-05T16:19:28.899Z","dependency_job_id":"2ae84da4-a91f-46d5-b64e-c749a1e6f067","html_url":"https://github.com/mintlu8/garray2d","commit_stats":null,"previous_names":["mintlu8/garray2d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mintlu8/garray2d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fgarray2d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fgarray2d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fgarray2d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fgarray2d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mintlu8","download_url":"https://codeload.github.com/mintlu8/garray2d/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mintlu8%2Fgarray2d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273847182,"owners_count":25178641,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-09-06T01:52:05.160Z","updated_at":"2025-10-24T21:35:58.870Z","avatar_url":"https://github.com/mintlu8.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# garray2d\n\n[![Crates.io](https://img.shields.io/crates/v/garray2d.svg)](https://crates.io/crates/garray2d)\n[![Docs](https://docs.rs/garray2d/badge.svg)](https://docs.rs/garray2d/latest/garray2d/)\n\nGame development focused 2d array with signed index and offset support.\n\n## Design\n\n`Array2d` represents a rectangular region in a tile map,\nwith non-represented regions considered `Default::default`.\nThis allows us to implement functions like `resize` that are geometric\ninstead of reinterpreting the underlying bytes.\n\n`Array2d` is row major, which makes it useful when working with gpu textures.\nThere is currently no direct support for column major arrays.\n\n## Usage\n\n`Array2d` is analogous to a `Vec` and can be created either via a function initializer\nsimilar to `array::from_fn` or from a `Vec` and a dimension.\n\n`Array2dRef` and `Array2dMut` can be created either by slicing an existing 2d array\nusing `get` or `slice` or by reinterpreting a slice as a 2d array.\n\nTo combine multiple arrays, use `zip` if dimension is the same, `paint` if you\ndo not care about overflows and `merge` if you do.\n\n## Core Traits\n\nWe use a few traits to make your life easier when using this crate,\nhere are the common implementors of these types.\n\n* `IntoBoundary`\n\n`IntoBoundary` means convertible to a 2d rectangle, types that implement it are\n\n| type | example(s) | note |\n| - | - | - |\n| `Boundary` | `Boundary::min_max([0, 0], [5, 8])` | |\n| `[u32; 2]` | `[5, 8]` | Represents `[0, 0]..[5, 8]` |\n| `impl RangeBounds\u003cInto\u003cVector2\u003ci32\u003e\u003e\u003e` | `[-1, -1]..[1, 1]` | Only for `std` types |\n| `(impl RangeBounds\u003ci32\u003e, impl RangeBounds\u003ci32\u003e)` | `(-1..=1, -1..1)` | |\n\n* `Into\u003cVector2\u003ci32\u003e\u003e`\n\nThe core `mint` trait that's implemented by `[i32; 2]` and types like `glam`'s `IVec2` or `nalgebra`'s `Vector2\u003ci32\u003e`.\n\n* `Array2dIndexing`\n\nFor the `get` function, types that implement it are\n\n| type | example(s) | note |\n| - | - | - |\n| `impl Into\u003cVector2\u003ci32\u003e\u003e` | `[-1, -1]` | Returns a point. |\n| `impl IntoBoundary` | `Boundary::min_max([0, 0], [1024, 768])` | Returns a slice. |\n\n## Usage with Math Libraries\n\nThis crate uses `mint` to interop with math crates like `glam` or `nalgebra`.\nIn `glam` or `bevy_math` for example, you might want enable the `mint` feature.\nThe core trait `Into\u003cVector2\u003ci32\u003e\u003e` is implemented by types like `glam`'s `IVec2`.\nAdditionally, `[i32; 2]` always implements this trait and should be the easiest way to\ncreate a quick constant.\n\n```rust\narray.get([1, 2])\n```\n\n## License\n\nLicense under either of\n\nApache License, Version 2.0 (LICENSE-APACHE or \u003chttp://www.apache.org/licenses/LICENSE-2.0\u003e)\nMIT license (LICENSE-MIT or \u003chttp://opensource.org/licenses/MIT\u003e)\nat your option.\n\n## Contribution\n\nContributions are welcome!\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintlu8%2Fgarray2d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmintlu8%2Fgarray2d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmintlu8%2Fgarray2d/lists"}