Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site













SourceForge.net Logo

Image

 

class Image : public AssignValueTypeNo< Image, 150, Moveable<Image> > 

Image represents an immutable image value. Image can be directly painted to Draw. To create or change Image, use ImageBuffer.

Image has low-cost constant time deep copy. It is moveable and Rich-Value compatible type.

U++ expects pixels to be in premultiplied alpha format.

 

 

Public Member List

 

const RGBA* operator~() const

operator const RGBA*() const

Returns a pointer to Image pixels.

 


 

const RGBA* operator[](int iconst

Returns a pointer to the first pixel in the line i.

 


 

Size GetSize() const

Returns the dimension of Image.

 


 

int GetWidth() const

Same as GetSize().cx.

 


 

int GetHeight() const

Same as GetSize().cy.

 


 

int GetLength() const

Number of pixels in Image - GetWidth() * GetHeight().

 


 

Point GetHotSpot() const

Returns the reference point.

 


 

Point Get2ndSpot() const

Returns secondary reference point.

 


 

Size GetDots() const

Gets the physical size of Image. If physical size is not set, returns Size(0, 0).

 


 

Size GetDPI() const

Returns the image resolution in dpi (dots per inch).

 


 

int GetKindNoScan() const

Returns the kind of image. Unlike GetKind(), it does not perform the scan of image if the kind it not know, therefore it can return IMAGE_UNKNOWN.

 


 

int GetKind() const

Returns the kind of image, either set by ImageBuffer::SetKind or (if it is IMAGE_UNKNOWN) resolved by scanning pixels. If the kind is IMAGE_UNKNOWN, the pixels are scanned and the type is determined, it is then stored (in private Image instance variable) for future use and returned.

 


 

const RGBA *Begin() const

const RGBA *begin() const

Returns a pointer to the first pixel.

 


 

const RGBA *End() const

const RGBA *end() const

Returns begin() + GetLength().

 


 

int64 GetSerialId() const

Returns the unique, per application run, identifier of Image. All Images with the same serial id can be considered equal (this is useful for caching images).

 


 

bool IsSame(const Image& imgconst

Same as GetSerialId() == img.GetSerialId().

 


 

bool operator==(const Image& imgconst

bool operator!=(const Image& imgconst

Tests whether two Images are equal (or not equal). Dimensions, hot-spots, dots and all pixels are compared. Note that the comparison can be slow.

 


 

dword GetHashValue() const

Returns the hash-value for image. All pixels combined into hash value (potentially slow).

 


 

String ToString() const

Returns the basic Image informations as String.

 


 

void Serialize(Stream& s)

Serializes Image.

 


 

void Clear()

Assigns an empty Image.

 


 

Image& operator=(const Image& img)

Assigns another Image.

 


 

Image& operator=(ImageBuffer& img)

Assigns Image created in ImageBuffer. ImageBuffer is emptied by this operation.

 


 

bool IsNullInstance() const

Test whether Image has nonzero dimension.

 


 

bool IsEmpty() const

Same as IsNullInstance.

 


 

operator Value() const

Converts Image to Value.

 

 

Constructor Detail

 

Image()

 


 

Image(const Nuller&)

Constructs empty Image.

 


 

Image(const Value& src)

Converts Image from Value.

 


 

Image(const Image& img)

Copy constructor.

 


 

Image(Image (*fn)())

This function allow Image to be directly constructed from pointer to function returning the Image. This allows omitting parenthesis when passing Iml image constants as arguments.

 


 

Image(ImageBuffer& b)

Uses Image created in ImageBuffer. ImageBuffer is emptied by this operation.

 

 

Standard cursors

Image class contains several standard mouse cursor Images as static member methods:

 

Arrow

Wait

IBeam

No

SizeAll

SizeHorz

SizeVert

SizeTopLeft

SizeTop

SizeTopRight

SizeLeft

SizeRight

SizeBottomLeft

SizeBottom

SizeBottomRight

 

Last edit by cxl on 10/10/2018. Do you want to contribute?. T++