Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CharLayout Class Reference

This represents the arrangement of all characters on a working bitmap of a given size. More...

#include <charLayout.h>

List of all members.

Public Types

typedef pvector< CharPlacementPlacements

Public Member Functions

void reset (int working_xsize, int working_ysize, int working_buffer_pixels)
 Removes all the characters already placed on the layout, and resets the parameters for a new attempt.

bool place_character (const CharBitmap *bm)
 Given a character bitmap and font metrics extracted from the pk file, find a place for it on the layout.


Public Attributes

Placements _placements
int _working_xsize
int _working_ysize
int _working_buffer_pixels
int _cx
int _cy
int _nexty

Private Member Functions

bool find_hole (int &x, int &y, int x_size, int y_size) const
 Searches for a hole of at least x_size by y_size pixels somewhere within the layout.

const CharPlacementfind_overlap (int x, int y, int x_size, int y_size) const
 If the rectangle whose top left corner is x, y and whose size is x_size, y_size describes an empty hole that does not overlap any placed chars, returns NULL; otherwise, returns the first placed texture that the image does overlap.


Detailed Description

This represents the arrangement of all characters on a working bitmap of a given size.

Either all characters fit or they don't.

Definition at line 44 of file charLayout.h.


Member Typedef Documentation

typedef pvector<CharPlacement> CharLayout::Placements
 

Definition at line 51 of file charLayout.h.


Member Function Documentation

bool CharLayout::find_hole int x,
int y,
int  x_size,
int  y_size
const [private]
 

Searches for a hole of at least x_size by y_size pixels somewhere within the layout.

If a suitable hole is found, sets x and y to the top left corner and returns true; otherwise, returns false.

Definition at line 93 of file charLayout.cxx.

References x.

const CharPlacement * CharLayout::find_overlap int  x,
int  y,
int  x_size,
int  y_size
const [private]
 

If the rectangle whose top left corner is x, y and whose size is x_size, y_size describes an empty hole that does not overlap any placed chars, returns NULL; otherwise, returns the first placed texture that the image does overlap.

It is assumed the rectangle lies completely within the boundaries of the image itself.

Definition at line 145 of file charLayout.cxx.

Referenced by place_character().

bool CharLayout::place_character const CharBitmap bm  ) 
 

Given a character bitmap and font metrics extracted from the pk file, find a place for it on the layout.

Returns true if the character was placed, false if we ran out of room.

Definition at line 65 of file charLayout.cxx.

References CharPlacement::_height, CharPlacement::_width, _working_buffer_pixels, _working_xsize, _working_ysize, CharPlacement::_x, CharPlacement::_y, find_overlap(), NULL, x, and y.

void CharLayout::reset int  working_xsize,
int  working_ysize,
int  working_buffer_pixels
 

Removes all the characters already placed on the layout, and resets the parameters for a new attempt.

Definition at line 38 of file charLayout.cxx.


Member Data Documentation

int CharLayout::_cx
 

Definition at line 56 of file charLayout.h.

int CharLayout::_cy
 

Definition at line 56 of file charLayout.h.

int CharLayout::_nexty
 

Definition at line 56 of file charLayout.h.

Placements CharLayout::_placements
 

Definition at line 52 of file charLayout.h.

int CharLayout::_working_buffer_pixels
 

Definition at line 55 of file charLayout.h.

Referenced by place_character().

int CharLayout::_working_xsize
 

Definition at line 54 of file charLayout.h.

Referenced by place_character().

int CharLayout::_working_ysize
 

Definition at line 54 of file charLayout.h.

Referenced by place_character().


The documentation for this class was generated from the following files:
Generated on Fri May 2 03:25:58 2003 for Panda-Tool by doxygen1.3