{"id":13505524,"url":"https://github.com/ebassi/graphene","last_synced_at":"2025-10-18T15:32:35.121Z","repository":{"id":16598484,"uuid":"19352997","full_name":"ebassi/graphene","owner":"ebassi","description":"A thin layer of graphic data types","archived":false,"fork":false,"pushed_at":"2025-01-23T00:23:10.000Z","size":2945,"stargazers_count":394,"open_issues_count":17,"forks_count":84,"subscribers_count":20,"default_branch":"master","last_synced_at":"2025-04-13T14:00:03.495Z","etag":null,"topics":["3d-transformations","c","euler","graphics-library","mathematics","matrix","quaternion","simd","transformations","vector"],"latest_commit_sha":null,"homepage":"http://ebassi.github.io/graphene","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ebassi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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}},"created_at":"2014-05-01T18:07:32.000Z","updated_at":"2025-04-03T09:23:50.000Z","dependencies_parsed_at":"2023-01-13T18:55:41.151Z","dependency_job_id":"790871bb-23c3-449f-88f6-ac9b773e2f20","html_url":"https://github.com/ebassi/graphene","commit_stats":{"total_commits":1203,"total_committers":48,"mean_commits":25.0625,"dds":0.1296758104738155,"last_synced_commit":"d03fb3d1c512a011e4f615ff409430587a410ee0"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebassi%2Fgraphene","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebassi%2Fgraphene/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebassi%2Fgraphene/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ebassi%2Fgraphene/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ebassi","download_url":"https://codeload.github.com/ebassi/graphene/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248724585,"owners_count":21151560,"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","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":["3d-transformations","c","euler","graphics-library","mathematics","matrix","quaternion","simd","transformations","vector"],"created_at":"2024-08-01T00:01:09.369Z","updated_at":"2025-10-18T15:32:35.003Z","avatar_url":"https://github.com/ebassi.png","language":"C","readme":"# Graphene\n\n### A thin layer of types for graphic libraries\n\n![Linux Build](https://github.com/ebassi/graphene/workflows/Ubuntu%20Build/badge.svg)\n![MSVC Build](https://github.com/ebassi/graphene/workflows/MSVC%20Build/badge.svg)\n![MSYS2 Build](https://github.com/ebassi/graphene/workflows/MSYS2%20Build/badge.svg)\n[![License: MIT](https://img.shields.io/badge/license-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)\n\nWhen creating graphic libraries you most likely end up dealing with points\nand rectangles. If you're particularly unlucky, you may end up dealing\nwith affine matrices and 2D transformations. If you're writing a graphic\nlibrary with 3D transformations, though, you are going to hit the jackpot:\n4x4 matrices, projections, transformations, vectors, and quaternions.\n\nMost of this stuff exists, in various forms, in other libraries, but it\nhas the major drawback of coming along with the rest of those libraries,\nwhich may or may not be what you want. Those libraries are also available\nin various languages, as long as those languages are C++; again, it may or\nmay not be something you want.\n\nFor this reason, I decided to write the thinnest, smallest possible layer\nneeded to write a canvas library; given its relative size, and the\npropensity for graphics libraries to have a pun in their name, I decided\nto call it Graphene.\n\nThis library provides types and their relative API; it does not deal with\nwindowing system surfaces, drawing, scene graphs, or input. You're\nsupposed to do that yourself, in your own canvas implementation, which is\nthe whole point of writing the library in the first place.\n\n### Dependencies\n\nGraphene has minimal dependencies.\n\nGraphene contains optimizations for speeding up vector operations; those\noptimizations are optional, and used only if both Graphene was compiled\nwith support for them *and* if the system you're running on has them.\nCurrently, Graphene supports the following platform-specific fast paths:\n\n * Streaming SIMD Extensions (SSE) 2\n  * Optionally using SSE 4.1\n * ARM NEON\n * GCC vector extensions\n\nIn the remote case in which none of these optimizations are available,\nGraphene will fall back to a naive scalar implementation.\n\nGraphene can, optionally, provide types for integrating with\n[GObject][gobject-api] properties and signals, as well as introspection\ninformation for its use with other languages through introspection-based\nbindings.\n\n### Installation\n\nIn order to build and install Graphene you will need development tools and\nthe headers of the dependencies. You will also need:\n\n * [python3](https://www.python.org)\n * [meson](http://mesonbuild.com)\n * [ninja](https://ninja-build.org/)\n\nFirst of all, clone the Git repository:\n\n    $ git clone https://github.com/ebassi/graphene\n    $ cd graphene\n\nThen run:\n\n    $ meson setup _build\n    $ meson compile -C _build\n    $ meson test -C _build\n    $ meson install -C _build\n\nIt is possible, when building Graphene, to disable specific optimizations by\nusing configuration options:\n\n * `-Dsse2=false` - will disable the SSE2 fast paths\n * `-Darm_neon=false` - will disable the ARM NEON fast paths\n * `-Dgcc_vector=false` - will disable the GCC vector intrinsics\n\nIf you don't plan on generating introspection data, use `-Dintrospection=disabled`\nwhen configuring Graphene; similarly, if you don't plan on using GObject with\nGraphene, use `-Dgobject_types=false`. Disabling GObject types will also\nautomatically disable generating introspection data.\n\nYou can explicitly disable building the test suite and the benchmark suite,\nusing the `-Dtests=false` and `-Dbenchmarks=false` configuration switches\nrespectively. The tests suite depends on [µTest][mutest]; if it is not available\nat configuration time, tests will be disabled automatically.\n\n#### Building on Windows\n\nGraphene supports the Microsoft Visual C compiler 2017 and later versions.\n\nGraphene also supports the [MSYS2 toolchain](http://sourceforge.net/projects/msys2/).\n\nWhen using MSYS2, it's recommended to have an up to date installation;\nin order to build Graphene you will need to use the `pacman` command\nto install the necessary build dependencies first:\n\n    $ pacman -S base-devel\n    $ pacman -S python3\n    $ pacman -S mingw-w64-x86_64-meson\t# only MINGW64 target\n    $ pacman -S mingw-w64-i686-meson\t# only MINGW32 target\n\nFor the optional support for GObject types, introspection, and\ndocumentation, you will need to install additional dependencies:\n\n    $ pacman -S gtk-doc                 # optional\n    $ pacman -S mingw-w64-x86_64-glib2  # optional, MINGW64 target only\n    $ pacman -S mingw-w64-i686-glib2    # optional, MINGW32 target only\n    $ pacman -S glib2 glib2-devel       # optional, MSYS target only\n\nAfter installing all dependencies, you can now clone the Graphene\nrepository locally, and follow the build instructions above.\n\nPlease note that on some MSYS2 installations the Meson binary may be called\n`meson.py`.\n\n## Documentation\n\n### Contributing\n\nYou can follow the [contribution guide](./CONTRIBUTING.md) if you want to\nparticipate in this project. Graphene also has a [code of\nconduct](./CODE_OF_CONDUCT.md), so make sure to follow it when interacting\non the project's issue tracker.\n\n### Release notes\n\nThe release notes are available on the Graphene\n[wiki](https://github.com/ebassi/graphene/wiki/Release-Notes).\n\n### Reference\n\nGraphene provides common types needed to handle 3D transformations:\n\n * [2D points](http://ebassi.github.io/graphene/docs/graphene-Point.html)\n * [3D points](http://ebassi.github.io/graphene/docs/graphene-Point3D.html)\n * [triangles](http://ebassi.github.io/graphene/docs/graphene-Triangle.html)\n * [rectangles](http://ebassi.github.io/graphene/docs/graphene-Rectangle.html)\n * [quads](http://ebassi.github.io/graphene/docs/graphene-Quad.html)\n * [quaternions](http://ebassi.github.io/graphene/docs/graphene-Quaternion.html)\n * [euler angles](http://ebassi.github.io/graphene/docs/graphene-Euler.html)\n * [vectors](http://ebassi.github.io/graphene/docs/graphene-Vectors.html) (2, 3, or 4-sized)\n * [matrices](http://ebassi.github.io/graphene/docs/graphene-Matrix.html)\n * [planes](http://ebassi.github.io/graphene/docs/graphene-Plane.html)\n * [3D axis aligned bounding boxes](http://ebassi.github.io/graphene/docs/graphene-Box.html)\n * [spheres](http://ebassi.github.io/graphene/docs/graphene-Sphere.html)\n * [frustums](http://ebassi.github.io/graphene/docs/graphene-Frustum.html)\n\nGraphene also provides its low-level SIMD [vector](http://ebassi.github.io/graphene/docs/graphene-SIMD-vector.html)\nand [matrix](http://ebassi.github.io/graphene/docs/graphene-SIMD-matrix.html)\ntypes, which are used to implement the API above.\n\nAll types can be placed on the stack, but provide allocation/free functions\nfor working on the heap as well. The contents of all structure types, unless\nnoted otherwise, should be considered private, and should never be accessed\ndirectly.\n\nThe full API reference for Graphene is [available online](http://ebassi.github.io/graphene/docs/).\n\n### License\n\nGraphene is released under the terms of the MIT/X11 license.\n\nSee the [license file](./LICENSE.txt) for more details.\n\n[mutest]: https://github.com/ebassi/mutest\n[gobject-api]: https://docs.gtk.org/gobject\n","funding_links":[],"categories":["Libraries"],"sub_categories":["Data Structures \u0026 Data Types"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febassi%2Fgraphene","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Febassi%2Fgraphene","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Febassi%2Fgraphene/lists"}