<commit_before># Graphene
###  A thin layer of types for graphic libraries

When creating graphic libraries you most likely end up dealing with points
and rectangles. If you're particularly unlucky, you may end up dealing
with affine matrices and 2D transformations. If you're writing a graphic
library with 3D transformations, though, you are going to hit the jackpot:
4x4 matrices, projections, transformations, vectors, and quaternions.

Most of this stuff exists, in various forms, in other libraries, but it
has the major drawback of coming along with the rest of those libraries,
which may or may not be what you want. Those libraries are also available
in various languages, as long as those languages are C++; again, it may or
may not be something you want.

For this reason, I decided to write the thinnest, smallest possible layer
needed to write a canvas library; given its relative size, and the
propensity for graphics libraries to have a pun in their name, I decided
to call it Graphene.

This library provides types and their relative API; it does not deal with
windowing system surfaces, drawing, scene graphs, or input. You're
supposed to do that yourself, in your own canvas implementation, which is
the whole point of writing the library in the first place.

### Dependencies

Graphene is a C library. For this reason alone, it depends on GLib, as
GLib gives us a fairly decent, portable, and maintained layer to depend
on, instead of requiring me to re-implement a ton of code.

Graphene does not use the GObject type system, as of yet, but it may grow
an optional dependency on it through a separate shared object, especially
if in the future I'm going to generate introspection data for the benefit
of GObject-based language bindings.

Graphene contains optimizations for speeding up vector operations; those
optimizations are optional, and used only if both Graphene was compiled
with support for them *and* if the system you're running on has them.
Currently, Graphene supports the following platform-specific fast paths:

 * Streaming SIMD Extensions (SSE) 2
 * ARM NEON
 * GCC vector extensions

In the remote case in which none of these optimizations are available,
Graphene will fall back to a naive scalar implementation.

### Installation

In order to build and install Graphene you will need development tools and
the headers of the dependencies.

First of all, clone the Git repository:

    $ git clone git://github.com/ebassi/graphene
    $ cd graphene

Then run:

    $ ./autogen.sh
    $ make
    $ make check
    # make install

It is possible, when building Graphene, to disable specific optimizations by
passing options to the `configure` script:

 * `--disable-sse2` - will disable the SSE2 fast paths
 * `--disable-arm-neon` - will disable the ARM NEON fast paths
 * `--disable-gcc-vector` - will disable the GCC vector intrinsics

See the output of `configure --help` for more information.

### Contributing

If you found a bug (which I'm sure there will be plenty), or if you want
to add your own pet feature, then follow these steps:

 1. Fork the `graphene` repository on Github
 2. Fix bugs or add new features
 3. Open a pull request
 4. Wait for me to give feedback on the pull request

That's pretty much it.

## Documentation

### Available types

Graphene provides common types needed to handle 3D transformations:

 * 2D points
 * 3D points
 * rectangles
 * quads
 * quaternions
 * vectors (2, 3, or 4-sized)
 * matrices

All types can be placed on the stack, but provide allocation/free functions
for working on the heap as well. The contents of all structure types, except
for points and rectangles, should be considered private, and should never be<commit_msg>docs: Add the 'new issue' step<commit_after># Graphene
###  A thin layer of types for graphic libraries

When creating graphic libraries you most likely end up dealing with points
and rectangles. If you're particularly unlucky, you may end up dealing
with affine matrices and 2D transformations. If you're writing a graphic
library with 3D transformations, though, you are going to hit the jackpot:
4x4 matrices, projections, transformations, vectors, and quaternions.

Most of this stuff exists, in various forms, in other libraries, but it
has the major drawback of coming along with the rest of those libraries,
which may or may not be what you want. Those libraries are also available
in various languages, as long as those languages are C++; again, it may or
may not be something you want.

For this reason, I decided to write the thinnest, smallest possible layer
needed to write a canvas library; given its relative size, and the
propensity for graphics libraries to have a pun in their name, I decided
to call it Graphene.

This library provides types and their relative API; it does not deal with
windowing system surfaces, drawing, scene graphs, or input. You're
supposed to do that yourself, in your own canvas implementation, which is
the whole point of writing the library in the first place.

### Dependencies

Graphene is a C library. For this reason alone, it depends on GLib, as
GLib gives us a fairly decent, portable, and maintained layer to depend
on, instead of requiring me to re-implement a ton of code.

Graphene does not use the GObject type system, as of yet, but it may grow
an optional dependency on it through a separate shared object, especially
if in the future I'm going to generate introspection data for the benefit
of GObject-based language bindings.

Graphene contains optimizations for speeding up vector operations; those
optimizations are optional, and used only if both Graphene was compiled
with support for them *and* if the system you're running on has them.
Currently, Graphene supports the following platform-specific fast paths:

 * Streaming SIMD Extensions (SSE) 2
 * ARM NEON
 * GCC vector extensions

In the remote case in which none of these optimizations are available,
Graphene will fall back to a naive scalar implementation.

### Installation

In order to build and install Graphene you will need development tools and
the headers of the dependencies.

First of all, clone the Git repository:

    $ git clone git://github.com/ebassi/graphene
    $ cd graphene

Then run:

    $ ./autogen.sh
    $ make
    $ make check
    # make install

It is possible, when building Graphene, to disable specific optimizations by
passing options to the `configure` script:

 * `--disable-sse2` - will disable the SSE2 fast paths
 * `--disable-arm-neon` - will disable the ARM NEON fast paths
 * `--disable-gcc-vector` - will disable the GCC vector intrinsics

See the output of `configure --help` for more information.

### Contributing

If you found a bug (which I'm sure there will be plenty), or if you want
to add your own pet feature, then follow these steps:

 1. Fork the [ebassi/graphene](https://github.com/ebassi/graphene) repo
 2. Fix bugs or add new features and push them to your clone
 3. Open [a new issue](https://github.com/ebassi/graphene/issues/new)
 4. Open [a pull request](https://github.com/ebassi/graphene/pulls)
 5. Wait for me to give feedback on the pull request
 6. Celebrate when your code gets merged

That's pretty much it.

## Documentation

### Available types

Graphene provides common types needed to handle 3D transformations:

 * 2D points
 * 3D points
 * rectangles
 * quads
 * quaternions
 * vectors (2, 3, or 4-sized)
 * matrices

All types can be placed on the stack, but provide allocation/free functions
for working on the heap as well. The contents of all structure types, except
for points and rectangles, should be considered private, and should never be
{'fraction_non_alphanumeric': 0.05054198772365156, 'fraction_numerical': 0.004701580253362936, 'mean_word_length': 4.156902356902357, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 3, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2288539', 'n_tokens_mistral': 2068, 'n_tokens_neox': 1943, 'n_words': 1166}