C++ API Library Reference  4.3.2-74-ge1d4cca
Classes | Public Functions | Public Static Functions | List of all members
Image Class Reference

The Image class represents an aligned 2D image along with its underlying bitmap buffer. By default, it is compatible with Windows bitmap format.

Image objects are passed to RenderTarget for streaming to client-side views.

Public Functions

Int32 Alignment () const
 
Int32 BytesPerPixel () const
 
Int32 BytesPerRow () const
 
Image Copy () const
 
void CopyTo (Image &other) const
 
void FlipY ()
 
Int32 Height () const
 
 Image ()
 
ByteArray ImageBytes ()
 
const ByteArray ImageBytes () const
 
ScanLineOrder::Enum Orientation () const
 
PureWeb::PixelFormat::Enum PixelFormat () const
 
Rectangle Region () const
 
Int32 RowStride () const
 
Byte * Scan0 ()
 
const Byte * Scan0 () const
 
PureWeb::Size Size () const
 
Int32 Width () const
 
Constructors and Destructors
Note
If you construct an image from existing data (using either of the last two constructors below), no copy is made. You must ensure that the specified pixel memory stays valid for the lifetime of the image instance.
 Image (Int32 width, Int32 height, PixelFormat::Enum format, ScanLineOrder::Enum orientation=ScanLineOrder::TopDown, Int32 alignment=4)
 
 Image (void *pPixels, Int32 width, Int32 height, PixelFormat::Enum format, ScanLineOrder::Enum orientation, Int32 alignment)
 
 Image (ByteArray pixels, Int32 width, Int32 height, PixelFormat::Enum format, ScanLineOrder::Enum, Int32 alignment)
 
 ~Image ()
 

Public Static Functions

static Int32 CalcImageSize (Int32 width, Int32 height, PixelFormat::Enum format, Int32 alignment)
 
static Int32 CalcStride (Int32 width, Int32 bytesPerPixel, Int32 alignment, ScanLineOrder::Enum orientation)
 

Usage Description

Int32 Alignment ( ) const
inline

Returns a constant reference to the alignment of the image. By default, the value for alignment is 4.

Int32 BytesPerPixel ( ) const
inline

Returns a constant reference to the number of bytes per pixel in the image.

Int32 BytesPerRow ( ) const
inline

Returns a constant reference to the number of bytes per row in the image.

static Int32 CalcImageSize ( Int32  width,
Int32  height,
PixelFormat::Enum  format,
Int32  alignment 
)
static

Calculates the size of the image, based on the provided width, height, pixel format, and alignment.

static Int32 CalcStride ( Int32  width,
Int32  bytesPerPixel,
Int32  alignment,
ScanLineOrder::Enum  orientation 
)
static

Calculates the stride of the image, based on the provided width, number of bytes per pixel, alignment, and orientation (scan line order).

Image Copy ( ) const

Makes a clone of the image.

void CopyTo ( Image other) const

Copies this image into the supplied image parameter.

void FlipY ( )

Flips the image horizontally.

Int32 Height ( ) const
inline

Returns the height of the image, in pixels.

ByteArray ImageBytes ( )
inline

Returns the underlying image byte array.

const ByteArray ImageBytes ( ) const
inline

Returns a constant reference to the underlying byte array.

ScanLineOrder::Enum Orientation ( ) const
inline

Returns the scan line order of the image; the default is TopDown.

Returns the pixel format of the image; the default is BGR.

Rectangle Region ( ) const
inline

Returns the bounding region of the image.

Int32 RowStride ( ) const
inline

Returns the stride value for a row of pixels. This value will be negative if the scan line order is BottomUp.

Byte* Scan0 ( )

Returns the value for the Scan0 property of the image. This represents the pointer address of the first pixel data.

const Byte* Scan0 ( ) const

Returns a constant reference to the Scan0 property of the image. This represents the pointer address of the first pixel data.

PureWeb::Size Size ( ) const
inline

Returns the size of the image, in pixels.

Int32 Width ( ) const
inline

Returns the width of the image, in pixels.