N64 QOI Encoder Demo 1.0.1
Encoder for N64 that saves it to SD card
Loading...
Searching...
No Matches
colorconv.h File Reference

Color conversion utilities for N64 QOI encoder. More...

#include <stdint.h>

Go to the source code of this file.

Functions

uint16_t read_be_u16 (uint16_t val)
 Reads an 16-bit unsigned big endian integer number.
uint32_t n64_color16_to_rgba32 (uint16_t px16)
 Convert N64 16-bit (5R-5G-5B-1A) to 0xRRGGBBAA (32-bit).

Detailed Description

Color conversion utilities for N64 QOI encoder.

Author
Aftersol
Version
1.0.1
Date
2026-05-09

colorconv.h - Color conversion utilities for N64 QOI encoder

Code licensed under MIT License

Copyright (c) 2026 Aftersol

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Definition in file colorconv.h.

Function Documentation

◆ n64_color16_to_rgba32()

uint32_t n64_color16_to_rgba32 ( uint16_t px16)
inline

Convert N64 16-bit (5R-5G-5B-1A) to 0xRRGGBBAA (32-bit).

Parameters
px16The 16-bit pixel value to convert
Returns
The converted 32-bit RGBA pixel value

Definition at line 56 of file colorconv.h.

◆ read_be_u16()

uint16_t read_be_u16 ( uint16_t val)

Reads an 16-bit unsigned big endian integer number.

Parameters
valvalue of a 16-bit unsigned integer in big endian
Returns
converted value of the unsigned big endian value passed into read_be_u16 in their endianness of their machine

Definition at line 47 of file colorconv.h.