Packed Record TVector2Byte

Unit

Declaration

type TVector2Byte = packed record

Description

Vector of 2 Byte values.

See also
TVector3Byte
Vector of 3 Byte values.

Overview

Nested Types

Public TIndex = 0..1;

Fields

Public X: Byte
Public Y: Byte
Public Data: array [TIndex] of Byte

Methods

Public class operator + (const A, B: TVector2Byte): TVector2Byte; inline;
Public class operator - (const A, B: TVector2Byte): TVector2Byte; inline;
Public class operator - (const V: TVector2Byte): TVector2Byte; inline;
Public function ToString: string;
Public function IsZero: boolean; inline;
Public class function Equals(const V1, V2: TVector2Byte): boolean; static; inline;
Public class function Zero: TVector2Byte; static; inline;

Properties

Public property AsArray [constIndex:TIndex]: Byte read GetItems;

Description

Nested Types

Public TIndex = 0..1;
 

Fields

Public X: Byte
 
Public Y: Byte
 
Public Data: array [TIndex] of Byte
 

Methods

Public class operator + (const A, B: TVector2Byte): TVector2Byte; inline;
 
Public class operator - (const A, B: TVector2Byte): TVector2Byte; inline;
 
Public class operator - (const V: TVector2Byte): TVector2Byte; inline;
 
Public function ToString: string;
 
Public function IsZero: boolean; inline;
 
Public class function Equals(const V1, V2: TVector2Byte): boolean; static; inline;
 
Public class function Zero: TVector2Byte; static; inline;
 

Properties

Public property AsArray [constIndex:TIndex]: Byte read GetItems;

Get vector components by index. This is a default property, so you can write MyVector[0] instead of MyVector.Data[0] or MyVector.AsArray[0].

But note that this is not writeable (because exposing writeable properties on vectors would cause some subtle traps, see https://castle-engine.io/coding_traps ). Use MyVector.Data[0] := 123 if you want to set by index, or MyVector.X := 123.


Generated by PasDoc 0.16.0.