Kicking it Olde Sküül! Burgerlib on Github Follow Olde Sküül on Twitter Burgerbecky on LinkedIn Burgerbecky on LinkedIn
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | List of all members
Burger::Point2D_t Struct Reference

Integer 2D coordinate. More...

Public Member Functions

int32_t GetX (void) const noexcept
 Retrieve the X coordinate.
 
int32_t GetY (void) const noexcept
 Retrieve the Y coordinate.
 
int32_tGetXPtr (void) noexcept
 Retrieve the pointer to the X coordinate.
 
int32_tGetYPtr (void) noexcept
 Retrieve the pointer to the Y coordinate.
 
void SetX (int32_t iX) noexcept
 Set the X coordinate.
 
void SetY (int32_t iY) noexcept
 Set the Y coordinate.
 
void Set (int32_t iX, int32_t iY) noexcept
 Set the X and Y coordinates.
 
void Clear (void) noexcept
 Set the X and Y coordinates to zero.
 
eError Read (FILE *fp) noexcept
 Read a point from a file.
 
eError Write (FILE *fp) const noexcept
 Write a point to a file.
 
eError Read (Burger::File *fp) noexcept
 Read a point from a file.
 
eError Write (Burger::File *fp) const noexcept
 Write a point to a file.
 
void Get (Point *pOutput) const noexcept
 Convert a Point2D_t into a MacOS Point structure.
 
void Set (const Point *pInput) noexcept
 Convert a MacOS Point structure into a Point2D_t.
 
void Get (CGPoint *pOutput) const noexcept
 Convert a Point2D_t into a MacOSX/iOS CGPoint structure.
 
void Set (const CGPoint *pInput) noexcept
 Convert a MacOSX/iOS CGPoint structure into a Point2D_t.
 
void Get (_NSPoint *pOutput) const noexcept
 Convert a Point2D_t into a MacOSX _NSPoint structure.
 
void Set (const _NSPoint *pInput) noexcept
 Convert a MacOSX _NSPoint structure into a Point2D_t.
 
void Get (tagPOINT *pOutput) const noexcept
 Convert a Point2D_t into a Microsoft POINT structure.
 
void Set (const tagPOINT *pInput) noexcept
 Convert a Microsoft POINT structure into a Point2D_t.
 

Public Attributes

int32_t m_iX
 X coordinate of the point.
 
int32_t m_iY
 Y coordinate of the point.
 

Detailed Description

Integer 2D coordinate.


Simple container structure that holds an X and a Y coordinate with integer precision.

See also
Burger::Vector2D_t

Member Function Documentation

◆ Clear()

Burger::Point2D_t::Clear ( void )
inlinenoexcept

Set the X and Y coordinates to zero.


This inline function sets the X and Y coordinates for the point to zero, effectively initializing the structure

See also
Set()

◆ Get() [1/4]

void Burger::Point2D_t::Get ( _NSPoint * pOutput) const
noexcept

Convert a Point2D_t into a MacOSX _NSPoint structure.


Converts the contents of a Point2D_t into a MacOSX _NSPoint structure. Since it's converting an int into a float, data loss could occur.

Parameters
pOutputPointer to an uninitialized MacOSX _NSPoint structure.
Note
This function is 32 bit MacOSX only. This is what NSPoint maps to.

◆ Get() [2/4]

void Burger::Point2D_t::Get ( CGPoint * pOutput) const
noexcept

Convert a Point2D_t into a MacOSX/iOS CGPoint structure.


Converts the contents of a Point2D_t into a MacOSX/iOS CGPoint structure. Since it's converting an int into a float, data loss could occur.

Parameters
pOutputPointer to an uninitialized MacOSX/iOS CGPoint structure.
Note
This function is MacOSX or iOS only.

◆ Get() [3/4]

void Burger::Point2D_t::Get ( Point * pOutput) const
noexcept

Convert a Point2D_t into a MacOS Point structure.


Converts the contents of a Point2D_t into a MacOS/Quicktime for Windows Point structure. Since it's converting an int into a short, data loss could occur if the values exceed 32767 or are less than -32768.

Parameters
pOutputPointer to an uninitialized MacOS Point structure.
Note
This function is MacOS or Windows using Quicktime only.

◆ Get() [4/4]

void Burger::Point2D_t::Get ( tagPOINT * pOutput) const
noexcept

Convert a Point2D_t into a Microsoft POINT structure.


Converts the contents of a Point2D_t into a Microsoft POINT structure.

Parameters
pOutputPointer to an uninitialized Microsoft POINT structure.
Note
This function is Windows and Xbox 360 only.

◆ GetX()

Burger::Point2D_t::GetX ( void ) const
inlinenoexcept

Retrieve the X coordinate.


Returns
The X coordinate of the point
See also
GetY() or GetXPtr()

◆ GetXPtr()

Burger::Point2D_t::GetXPtr ( void )
inlinenoexcept

Retrieve the pointer to the X coordinate.


Returns
The pointer to the X coordinate of the point
See also
GetYPtr() or GetX()

◆ GetY()

Burger::Point2D_t::GetY ( void ) const
inlinenoexcept

Retrieve the Y coordinate.


