From 52051a310f5a98d5f182d2ce982592565cedfb23 Mon Sep 17 00:00:00 2001 From: Dominic Szablewski Date: Tue, 21 Dec 2021 18:05:30 +0100 Subject: [PATCH] Documentation: clarify alpha handling for certain chunk types; close #105 --- qoi.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/qoi.h b/qoi.h index 5e31076b..ab9d4582 100644 --- a/qoi.h +++ b/qoi.h @@ -156,6 +156,8 @@ so "1 - 2" will result in 255, while "255 + 1" will result in 0. Values are stored as unsigned integers with a bias of 2. E.g. -2 is stored as 0 (b00). 1 is stored as 3 (b11). +The alpha value remains unchanged from the previous pixel. + .- QOI_OP_LUMA -------------------------------------. | Byte[0] | Byte[1] | @@ -180,6 +182,8 @@ so "10 - 13" will result in 253, while "250 + 7" will result in 1. Values are stored as unsigned integers with a bias of 32 for the green channel and a bias of 8 for the red and blue channel. +The alpha value remains unchanged from the previous pixel. + .- QOI_OP_RUN ------------. | Byte[0] | @@ -206,6 +210,8 @@ QOI_OP_RGBA tags. 8-bit green channel value 8-bit blue channel value +The alpha value remains unchanged from the previous pixel. + .- QOI_OP_RGBA ---------------------------------------------------. | Byte[0] | Byte[1] | Byte[2] | Byte[3] | Byte[4] |