BurgerLib
Public Member Functions | Public Attributes
Burger::Point2D_t Struct Reference

Integer 2D coordinate. More...

#include <lrrect.h>

List of all members.

Public Member Functions

BURGER_INLINE int GetX (void) const
 Retrieve the X coordinate.
BURGER_INLINE int GetY (void) const
 Retrieve the Y coordinate.
BURGER_INLINE int * GetXPtr (void)
 Retrieve the pointer to the X coordinate.
BURGER_INLINE int * GetYPtr (void)
 Retrieve the pointer to the Y coordinate.
BURGER_INLINE void SetX (int iX)
 Set the X coordinate.
BURGER_INLINE void SetY (int iY)
 Set the Y coordinate.
BURGER_INLINE void Set (int iX, int iY)
 Set the X and Y coordinates.
BURGER_INLINE void Clear (void)
 Set the X and Y coordinates to zero.
Word Read (FILE *fp)
 Read a point from a file.
Word Write (FILE *fp)
 Write a point to a file.
void Get (struct Point *pOutput)
 Convert a Burger::Point2D_t into a MacOS Point structure.
void Set (const struct Point *pInput)
 Convert a MacOS Point structure into a Burger::Point2D_t.

Public Attributes

int m_iX
 X coordinate of the point.
int 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

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:
Burger::Point2D_t::Set(int,int)
void Burger::Point2D_t::Get ( struct Point *  pOutput)

Convert a Burger::Point2D_t into a MacOS Point structure.

Converts the contents of a Burger::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.
Burger::Point2D_t::GetX ( void  ) const [inline]

Retrieve the X coordinate.

Returns:
The X coordinate of the point
See also:
Burger::Point2D_t::GetY(void) const or Burger::Point2D_t::GetXPtr(void)

Retrieve the pointer to the X coordinate.

Returns:
The pointer to the X coordinate of the point
See also:
Burger::Point2D_t::GetYPtr(void) or Burger::Point2D_t::GetX(void) const
Burger::Point2D_t::GetY ( void  ) const [inline]

Retrieve the Y coordinate.

Returns:
The Y coordinate of the point
See also:
Burger::Point2D_t::GetX(void) const or Burger::Point2D_t::GetYPtr(void)

Retrieve the pointer to the Y coordinate.

Returns:
The pointer to the Y coordinate of the point
See also:
Burger::Point2D_t::GetXPtr(void) or Burger::Point2D_t::GetY(void) const
Word Burger::Point2D_t::Read ( FILE *  fp)

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
Burger::Point2D_t::Set ( int  iX,
int  iY 
) [inline]

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:
Burger::Point2D_t::Clear(void), Burger::Point2D_t::SetX(int) or Burger::Point2D_t::SetX(int)
void Burger::Point2D_t::Set ( const struct Point *  pInput)

Convert a MacOS Point structure into a Burger::Point2D_t.

Converts the contents of a MacOS/Quicktime for Windows Point structure into a Burger::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.
Burger::Point2D_t::SetX ( int  iX) [inline]

Set the X coordinate.

This inline function sets the X coordinate for the point

Parameters:
iXThe new X coordinate for the point
See also:
Burger::Point2D_t::GetX(void) const or Burger::Point2D_t::SetY(int)
Burger::Point2D_t::SetY ( int  iY) [inline]

Set the Y coordinate.

This inline function sets the Y coordinate for the point

Parameters:
iYThe new Y coordinate for the point
See also:
Burger::Point2D_t::GetY(void) const or Burger::Point2D_t::SetX(int)

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.

Member Data Documentation

X coordinate of the point.

Y coordinate of the point.