1topic "Raster";
2[i448;a25;kKO9;2 $$1,0#37138531426314131252341829483380:class]
3[l288;2 $$2,2#27521748481378242620020725143825:desc]
4[0 $$3,0#96390100711032703541132217272105:end]
5[H6;0 $$4,0#05600065144404261032431302351956:begin]
6[i448;a25;kKO9;2 $$5,0#37138531426314131252341829483370:item]
7[l288;a4;*@5;1 $$6,6#70004532496200323422659154056402:requirement]
8[l288;i1121;b17;O9;~~~.1408;2 $$7,0#10431211400427159095818037425705:param]
9[i448;b42;O9;2 $$8,8#61672508125594000341940100500538:tparam]
10[b42;2 $$9,9#13035079074754324216151401829390:normal]
11[2 $$0,0#00000000000000000000000000000000:Default]
12[{_}
13[ {{10000@(113.42.0) [s0;%% [*@7;4 Raster]]}}&]
14[s3; &]
15[s1;:Raster`:`:class: [@(0.0.255)3 class][3 _][*3 Raster]&]
16[s9;%% Raster is an abstract class representing raster image. Example
17of Raster derived classes is PngRaster, that serves as .png image
18file decoder or MemoryRaster, that represent image in memory
19that can be in specific format (not RGBA).&]
20[s9;%% Raster provides basic information about image (GetSize and
21GetInfo returning Raster`::Info) and is a source of image scanlines.
22Scanlines are returned as Raster`::Line objects. If possible,
23Raster derived classes should attempt to minimize memory requirements.
24For example, PngRaster only fetches individual scanline from
25the file at time, if possible.&]
26[s3; &]
27[s0; &]
28[ {{10000F(128)G(128)@1 [s0;%% [* Raster`::Line]]}}&]
29[s3; &]
30[s1;:Raster`:`:Line`:`:class: [@(0.0.255)3 class][3 _][*3 Raster`::Line]&]
31[s2;%% This class represents a single scanline in the raster. For
32performance reasons, it uses [^topic`:`/`/Core`/srcdoc`/pick`_`$en`-us^ pick
33transfer semantics]. As is can be used both is situations where
34referenced data are stored in Raster or in situations where they
35need custom storage, constructors have `'free`' parameter. Scanline
36can be represented in format of Raster or as RGBA array. Conversion
37to RGBA array is lazy `- does not happen until it is needed.&]
38[s2;%% &]
39[s2;%% Note that Line is only valid as long as its source Raster
40exists.&]
41[s2;%% &]
42[s2;%% For convenience, this class is also typedefed as RasterLine.&]
43[s3; &]
44[s0; &]
45[ {{10000F(128)G(128)@1 [s0;%% [* Raster`::Line Public Method List]]}}&]
46[s3; &]
47[s5;:Raster`:`:Line`:`:GetRGBA`(`)const: [@(0.0.255) const]_[_^RGBA^ RGBA]_`*[* GetRGBA]()_
48[@(0.0.255) const]&]
49[s2;%% Returns a pointer to array with scanline pixels. Conversion
50of Raster format to RGBA buffer is lazy, does not happen before
51this function is called for the first time. Also, if Raster format
52is RGBA, no conversion is performed and pointer to raw data is
53returned.&]
54[s3; &]
55[s4; &]
56[s5;:Raster`:`:Line`:`:GetRawData`(`)const: [@(0.0.255) const]_[_^byte^ byte]_`*[* GetRawDa
57ta]()_[@(0.0.255) const]&]
58[s2;%% Returns the scanline in Raster format.&]
59[s3; &]
60[s4; &]
61[s5;:Raster`:`:Line`:`:operator const RGBA`*`(`)const: [@(0.0.255) operator]_[@(0.0.255) c
62onst]_[_^RGBA^ RGBA]_`*()_[@(0.0.255) const]&]
63[s5;:Raster`:`:Line`:`:operator`~`(`)const: [@(0.0.255) const]_[_^RGBA^ RGBA]_`*[* operator
64`~]()_[@(0.0.255) const]&]
65[s2;%% Returns GetRGBA().&]
66[s3; &]
67[s0; &]
68[ {{10000F(128)G(128)@1 [s0;%% [* Raster`::Line Constructor detail]]}}&]
69[s3; &]
70[s5;:Raster`:`:Line`:`:Line`(const RGBA`*`,bool`): [* Line]([@(0.0.255) const]_[_^RGBA^ RGB
71A]_`*[*@3 data], [@(0.0.255) bool]_[*@3 free])&]
72[s2;%% Constructs Line from RGBA data. If [%-*@3 free] is true, Line
73destructor deletes the [%-*@3 data] pointer.&]
74[s3;%% &]
75[s4; &]
76[s5;:Raster`:`:Line`:`:Line`(const byte`*`,Raster`*`,bool`): [* Line]([@(0.0.255) const]_
77[_^byte^ byte]_`*[*@3 fmtdata], [_^Raster^ Raster]_`*[*@3 raster], [@(0.0.255) bool]_[*@3 fmt
78free])&]
79[s2;%% Constructs Line from data [%-*@3 fmtdata] in format of [%-*@3 raster].
80If [%-*@3 fmtfree].is true, Line destructor deletes the [%-*@3 fmtdata]
81pointer.&]
82[s3;%% &]
83[s4; &]
84[s5;:Raster`:`:Line`:`:Line`(pick`_ Raster`:`:Line`&`): [* Line]([@(0.128.128) pick`_]_[* L
85ine][@(0.0.255) `&]_[*@3 b])&]
86[s2;%% Pick constructor.&]
87[s3;%% &]
88[s4; &]
89[s5;:Raster`:`:Line`:`:Line`(`): [* Line]()&]
90[s2;%% Default constructor. Default constructed Line can be used
91as target of pick transfer from another Line.&]
92[s3; &]
93[s4; &]
94[s5;:Raster`:`:Line`:`:operator`=`(pick`_ Raster`:`:Line`&`): [@(0.0.255) void]_[* operat
95or`=]([@(0.128.128) pick`_]_[_^Raster`:`:Line^ Line][@(0.0.255) `&]_[*@3 b])&]
96[s2;%% Pick assignment.&]
97[s3;%% &]
98[s1;@(0.0.255)3 &]
99[ {{10000F(128)G(128)@1 [s0;%% [* Raster`::Info]]}}&]
100[s3; &]
101[s1;:Raster`:`:Info`:`:struct: [@(0.0.255)3 struct][3 _][*3 Raster`::Info]&]
102[s2;%% This structure is used to provide the information about Raster.
103For convenience, this class is also typedefed as RasterInfo.&]
104[s3; &]
105[s0; &]
106[ {{10000F(128)G(128)@1 [s0;%% [* Raster`::Line Member Variables]]}}&]
107[s3; &]
108[s5;:Raster`:`:Info`:`:bpp: [@(0.0.255) int]_[* bpp]&]
109[s2;%% Number of bits per pixel. Default value is 24.&]
110[s3; &]
111[s4; &]
112[s5;:Raster`:`:Info`:`:colors: [@(0.0.255) int]_[* colors]&]
113[s2;%% Number of colors. Default value is 16777216.&]
114[s3; &]
115[s4; &]
116[s5;:Raster`:`:Info`:`:dots: [_^Size^ Size]_[* dots]&]
117[s2;%% Physical size of source image, e.g. for scanned images, in
1181/600 inches. Size(0, 0) if not known (default value).&]
119[s3; &]
120[s4; &]
121[s5;:Raster`:`:Info`:`:hotspot: [_^Point^ Point]_[* hotspot]&]
122[s2;%% Hotspot location. If not know or there is none, Point(0, 0)
123(default value).&]
124[s3; &]
125[s4; &]
126[s5;:Raster`:`:Info`:`:kind: [@(0.0.255) int]_[* kind]&]
127[s2;%% The kind of image, one of [* IMAGE`_EMPTY], [* IMAGE`_ALPHA],
128[* IMAGE`_MASK], [* IMAGE`_OPAQUE]. Default value is [* IMAGE`_OPAQUE].&]
129[s3;%% &]
130[s4; &]
131[s5;:Upp`:`:Raster`:`:Info`:`:orientation: [@(0.0.255) int]_[* orientation]&]
132[s2;%% Orientation of image. This is one of FLIP`_NONE, FLIP`_MIRROR`_HORZ,
133FLIP`_ROTATE`_180, FLIP`_MIRROR`_VERT, FLIP`_TRANSPOSE, FLIP`_ROTATE`_CLOCKWISE,
134FLIP`_TRANSVERSE, FLIP`_ROTATE`_ANTICLOCKWISE. This value is
135intended to flip Image to correct orientation (usually JPEG from
136digital camera).&]
137[s3; &]
138[s0; &]
139[ {{10000F(128)G(128)@1 [s0;%% [* Raster public methods]]}}&]
140[s3; &]
141[s5;:Raster`:`:SeekPage`(int`): [@(0.0.255) virtual] [@(0.0.255) void]_[* SeekPage]([@(0.0.255) i
142nt]_[*@3 page])&]
143[s2;%% Provides Raster with ability to handle sources that contain
144more than single image (e.g. animated GIFs). Sets Raster to image
145no [%-*@3 page], first image is 0. Default implementation is empty.&]
146[s3; &]
147[s4;%% &]
148[s5;:Raster`:`:GetPageCount`(`): [@(0.0.255) virtual] [@(0.0.255) int]_[* GetPageCount]()&]
149[s2;%% Returns a number of images in Raster. Default implementation
150returns 1.&]
151[s3;%% &]
152[s4;%% &]
153[s5;:Raster`:`:Create`(`): [@(0.0.255) virtual] [@(0.0.255) bool]_[* Create]()&]
154[s2;%% Called at the beginning of processing of a new raster, e.g.
155used to read file header and get internal variables ready for
156processing. false return value indicates failure.&]
157[s3;%% &]
158[s4;%% &]
159[s5;:Raster`:`:GetSize`(`): [@(0.0.255) virtual] [_^Size^ Size]_[* GetSize]()_`=_[@3 0]&]
160[s2;%% Returns the size of Raster in pixels.&]
161[s3;%% &]
162[s4;%% &]
163[s5;:Raster`:`:GetInfo`(`): [@(0.0.255) virtual] [_^Raster`:`:Info^ Info]_[* GetInfo]()&]
164[s2;%% Returns the information about Raster.&]
165[s3;%% &]
166[s4;%% &]
167[s5;:Raster`:`:GetLine`(int`): [@(0.0.255) virtual] [_^Raster`:`:Line^ Line]_[* GetLine]([@(0.0.255) i
168nt]_[*@3 line])_`=_[@3 0]&]
169[s2;%% Reads a single scanline [%-*@3 line] from the raster. If possible,
170Raster should be optimized for reading scanlines in ascending
171order `- this what most processing functions (should) require.&]
172[s3;%% &]
173[s4;%% &]
174[s5;:Raster`:`:IsError`(`): [@(0.0.255) virtual] [@(0.0.255) bool]_[* IsError]()&]
175[s2; Signals that during the Raster processing, there was an error.
176For example, it can signal that .png file is corrupt.&]
177[s3;%% &]
178[s4;%% &]
179[s5;:Raster`:`:GetPaletteCount`(`): [@(0.0.255) virtual] [@(0.0.255) int]_[* GetPaletteCoun
180t]()&]
181[s2;%% Returns the size of palette for raster. If there is no palette,
182returns 0.&]
183[s3;%% &]
184[s4;%% &]
185[s5;:Raster`:`:GetPalette`(`): [@(0.0.255) virtual] [@(0.0.255) const]_[_^RGBA^ RGBA]_`*[* Ge
186tPalette]()&]
187[s2;%% Returns current palette, NULL if there is no palette.&]
188[s3;%% &]
189[s4;%% &]
190[s5;:Raster`:`:GetFormat`(`): [@(0.0.255) virtual] [@(0.0.255) const]_[_^RasterFormat^ Rast
191erFormat]_`*[* GetFormat]()&]
192[s2;%% Returns the format of Raster, can return NULL if format is
193RGBA.&]
194[s3;%% &]
195[s4;%% &]
196[s5;:Raster`:`:GetWidth`(`): [@(0.0.255) int]_[* GetWidth]()&]
197[s2;%% Same as GetSize().cx.&]
198[s3;%% &]
199[s4;%% &]
200[s5;:Raster`:`:GetHeight`(`): [@(0.0.255) int]_[* GetHeight]()&]
201[s2;%% Same as GetSize().cy.&]
202[s3;%% &]
203[s4;%% &]
204[s5;:Raster`:`:operator`[`]`(int`): [_^Raster`:`:Line^ Line]_[* operator`[`]]([@(0.0.255) i
205nt]_[*@3 i])&]
206[s2;%% Same as GetLine([%-*@3 i]).&]
207[s3;%% &]
208[s4;%% &]
209[s5;:Raster`:`:GetImage`(int`,int`,int`,int`,const Gate2`<int`,int`>`): [_^Image^ Image
210]_[* GetImage]([@(0.0.255) int]_[*@3 x], [@(0.0.255) int]_[*@3 y], [@(0.0.255) int]_[*@3 cx],
211[@(0.0.255) int]_[*@3 cy], [@(0.0.255) const]_[_^Gate2^ Gate2]<[@(0.0.255) int],
212[@(0.0.255) int]>_[*@3 progress]_`=_[@(0.0.255) false])&]
213[s5;:Raster`:`:GetImage`(const Gate2`<int`,int`>`): [_^Image^ Image]_[* GetImage]([@(0.0.255) c
214onst]_[_^Gate2^ Gate2]<[@(0.0.255) int], [@(0.0.255) int]>_[*@3 progress]_`=_[@(0.0.255) fa
215lse])&]
216[s2;%% Converts area [%-*@3 x],[%-*@3 y],[%-*@3 cx],[%-*@3 cy], or the whole
217Rater, to Image. Parameter [%-*@3 progress].can be used to trace
218the progress of operation (first int is current step, second
219is number of step to do) and also to cancel the operation (if
220it returns true; empty Image is returned in that case). Default
221value for the parameter means no progress feedback is provided.&]
222[s3; &]
223[s0; ]]