Draw: Image, ImageBuffer docs

git-svn-id: svn://ultimatepp.org/upp/trunk@1437 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2009-07-19 15:14:14 +00:00
parent 68a73dff42
commit a7fa474e49
2 changed files with 358 additions and 298 deletions

View file

@ -1,317 +1,199 @@
topic "Image and ImageBuffer";[2 $$0,0#00000000000000000000000000000000:Default]
topic "Image and ImageBuffer";
[2 $$0,0#00000000000000000000000000000000:Default]
[i448;a25;kKO9;*@(64)2 $$1,0#37138531426314131252341829483380:class]
[l288;2 $$2,2#27521748481378242620020725143825:desc]
[a83;*R6 $$3,0#31310162474203024125188417583966:caption]
[l288;i1121;b17;O9;~~~.1408;2 $$4,0#10431211400427159095818037425705:param]
[i448;a25;kKO9;*@(64)2 $$5,0#37138531426314131252341829483370:item]
[*+117 $$6,6#14700283458701402223321329925657:header]
[{_}%EN-US
[s3; Image and ImageBuffer&]
[s1;K:`:`:Image`:`:class:%- [@(0.0.255) class]_[@0 Image]_:_[@(0.0.255) public]_[^`:`:AssignValueTypeNo^ A
ssignValueTypeNo]<_[@0 Image], [@3 150], [^`:`:Moveable^ Moveable]<[@0 Image]>_>_&]
[s2; Image represents an immutable image value. Image can be directly
[0 $$7,0#96390100711032703541132217272105:end]
[H6;0 $$8,0#05600065144404261032431302351956:begin]
[{_}
[ {{10000@(113.42.0) [s0;%% [*@7;4 Image]]}}&]
[s1;@(0.0.255) &]
[s1;:Image`:`:class: [@(0.0.255) class][@0 _Image_:_][@(0.0.255) public][@0 _][@3 AssignValueTyp
eNo][@0 <_Image, ][@3 150][@0 , ][_^Moveable^@0 Moveable][@0 <Image>_>_]&]
[s2;%% Image represents an immutable image value. Image can be directly
painted to Draw. To create or change Image, use [^`:`:ImageBuffer^ ImageBuffer].&]
[s2; Image has low`-cost constant time deep copy. It is moveable
[s2;%% Image has low`-cost constant time deep copy. It is moveable
and Rich`-Value compatible type.&]
[s2; U`+`+ expects pixels to be in premultiplied alpha format.&]
[s2;%% U`+`+ expects pixels to be in premultiplied alpha format.&]
[s0; &]
[s5;K:`:`:Image`:`:operator`~`(`)const:%- [@(0.0.255) const]_[^`:`:RGBA^ RGBA]`*_[@0 operat
or`~]()_[@(0.0.255) const]&]
[s5;%- [@0 operator]_[@(0.0.255) const]_[^`:`:RGBA^ RGBA][@0 `*]()_[@(0.0.255) const]&]
[s2; Returns a pointer to Image pixels.&]
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
[s0; &]
[s5;K:`:`:Image`:`:operator`[`]`(int`)const:%- [@(0.0.255) const]_[^`:`:RGBA^ RGBA]`*_[@0 o
perator`[`]]([@(0.0.255) int]_[@3 i])_[@(0.0.255) const]&]
[s2; Returns a pointer to the first pixel in the line [%-*@3 i].&]
[s0; &]
[s5;K:`:`:Image`:`:GetSize`(`)const:%- [^`:`:Size^ Size]_[@0 GetSize]()_[@(0.0.255) const]&]
[s2; Returns the dimension of Image.&]
[s0; &]
[s5;K:`:`:Image`:`:GetWidth`(`)const:%- [@(0.0.255) int]_[@0 GetWidth]()_[@(0.0.255) const]&]
[s2; Same as GetSize().cx.&]
[s0; &]
[s5;K:`:`:Image`:`:GetHeight`(`)const:%- [@(0.0.255) int]_[@0 GetHeight]()_[@(0.0.255) cons
t]&]
[s2; Same as GetSize().cy.&]
[s0; &]
[s5;K:`:`:Image`:`:GetLength`(`)const:%- [@(0.0.255) int]_[@0 GetLength]()_[@(0.0.255) cons
t]&]
[s2; Number of pixels in Image `- GetWidth() `* GetHeight().&]
[s0; &]
[s5;K:`:`:Image`:`:GetHotSpot`(`)const:%- [^`:`:Point^ Point]_[@0 GetHotSpot]()_[@(0.0.255) c
onst]&]
[s2; Returns the reference point.&]
[s0; &]
[s5;K:`:`:Image`:`:GetDots`(`)const:%- [^`:`:Size^ Size]_[@0 GetDots]()_[@(0.0.255) const]&]
[s2; Gets the physical size of Image. If physical size is not set,
[s5;:Image`:`:operator`~`(`)const: [@(0.0.255) const][@0 _][_^RGBA^@0 RGBA][@(0.0.255) `*][@0 _
operator`~()_][@(0.0.255) const]&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator const RGBA`*`(`)const: operator_const_RGBA`*()_[@(0.0.255) const
]&]
[s2;%% Returns a pointer to Image pixels.&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator`[`]`(int`)const: [@(0.0.255) const][@0 _][_^RGBA^@0 RGBA][@(0.0.255) `*
][@0 _operator`[`](][@(0.0.255) int][@0 _][@3 i][@0 )_][@(0.0.255) const]&]
[s2;%% Returns a pointer to the first pixel in the line [%-*@3 i].&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetSize`(`)const: [_^Size^ Size]_GetSize()_[@(0.0.255) const]&]
[s2;%% Returns the dimension of Image.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetWidth`(`)const: [@(0.0.255) int][@0 _GetWidth()_][@(0.0.255) const]&]
[s2;%% Same as GetSize().cx.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetHeight`(`)const: [@(0.0.255) int][@0 _GetHeight()_][@(0.0.255) const]&]
[s2;%% Same as GetSize().cy.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetLength`(`)const: [@(0.0.255) int][@0 _GetLength()_][@(0.0.255) const]&]
[s2;%% Number of pixels in Image `- GetWidth() `* GetHeight().&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetHotSpot`(`)const: [_^Point^@0 Point][@0 _GetHotSpot()]_[@(0.0.255) const]&]
[s2;%% Returns the reference point.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Get2ndSpot`(`)const: [_^Point^ Point]_Get2ndSpot()_[@(0.0.255) const]&]
[s2;%% Returns secondary reference point.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetDots`(`)const: [_^Size^@0 Size][@0 _GetDots()]_[@(0.0.255) const]&]
[s2;%% Gets the physical size of Image. If physical size is not set,
returns Size(0, 0).&]
[s0; &]
[s5;K:`:`:Image`:`:GetKind`(`)const:%- [@(0.0.255) int]_[@0 GetKind]()_[@(0.0.255) const]&]
[s2; Returns the kind of image. See [^`:`:ImageBuffer^ ImageBuffer]
for detail.&]
[s0; &]
[s5;K:`:`:Image`:`:GetSerialId`(`)const:%- [^`:`:int64^ int64]_[@0 GetSerialId]()_[@(0.0.255) c
onst]&]
[s2; Returns the unique, per application run, identifier of Image.
[s7; &]
[s8; &]
[s5;:Image`:`:GetKindNoScan`(`)const: [@(0.0.255) int][@0 _GetKindNoScan()_][@(0.0.255) con
st]&]
[s2;%% 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.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetKind`(`)const: [@(0.0.255) int][@0 _GetKind()_][@(0.0.255) const]&]
[s2;%% 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.&]
[s7; &]
[s8; &]
[s5;:Image`:`:GetSerialId`(`)const: [_^int64^@0 int64][@0 _GetSerialId()]_[@(0.0.255) const
]&]
[s2;%% 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).&]
[s0; &]
[s5;K:`:`:Image`:`:IsSame`(const`:`:Image`&`)const:%- [@(0.0.255) bool]_[@0 IsSame]([@(0.0.255) c
onst]_[^`:`:Image^ Image]`&_[@3 img])_[@(0.0.255) const]&]
[s2; Same as GetSerialId() `=`= img.GetSerialId().&]
[s0; &]
[s5;K:`:`:Image`:`:operator`=`=`(const`:`:Image`&`)const:%- [@(0.0.255) bool]_[@0 operato
r`=`=]([@(0.0.255) const]_[^`:`:Image^ Image]`&_[@3 img])_[@(0.0.255) const]&]
[s5;K:`:`:Image`:`:operator`=`=`(const`:`:Image`&`)const:%- [@(0.0.255) bool]_[@0 operato
r!`=]([@(0.0.255) const]_[^`:`:Image^ Image]`&_[@3 img])_[@(0.0.255) const]&]
[s2; Tests whether two Images are equal (or not equal). Dimensions,
[s7; &]
[s8; &]
[s5;:Image`:`:IsSame`(const Image`&`)const: [@(0.0.255) bool][@0 _IsSame(][@(0.0.255) const
][@0 _][_^Image^@0 Image][@(0.0.255) `&][@0 _][@3 img][@0 )_][@(0.0.255) const]&]
[s2;%% Same as GetSerialId() `=`= img.GetSerialId().&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator`=`=`(const Image`&`)const: [@(0.0.255) bool][@0 _operator`=`=(][@(0.0.255) c
onst][@0 _][_^Image^@0 Image][@(0.0.255) `&][@0 _][@3 img][@0 )_][@(0.0.255) const]&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator`!`=`(const Image`&`)const: [@(0.0.255) bool][@0 _operator!`=(][@(0.0.255) c
onst][@0 _][_^Image^@0 Image][@(0.0.255) `&][@0 _][@3 img][@0 )_][@(0.0.255) const]&]
[s2;%% Tests whether two Images are equal (or not equal). Dimensions,
hot`-spot, dots and all pixels are compared. Note that the comparison
can be slow.&]
[s0; &]
[s5;K:`:`:Image`:`:GetHashValue`(`)const:%- [^`:`:dword^ dword]_[@0 GetHashValue]()_[@(0.0.255) c
onst]&]
[s2; Returns the hash`-value for image. All pixels combined into
[s7; &]
[s8; &]
[s5;:Image`:`:GetHashValue`(`)const: [_^dword^@0 dword][@0 _GetHashValue()]_[@(0.0.255) con
st]&]
[s2;%% Returns the hash`-value for image. All pixels combined into
hash value (potentially slow).&]
[s0; &]
[s5;K:`:`:Image`:`:ToString`(`)const:%- [^`:`:String^ String]_[@0 ToString]()_[@(0.0.255) c
onst]&]
[s2; Returns the basic Image informations as String.&]
[s0; &]
[s5;K:`:`:Image`:`:Serialize`(`:`:Stream`&`):%- [@(0.0.255) void]_[@0 Serialize]([^`:`:Stream^ S
tream]`&_[@3 s])&]
[s2; Serializes Image.&]
[s0; &]
[s5;K:`:`:Image`:`:Clear`(`):%- [@(0.0.255) void]_[@0 Clear]()&]
[s2; Assigns an empty Image.&]
[s0; &]
[s5;K:`:`:Image`:`:operator`=`(const`:`:Image`&`):%- [^`:`:Image^ Image]`&_[@0 operator`=
]([@(0.0.255) const]_[^`:`:Image^ Image]`&_[@3 img])&]
[s2; Assigns another Image.&]
[s0; &]
[s5;K:`:`:Image`:`:operator`=`(`:`:ImageBuffer`&`):%- [^`:`:Image^ Image]`&_[@0 operator`=
]([^`:`:ImageBuffer^ ImageBuffer]`&_[@3 img])&]
[s2; Assigns Image created in ImageBuffer. ImageBuffer is emptied
[s7; &]
[s8; &]
[s5;:Image`:`:ToString`(`)const: [_^String^@0 String][@0 _ToString()]_[@(0.0.255) const]&]
[s2;%% Returns the basic Image informations as String.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Serialize`(Stream`&`): [@(0.0.255) void][@0 _Serialize(][_^Stream^@0 Stream][@(0.0.255) `&
][@0 _][@3 s][@0 )]&]
[s2;%% Serializes Image.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Clear`(`): [@(0.0.255) void][@0 _Clear()]&]
[s2;%% Assigns an empty Image.&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator`=`(const Image`&`): [_^Image^@0 Image][@(0.0.255) `&][@0 _operator`=
(][@(0.0.255) const][@0 _][_^Image^@0 Image][@(0.0.255) `&][@0 _][@3 img][@0 )]&]
[s2;%% Assigns another Image.&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator`=`(ImageBuffer`&`): [_^Image^@0 Image][@(0.0.255) `&][@0 _operator`=
(][_^ImageBuffer^@0 ImageBuffer][@(0.0.255) `&][@0 _][@3 img][@0 )]&]
[s2;%% Assigns Image created in ImageBuffer. ImageBuffer is emptied
by this operation.&]
[s0; &]
[s5;K:`:`:Image`:`:IsNullInstance`(`)const:%- [@(0.0.255) bool]_[@0 IsNullInstance]()_[@(0.0.255) c
[s7; &]
[s8; &]
[s5;:Image`:`:IsNullInstance`(`)const: [@(0.0.255) bool][@0 _IsNullInstance()_][@(0.0.255) c
onst]&]
[s2; Test whether Image has nonzero dimension.&]
[s0; &]
[s5;K:`:`:Image`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[@0 IsEmpty]()_[@(0.0.255) const]&]
[s2; Same as IsNullInstance.&]
[s0; &]
[s5;K:`:`:Image`:`:operator`:`:Value`(`)const:%- [@0 operator_][^`:`:Value^@0 Value]()_[@(0.0.255) c
onst]&]
[s2; Converts Image to Value.&]
[s0; &]
[s5;K:`:`:Image`:`:`:`:Image`(`):%- [@0 Image]()&]
[s5;%- [@0 Image]([@(0.0.255) const]_[^`:`:Nuller^ Nuller]`&)&]
[s2; Constructs empty Image.&]
[s0; &]
[s5;K:`:`:Image`:`:`:`:Image`(const`:`:Value`&`):%- [@0 Image]([@(0.0.255) const]_[^`:`:Value^ V
alue]`&_[@3 src])&]
[s2; Converts Image from Value.&]
[s0; &]
[s5;K:`:`:Image`:`:`:`:Image`(const`:`:Image`&`):%- [@0 Image]([@(0.0.255) const]_[@0 Image
]`&_[@3 img])&]
[s2; Copy constructor.&]
[s0; &]
[s5;K:`:`:Image`:`:`:`:Image`(`:`:Image`(`*`)`(`)`):%- [@0 Image]([@0 Image]_(`*[@3 fn])())
&]
[s2; 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.&]
[s0; &]
[s5;K:`:`:Image`:`:`:`:Image`(`:`:ImageBuffer`&`):%- [@0 Image]([^`:`:ImageBuffer^ ImageB
uffer]`&_[@3 b])&]
[s2; Uses Image created in ImageBuffer. ImageBuffer is emptied by
this operation.&]
[s0; &]
[s5;K:`:`:Image`:`:`~`:`:Image`(`):%- `~[@0 Image]()&]
[s2; Destructor.&]
[s0; &]
[s0; &]
[s0; [3 Standard cursors]&]
[s0; &]
[s0; Image class contains several standard mouse cursor Images as
static member methods:&]
[s0;^`:`:Image^ &]
[ {{3333:3333:3334f0;g0; [ {{6850:3150>274; [s0;%- Arrow]
:: [s0; ]
:: [s0;%- Wait]
:: [s0; ]
:: [s0;%- IBeam]
:: [s0; ]
:: [s0;%- No]
:: [s0; ]
:: [s0;%- SizeAll]
:: [s0; ]}}]
:: [ {{7129:2871>274; [s0;%- SizeHorz]
:: [s0; ]
:: [s0;%- SizeVert]
:: [s0; ]
:: [s0;%- SizeTopLeft]
:: [s0; ]
:: [s0;%- SizeTop]
:: [s0; ]
:: [s0;%- SizeTopRight]
:: [s0; ]}}]
:: [ {{6956:3044>274; [s0;%- SizeLeft]
:: [s0; ]
:: [s0;%- SizeRight]
:: [s0; ]
:: [s0;%- SizeBottomLeft]
:: [s0; ]
:: [s0;%- SizeBottom]
:: [s0; ]
:: [s0;%- SizeBottomRight]
:: [s0; ]}}]}}&]
[s0;^`:`:Image^ &]
[s0;^`:`:Image^ &]
[s0; &]
[s1;K:`:`:ImageBuffer`:`:class:%- [@(0.0.255) class]_[@0 ImageBuffer]_:_[@(0.0.255) private]_
[^`:`:NoCopy^ NoCopy]&]
[s2; ImageBuffer represents a writable Image `- an array of RGBA
pixels. ImageBuffer can be converted to Image in low`-const constant
time while loosing its content and vice versa, Image can be converted
to ImageBuffer again loosing its content.&]
[s2; &]
[s2; Content of Image / ImageBuffer can be classified to optimize
drawing. Possible classifications are&]
[s2; &]
[ {{2913:7087<288;>640; [s0; [* IMAGE`_UNKNOWN]]
:: [s0; The image kind is unknown.]
:: [s0; [* IMAGE`_EMPTY]]
:: [s0; The image is empty (all alpha values are 0).]
:: [s0; [* IMAGE`_ALPHA]]
:: [s0; The image has alpha values different from 255 and 0.]
:: [s0; [* IMAGE`_MASK]]
:: [s0; The image has alpha values 0 or 255 only.]
:: [s0; [* IMAGE`_OPAQUE]]
:: [s0; The image has all alpha values 255.]}}&]
[s2; &]
[s2; Note that is the kind of image is unknown, painting routine
determines it automatically by scanning pixels and stores the
result.&]
[s2; &]
[s2; Pixels of image are organized in simple continual POD array,
first pixel being top`-left.&]
[s2; &]
[s2; U`+`+ expects pixels to be in premultiplied alpha format.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:SetKind`(int`):%- [@(0.0.255) void]_[@0 SetKind]([@(0.0.255) int]_
[@3 k])&]
[s2; Sets the kind of image. You can use this to avoid automatic
detection.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetKind`(`)const:%- [@(0.0.255) int]_[@0 GetKind]()_[@(0.0.255) co
nst]&]
[s2; Returns the kind of image set by SetKind.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:ScanKind`(`)const:%- [@(0.0.255) int]_[@0 ScanKind]()_[@(0.0.255) c
onst]&]
[s2; Scans all RGBA pixels to determine Image kind.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetScanKind`(`)const:%- [@(0.0.255) int]_[@0 GetScanKind]()_[@(0.0.255) c
onst]&]
[s2; If kind set by SetKind is other than IMAGE`_UNKNOWN, returns
it, otherwise calls ScanKind().&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:SetHotSpot`(`:`:Point`):%- [@(0.0.255) void]_[@0 SetHotSpot]([^`:`:Point^ P
oint]_[@3 p])&]
[s2; Sets the reference point. This point is e.g. used as hot`-spot
when Image is used as mouse pointer.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetHotSpot`(`)const:%- [^`:`:Point^ Point]_[@0 GetHotSpot]()_[@(0.0.255) c
onst]&]
[s2; Returns the reference point.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:SetDots`(`:`:Size`):%- [@(0.0.255) void]_[@0 SetDots]([^`:`:Size^ S
ize]_[@3 sz])&]
[s2; Sets the optional physical size in dots.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetDots`(`)const:%- [^`:`:Size^ Size]_[@0 GetDots]()_[@(0.0.255) c
onst]&]
[s2; Returns the optional physical size. Default value is Size(0,
0).&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetSize`(`)const:%- [^`:`:Size^ Size]_[@0 GetSize]()_[@(0.0.255) c
onst]&]
[s2; Returns the dimensions of image.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetWidth`(`)const:%- [@(0.0.255) int]_[@0 GetWidth]()_[@(0.0.255) c
onst]&]
[s2; Same as GetSize().cx.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetHeight`(`)const:%- [@(0.0.255) int]_[@0 GetHeight]()_[@(0.0.255) c
onst]&]
[s2; Same as GetSize().cy.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:GetLength`(`)const:%- [@(0.0.255) int]_[@0 GetLength]()_[@(0.0.255) c
onst]&]
[s2; Returns the number of pixels in the image. Same as GetSize().cx
`* GetSize().cy.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:operator`[`]`(int`):%- [^`:`:RGBA^ RGBA]_`*[@0 operator`[`]]([@(0.0.255) i
nt]_[@3 i])&]
[s5;K:`:`:ImageBuffer`:`:operator`[`]`(int`)const:%- [@(0.0.255) const]_[^`:`:RGBA^ RGBA]_
`*[@0 operator`[`]]([@(0.0.255) int]_[@3 i])_[@(0.0.255) const]&]
[s2; Returns a pointer to the first pixel in the line [%-*@3 i].&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:operator`~`(`):%- [^`:`:RGBA^ RGBA]_`*[@0 operator`~]()&]
[s5;K:`:`:ImageBuffer`:`:operator`:`:RGBA`*`(`):%- [@0 operator_RGBA]`*()&]
[s5;K:`:`:ImageBuffer`:`:operator`~`(`)const:%- [@(0.0.255) const]_[^`:`:RGBA^ RGBA]_[@0 `*
operator`~]()_[@(0.0.255) const]&]
[s5;K:`:`:ImageBuffer`:`:operator const`:`:RGBA`*`(`)const:%- [@0 operator]_[@(0.0.255) c
onst]_[@0 RGBA`*]()_[@(0.0.255) const]&]
[s2; Returns a pointer to the first pixel of the image. &]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:Create`(int`,int`):%- [@(0.0.255) void]_[@0 Create]([@(0.0.255) in
t]_[@3 cx], [@(0.0.255) int]_[@3 cy])&]
[s5;K:`:`:ImageBuffer`:`:Create`(`:`:Size`):%- [@(0.0.255) void]_[@0 Create]([^`:`:Size^ Si
ze]_[@3 sz])&]
[s2; Creates a new image of specified size. Value of pixels is undefined.
Previous content of ImageBuffer is lost.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:IsEmpty`(`)const:%- [@(0.0.255) bool]_[@0 IsEmpty]()_[@(0.0.255) c
onst]&]
[s2; Same as GetLength() `=`= 0.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:Clear`(`):%- [@(0.0.255) void]_[@0 Clear]()&]
[s2; Clears the content, removing all pixels and setting the size
of Image to Size(0, 0).&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:operator`=`(`:`:Image`&`):%- [@(0.0.255) void]_[@0 operator`=]([^`:`:Image^ I
mage]`&_[@3 img])&]
[s5;K:`:`:ImageBuffer`:`:operator`=`(`:`:ImageBuffer`&`):%- [@(0.0.255) void]_[@0 operato
r`=]([^`:`:ImageBuffer^ ImageBuffer]`&_[@3 img])&]
[s2; Assigns pixels of [%-*@3 img] to ImageBuffer. [%-*@3 img] is cleared
and empty after this operation, price paid for low`-cost constant
time operation.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(`):%- [@0 ImageBuffer]()&]
[s2; Constructs empty ImageBuffer.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(int`,int`):%- [@0 ImageBuffer]([@(0.0.255) int]_
[@3 cx], [@(0.0.255) int]_[@3 cy])&]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(`:`:Size`):%- [@0 ImageBuffer]([^`:`:Size^ Size
]_[@3 sz])&]
[s2; Constructs ImageBuffer of specified size. Value of pixels is
undefined.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(`:`:Image`&`):%- [@0 ImageBuffer]([^`:`:Image^ I
mage]`&_[@3 img])&]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(`:`:ImageBuffer`&`):%- [@0 ImageBuffer]([@0 Ima
geBuffer]`&_[@3 img])&]
[s2; Assigns pixels of [%-*@3 img] to ImageBuffer. [%-*@3 img] is cleared
and empty after this operation, price paid for low`-cost constant
time operation.&]
[s0; &]
[s5;K:`:`:ImageBuffer`:`:`:`:ImageBuffer`(`:`:ImageDraw`&`):%- [@0 ImageBuffer]([^`:`:ImageDraw^ I
mageDraw]`&_[@3 w])&]
[s2; Creates ImageBuffer from ImageDraw. ImageDraw is cleared and
empty after this operation, price paid for low`-cost constant
time operation.&]
[s2; &]
[s0; &]
[s2;%% Test whether Image has nonzero dimension.&]
[s7; &]
[s8; &]
[s5;:Image`:`:IsEmpty`(`)const: [@(0.0.255) bool][@0 _IsEmpty()_][@(0.0.255) const]&]
[s2;%% Same as IsNullInstance.&]
[s7; &]
[s8; &]
[s5;:Image`:`:operator Value`(`)const: [@0 operator_Value()]_[@(0.0.255) const]&]
[s2;%% Converts Image to Value.&]
[s7; &]
[ {{10000t/25b/25@1 [s0; [* Constructor Detail]]}}&]
[s7; &]
[s5;:Image`:`:Image`(`): [@0 Image()]&]
[s7; &]
[s8; &]
[s5;:Image`:`:Image`(const Nuller`&`): [@0 Image(][@(0.0.255) const][@0 _][_^Nuller^@0 Nuller
][@(0.0.255) `&][@0 )]&]
[s2;%% Constructs empty Image.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Image`(const Value`&`): [@0 Image(][@(0.0.255) const][@0 _][_^Value^@0 Value][@(0.0.255) `&
][@0 _][@3 src][@0 )]&]
[s2;%% Converts Image from Value.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Image`(const Image`&`): [@0 Image(][@(0.0.255) const][@0 _Image][@(0.0.255) `&][@0 _
][@3 img][@0 )]&]
[s2;%% Copy constructor.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Image`(Image`(`*`)`(`)`): [@0 Image(Image_(`*fn)())]&]
[s2;%% 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.&]
[s7; &]
[s8; &]
[s5;:Image`:`:Image`(ImageBuffer`&`): [@0 Image(][_^ImageBuffer^@0 ImageBuffer][@(0.0.255) `&
][@0 _][@3 b][@0 )]&]
[s2;%% Uses Image created in ImageBuffer. ImageBuffer is emptied
by this operation.&]
[s2;%% &]
[s7; &]
[ {{10000t/25b/25@1 [s0;%% [* Standard cursors]]}}&]
[s0;%% &]
[s0;%% Image class contains several standard mouse cursor Images
as static member methods:&]
[s0;%% &]
[ {{3333:3333:3334f0;g0; [ {{10000>274; [s0; Arrow]
:: [s0; Wait]
:: [s0; IBeam]
:: [s0; No]
:: [s0; SizeAll]}}]
:: [ {{10000>274; [s0; SizeHorz]
:: [s0; SizeVert]
:: [s0; SizeTopLeft]
:: [s0; SizeTop]
:: [s0; SizeTopRight]}}]
:: [ {{10000>274; [s0; SizeLeft]
:: [s0; SizeRight]
:: [s0; SizeBottomLeft]
:: [s0; SizeBottom]
:: [s0; SizeBottomRight]}}]}}&]
[s0; ]

View file

@ -0,0 +1,178 @@
topic "";
[2 $$0,0#00000000000000000000000000000000:Default]
[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
[l288;2 $$2,2#27521748481378242620020725143825:desc]
[0 $$3,0#96390100711032703541132217272105:end]
[H6;0 $$4,0#05600065144404261032431302351956:begin]
[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
[b42;2 $$9,9#13035079074754324216151401829390:normal]
[{_}
[ {{10000@(113.42.0) [s0;%% [*@7;4 ImageBuffer]]}}&]
[s0;i448;a25;kKO9;@(0.0.255) &]
[s1;:ImageBuffer`:`:class: [*@(0.0.255) class][* _ImageBuffer_:_][*@(0.0.255) private][* _][*@3 N
oCopy]&]
[s2;%% ImageBuffer represents a writable Image `- an array of RGBA
pixels. ImageBuffer can be converted to Image in low`-const constant
time while loosing its content and vice versa, Image can be converted
to ImageBuffer again loosing its content.&]
[s2;%% Content of Image / ImageBuffer can be classified to optimize
drawing. Possible classifications are&]
[s2;%% &]
[ {{2913:7087<288;>640; [s0;%% [* IMAGE`_UNKNOWN]]
:: [s0;%% The image kind is unknown.]
:: [s0;%% [* IMAGE`_EMPTY]]
:: [s0;%% The image is empty (all alpha values are 0).]
:: [s0;%% [* IMAGE`_ALPHA]]
:: [s0;%% The image has alpha values different from 255 and 0.]
:: [s0;%% [* IMAGE`_MASK]]
:: [s0;%% The image has alpha values 0 or 255 only.]
:: [s0;%% [* IMAGE`_OPAQUE]]
:: [s0;%% The image has all alpha values 255.]}}&]
[s2;%% &]
[s2;%% Note that is the kind of image is unknown, painting routine
determines it automatically by scanning pixels and stores the
result.&]
[s2;%% &]
[s2;%% Pixels of image are organized in simple continual POD array,
first pixel being top`-left.&]
[s2;%% U`+`+ expects pixels to be in premultiplied alpha format.&]
[s0; &]
[ {{10000F(128)G(128)@1 [s0;%% [* Public Member List]]}}&]
[s4;H0; &]
[s5;:ImageBuffer`:`:SetKind`(int`): [*@(0.0.255) void][* _SetKind(][*@(0.0.255) int][* _][*@3 k
][* )]&]
[s2;%% Sets the kind of image. You can use this to avoid automatic
detection.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetKind`(`)const: [*@(0.0.255) int][* _GetKind()_][*@(0.0.255) const]&]
[s2;%% Returns the kind of image set by SetKind.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:ScanKind`(`)const: [*@(0.0.255) int][* _ScanKind()_][*@(0.0.255) const]&]
[s2;%% Scans all RGBA pixels to determine Image kind.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetScanKind`(`)const: [*@(0.0.255) int][* _GetScanKind()_][*@(0.0.255) c
onst]&]
[s2;%% If kind set by SetKind is other than IMAGE`_UNKNOWN, returns
it, otherwise calls ScanKind().&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:SetHotSpot`(Point`): [*@(0.0.255) void][* _SetHotSpot(][*_^Point^ Point
][* _][*@3 p][* )]&]
[s2;%% Sets the reference point. This point is e.g. used as hot`-spot
when Image is used as mouse pointer. Iml designer has the ability
to specify this point.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetHotSpot`(`)const: [*_^Point^ Point][* _GetHotSpot()_][*@(0.0.255) co
nst]&]
[s2;%% Returns the reference point.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:Set2ndSpot`(Point`): [@(0.0.255) void]_[* Set2ndSpot]([_^Point^ Point]_
[*@3 p])&]
[s2;%% Sets secondary reference point. Iml designer has the ability
to specify this point.&]
[s3;%% &]
[s4; &]
[s5;:ImageBuffer`:`:Get2ndSpot`(`)const: [_^Point^ Point]_[* Get2ndSpot]()_[@(0.0.255) cons
t]&]
[s2;%% Reads secondary reference point.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:SetDots`(Size`): [*@(0.0.255) void][* _SetDots(][*_^Size^ Size][* _][*@3 sz
][* )]&]
[s2;%% Sets the optional physical size in dots.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetDots`(`)const: [*_^Size^ Size][* _GetDots()_][*@(0.0.255) const]&]
[s2;%% Returns the optional physical size. Default value is Size(0,
0).&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetSize`(`)const: [*_^Size^ Size][* _GetSize()_][*@(0.0.255) const]&]
[s2;%% Returns the dimensions of image.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetWidth`(`)const: [*@(0.0.255) int][* _GetWidth()_][*@(0.0.255) const]&]
[s2;%% Same as GetSize().cx.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetHeight`(`)const: [*@(0.0.255) int][* _GetHeight()_][*@(0.0.255) cons
t]&]
[s2;%% Same as GetSize().cy.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:GetLength`(`)const: [*@(0.0.255) int][* _GetLength()_][*@(0.0.255) cons
t]&]
[s2;%% Returns the number of pixels in the image. Same as GetSize().cx
`* GetSize().cy.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:operator`[`]`(int`): [*_^RGBA^ RGBA][* _`*operator`[`](][*@(0.0.255) in
t][* _][*@3 i][* )]&]
[s5;:ImageBuffer`:`:operator`[`]`(int`)const: [*@(0.0.255) const][* _][*_^RGBA^ RGBA][* _`*op
erator`[`](][*@(0.0.255) int][* _][*@3 i][* )_][*@(0.0.255) const]&]
[s2;%% Returns a pointer to the first pixel in the line [%-*@3 i].&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:operator`~`(`): [*_^RGBA^ RGBA][* _`*operator`~()]&]
[s5;:ImageBuffer`:`:operator RGBA`*`(`): [* operator_RGBA`*()]&]
[s5;:ImageBuffer`:`:operator`~`(`)const: [*@(0.0.255) const][* _][*_^RGBA^ RGBA][* _`*operato
r`~()_][*@(0.0.255) const]&]
[s5;:ImageBuffer`:`:operator const RGBA`*`(`)const: [* operator_const_RGBA`*()_][*@(0.0.255) c
onst]&]
[s2;%% Returns a pointer to the first pixel of the image. &]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:Create`(int`,int`): [*@(0.0.255) void][* _Create(][*@(0.0.255) int][* _][*@3 c
x][* , ][*@(0.0.255) int][* _][*@3 cy][* )]&]
[s5;:ImageBuffer`:`:Create`(Size`): [*@(0.0.255) void][* _Create(][*_^Size^ Size][* _][*@3 sz][* )
]&]
[s2;%% Creates a new image of specified size. Value of pixels is
undefined. Previous content of ImageBuffer is lost.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:IsEmpty`(`)const: [*@(0.0.255) bool][* _IsEmpty()_][*@(0.0.255) const]&]
[s2;%% Same as GetLength() `=`= 0.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:Clear`(`): [*@(0.0.255) void][* _Clear()]&]
[s2;%% Clears the content, removing all pixels and setting the size
of Image to Size(0, 0).&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:operator`=`(Image`&`): [*@(0.0.255) void][* _operator`=(][*_^Image^ Ima
ge][*@(0.0.255) `&][* _][*@3 img][* )]&]
[s5;:ImageBuffer`:`:operator`=`(ImageBuffer`&`): [*@(0.0.255) void][* _operator`=(][*_^ImageBuffer^ I
mageBuffer][*@(0.0.255) `&][* _][*@3 img][* )]&]
[s2;%% Assigns pixels of [%-*@3 img] to ImageBuffer. [%-*@3 img] is cleared
and empty after this operation, price paid for low`-cost constant
time operation.&]
[s3; &]
[ {{10000t/25b/25@1 [s0; [* Constructor Detail]]}}&]
[s4;H0; &]
[s5;:ImageBuffer`:`:ImageBuffer`(`): [* ImageBuffer]()&]
[s2;%% Constructs empty ImageBuffer.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:ImageBuffer`(int`,int`): [* ImageBuffer(][*@(0.0.255) int][* _][*@3 cx][* ,
][*@(0.0.255) int][* _][*@3 cy][* )]&]
[s5;:ImageBuffer`:`:ImageBuffer`(Size`): [* ImageBuffer(][*_^Size^ Size][* _][*@3 sz][* )]&]
[s2;%% Constructs ImageBuffer of specified size. Value of pixels
is undefined.&]
[s3; &]
[s4; &]
[s5;:ImageBuffer`:`:ImageBuffer`(Image`&`): [* ImageBuffer]([_^Image^ Image][@(0.0.255) `&]_
[*@3 img])&]
[s5;:ImageBuffer`:`:ImageBuffer`(ImageBuffer`&`): [* ImageBuffer]([* ImageBuffer][@(0.0.255) `&
]_[*@3 img])&]
[s2;%% Assigns pixels of [%-*@3 img] to ImageBuffer. [%-*@3 img] is cleared
and empty after this operation, price paid for low`-cost constant
time operation.&]
[s0; ]