From 1971b40ad63fc08cd10c35ed5c863f322f72f7b4 Mon Sep 17 00:00:00 2001 From: Nathanael Gentry Date: Wed, 22 May 2024 09:47:12 +0200 Subject: [PATCH] Add better documentation of what datums are. --- src/MediaStation/Primitives/Datum.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/MediaStation/Primitives/Datum.py b/src/MediaStation/Primitives/Datum.py index a4994a2..73b8c58 100644 --- a/src/MediaStation/Primitives/Datum.py +++ b/src/MediaStation/Primitives/Datum.py @@ -7,8 +7,19 @@ from .Point import Point from .Reference import Reference -## A datum that can be read from a binary stream. -## Provides the type of the value before the actual value. +## Except for compressed image data and audio data, +## nearly all data in Media Station files is encapsulated +## in "datums", so called because they generally represent +## the smallest units of useful data in Media Station data files. +## +## A datum provides a 16-bit type code, followed by a variable- +## length data section, whose length is generally defined +## by the type code. +## Here is an example, where `xx` represents one byte: +## Type code +## | Data +## | | +## xx xx xx xx .. xx xx ## TODO: Add type assertions for extra checking. class Datum: ## The various known datum type codes.