Rogue Wave Views
Foundation Package API Reference Guide
Product Documentation:

Rogue Wave Views
Documentation Home
List of all members | Public Member Functions | Friends
IlvPattern Class Reference

Resource class. More...

#include <ilviews/base/port.h>

Inheritance diagram for IlvPattern:
IlvResource IlvColorPattern IlvGradientPattern

Public Member Functions

 IlvPattern (IlvDisplay *display, IlvDim width, IlvDim height, unsigned char *data)
 Constructor. More...
 
 IlvPattern (IlvBitmap *bitmap)
 Constructor. More...
 
virtual IlUShort depth () const
 Retrieves the depth (number of bits that define a pixel value) of this pattern. More...
 
unsigned char * getBitmapData (IlUInt &size) const
 Retrieves the pixels of this pattern. More...
 
IlvDim height () const
 Retrieves the height of this pattern. More...
 
void putBitmapData (unsigned char *data, IlUInt size)
 Modifies the pixels of this pattern. More...
 
IlvDim width () const
 Retrieves the width of this pattern. More...
 
- Public Member Functions inherited from IlvResource
IlvDisplaygetDisplay () const
 Gets the IlvDisplay instance. More...
 
const char * getName () const
 Gets the resource name. More...
 
void lock ()
 Locks the resource. More...
 
virtual void setName (const char *name)
 Sets the name of the resource. More...
 
virtual void unLock ()
 Unlocks the resource. More...
 

Friends

class IlvDisplay
 

Detailed Description

Resource class.

Library: xviews or winviews or mviews (mutually exclusive)

A pattern can be monochrome, defined with only one bit per pixel, or colored. It can be of any size. The IlvPattern class handles monochrome patterns.
The IlvDisplay::getPattern member function returns a previously-defined pattern. The IlvDisplay::defaultPattern member function returns a predefined pattern.
Other patterns are predefined and you can access them by name.


- Some Predefined Patterns -

See also
IlvPalette.

Constructor & Destructor Documentation

IlvPattern::IlvPattern ( IlvDisplay display,
IlvDim  width,
IlvDim  height,
unsigned char *  data 
)

Constructor.

This constructor initializes a new IlvPattern object with a size and a pattern that you can define.

Parameters
displayThe display for which this pattern is created.
widthThe width of this new pattern.
heightThe height of this new pattern.
dataThe data that defines this pattern. The pixel values are packed into 16-bit words from left to right in a most significant bits first manner, and each scan line, stored from top to bottom, must be padded to 16 bits.
IlvPattern::IlvPattern ( IlvBitmap bitmap)

Constructor.

This constructor initializes a new IlvPattern that has the pattern stored in the given bitmap.

Parameters
bitmapThe bitmap that will define this new pattern's contents. Note that the bitmap contents is copied, and that this bitmap must be monochrome.

Member Function Documentation

virtual IlUShort IlvPattern::depth ( ) const
virtual

Retrieves the depth (number of bits that define a pixel value) of this pattern.

Returns
The depth of this pattern. This value is always 1 for instances of IlvPattern, but this member function can return a different value for an instance of IlvColorPattern, which is a subclass of IlvPattern.

Reimplemented in IlvColorPattern.

unsigned char* IlvPattern::getBitmapData ( IlUInt size) const

Retrieves the pixels of this pattern.

Parameters
sizeSet to size of the returned array.
Returns
An array of bytes that describes the pattern data. The size of this array can be retrieved in size. (See IlvBitmap for more information regarding the data format).
IlvDim IlvPattern::height ( ) const

Retrieves the height of this pattern.

Returns
The height of this pattern.
void IlvPattern::putBitmapData ( unsigned char *  data,
IlUInt  size 
)

Modifies the pixels of this pattern.

Parameters
dataThe data that defines the aspect of this pattern.
sizeThe size of the array data, in bytes.
IlvDim IlvPattern::width ( ) const

Retrieves the width of this pattern.

Returns
The width of this pattern.

© Copyright 2016, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.