Returns
The Y coordinate of the point
See also
GetX() or GetYPtr()

◆ GetYPtr()

Burger::Point2D_t::GetYPtr ( void )
inlinenoexcept

Retrieve the pointer to the Y coordinate.


Returns
The pointer to the Y coordinate of the point
See also
GetXPtr() or GetY()

◆ Read() [1/2]

Burger::eError Burger::Point2D_t::Read ( Burger::File * fp)
noexcept

Read a point from a file.


Read two sixteen bit integers in Little Endian format from an open binary file and store the values as the new X and Y coordinates.

Note
The input is sixteen bit, so the values returned are in the range of -32768 and 32767.
Parameters
fpPointer to an open for reading Burger::File reference
Returns
kErrorNone if no error, non-zero on error
See also
Read(FILE *) or Write(Burger::File *) const

◆ Read() [2/2]

Burger::eError Burger::Point2D_t::Read ( FILE * fp)
noexcept

Read a point from a file.


Read two sixteen bit integers in Little Endian format from an open binary file and store the values as the new X and Y coordinates.

Note
The input is sixteen bit, so the values returned are in the range of -32768 and 32767
Parameters
fpPointer to an open for reading FILE reference
Returns
kErrorNone if no error, non-zero on error
See also
Read(Burger::File *) or Write(FILE *) const

◆ Set() [1/5]

void Burger::Point2D_t::Set ( const _NSPoint * pInput)
noexcept

Convert a MacOSX _NSPoint structure into a Point2D_t.


Converts the contents of a MacOSX _NSPoint structure into a Point2D_t. Since it's converting a float to an int, data loss could occur.

Parameters
pInputPointer to a valid MacOSX _NSPoint structure.
Note
This function is 32 bit MacOSX only. This is what NSPoint maps to.

◆ Set() [2/5]

void Burger::Point2D_t::Set ( const CGPoint * pInput)
noexcept

Convert a MacOSX/iOS CGPoint structure into a Point2D_t.


Converts the contents of a MacOSX/iOS CGPoint structure into a Point2D_t. Since it's converting a float to an int, data loss could occur.

Parameters
pInputPointer to a valid MacOSX/iOS CGPoint structure.
Note
This function is MacOSX or iOS only.

◆ Set() [3/5]

void Burger::Point2D_t::Set ( const Point * pInput)
noexcept

Convert a MacOS Point structure into a Point2D_t.


Converts the contents of a MacOS/Quicktime for Windows Point structure into a Point2D_t. Since it's converting a short to an int, no data loss will occur.

Parameters
pInputPointer to a valid MacOS Point structure.
Note
This function is MacOS or Windows using Quicktime only.

◆ Set() [4/5]

void Burger::Point2D_t::Set ( const tagPOINT * pInput)
noexcept

Convert a Microsoft POINT structure into a Point2D_t.


Converts the contents of a Microsoft POINT structure into a Point2D_t.

Parameters
pInputPointer to a valid Microsoft POINT structure.
Note
This function is Windows and Xbox 360 only.

◆ Set() [5/5]

Burger::Point2D_t::Set ( int32_t iX,
int32_t iY )
inlinenoexcept

Set the X and Y coordinates.


This inline function sets the X and Y coordinates for the point, effectively initializing the structure

Parameters
iXThe new X coordinate for the point
iYThe new Y coordinate for the point
See also
Clear(), SetX() or SetY()

◆ SetX()

Burger::Point2D_t::SetX ( int32_t iX)
inlinenoexcept

Set the X coordinate.


This inline function sets the X coordinate for the point

Parameters
iXThe new X coordinate for the point
See also
Set(), GetX() or SetY()

◆ SetY()

Burger::Point2D_t::SetY ( int32_t iY)
inlinenoexcept

Set the Y coordinate.


This inline function sets the Y coordinate for the point

Parameters
iYThe new Y coordinate for the point
See also
Set(), GetY() or SetX()

◆ Write() [1/2]

Burger::eError Burger::Point2D_t::Write ( Burger::File * fp) const
noexcept

Write a point to a file.


Write the X and Y coordinates to a FILE stream as two sixteen bit little endian integers.

Note
The output is sixteen bit, so valid values are in the range of -32768 and 32767. If values in the Point2D_t are out of this range, data loss could occur.
Parameters
fpPointer to an open for writing Burger::File reference
Returns
kErrorNone if no error, non-zero on error
See also
Write(FILE *) const or Read(Burger::File *)

◆ Write() [2/2]

Burger::eError Burger::Point2D_t::Write ( FILE * fp) const
noexcept

Write a point to a file.


Write the X and Y coordinates to a FILE stream as two sixteen bit little endian integers.

Note
The output is sixteen bit, so valid values are in the range of -32768 and 32767. If values in the Burger::Point2D_t are out of this range, data loss could occur.
Parameters
fpPointer to an open for writing FILE reference
Returns
kErrorNone if no error, non-zero on error
See also
Write(Burger::File *) const or Read(FILE *)

Member Data Documentation

◆ m_iX

int32_t Burger::Point2D_t::m_iX

X coordinate of the point.

◆ m_iY

int32_t Burger::Point2D_t::m_iY

Y coordinate of the point.