~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to components/aggpas/src/pf_abgr32.inc

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
//
2
 
// AggPas 2.4 RM3 pixel format definition file
3
 
//
4
 
{ blend_pix_abgr }
5
 
procedure blend_pix_abgr(p : unsigned_ptr; cr ,cg ,cb ,alpha : int; cover : unsigned = 0 );
6
 
var
7
 
 r ,g ,b ,a : int8u;
8
 
 
9
 
begin
10
 
 r:=order_abgr(p^ ).R;
11
 
 g:=order_abgr(p^ ).G;
12
 
 b:=order_abgr(p^ ).B;
13
 
 a:=order_abgr(p^ ).A;
14
 
 
15
 
 order_abgr(p^ ).R:=((cr - r ) * alpha + (r shl base_shift ) ) shr base_shift;
16
 
 order_abgr(p^ ).G:=((cg - g ) * alpha + (g shl base_shift ) ) shr base_shift;
17
 
 order_abgr(p^ ).B:=((cb - b ) * alpha + (b shl base_shift ) ) shr base_shift;
18
 
 order_abgr(p^ ).A:=(alpha + a ) - ((alpha * a + base_mask ) shr base_shift );
19
 
 
20
 
end;
21
 
 
22
 
{ copy_or_blend_pix_abgr }
23
 
procedure copy_or_blend_pix_abgr(p : unsigned_ptr; cr ,cg ,cb ,alpha : unsigned ); overload;
24
 
begin
25
 
 if alpha <> 0 then
26
 
  if alpha = base_mask then
27
 
   begin
28
 
    order_abgr(p^ ).R:=cr;
29
 
    order_abgr(p^ ).G:=cg;
30
 
    order_abgr(p^ ).B:=cb;
31
 
    order_abgr(p^ ).A:=base_mask;
32
 
 
33
 
   end
34
 
  else
35
 
   blend_pix_abgr(p ,cr ,cg ,cb ,alpha );
36
 
 
37
 
end;
38
 
 
39
 
{ copy_or_blend_pix_abgr }
40
 
procedure copy_or_blend_pix_abgr(p : unsigned_ptr; cr ,cg ,cb ,alpha ,cover : unsigned ); overload;
41
 
begin
42
 
 if cover = 255 then
43
 
  copy_or_blend_pix_abgr(p ,cr ,cg ,cb ,alpha )
44
 
 else
45
 
  if alpha <> 0 then
46
 
   begin
47
 
    alpha:=(alpha * (cover + 1 ) ) shr 8;
48
 
 
49
 
    if alpha = base_mask then
50
 
     begin
51
 
      order_abgr(p^ ).R:=cr;
52
 
      order_abgr(p^ ).G:=cg;
53
 
      order_abgr(p^ ).B:=cb;
54
 
      order_abgr(p^ ).A:=base_mask;
55
 
 
56
 
     end
57
 
    else
58
 
     blend_pix_abgr(p ,cr ,cg ,cb ,alpha ,cover );
59
 
 
60
 
   end;
61
 
 
62
 
end;
63
 
 
64
 
{ abgr32_copy_pixel }
65
 
procedure abgr32_copy_pixel(this : pixel_formats_ptr; x ,y : int; c : aggclr_ptr );
66
 
var
67
 
 p : unsigned_ptr;
68
 
 
69
 
begin
70
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
71
 
 
72
 
 order_abgr(p^ ).R:=c.r;
73
 
 order_abgr(p^ ).G:=c.g;
74
 
 order_abgr(p^ ).B:=c.b;
75
 
 order_abgr(p^ ).A:=c.a;
76
 
 
77
 
end;
78
 
 
79
 
{ abgr32_blend_pixel }
80
 
procedure abgr32_blend_pixel(this : pixel_formats_ptr; x ,y : int; c : aggclr_ptr; cover : int8u );
81
 
begin
82
 
 copy_or_blend_pix_abgr(
83
 
  unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) ) ,
84
 
  c.r ,c.g ,c.b ,c.a ,cover );
85
 
 
86
 
end;
87
 
 
88
 
{ abgr32_pixel }
89
 
function abgr32_pixel(this : pixel_formats_ptr; x ,y : int ) : aggclr;
90
 
var
91
 
 p : unsigned_ptr;
92
 
 
93
 
begin
94
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
95
 
 
96
 
 result.ConstrInt(
97
 
  order_abgr(p^ ).R ,
98
 
  order_abgr(p^ ).G ,
99
 
  order_abgr(p^ ).B ,
100
 
  order_abgr(p^ ).A );
101
 
 
102
 
end;
103
 
 
104
 
{ abgr32_copy_hline }
105
 
procedure abgr32_copy_hline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr );
106
 
var
107
 
 p : int8u_ptr;
108
 
 v : unsigned;
109
 
 
110
 
begin
111
 
 p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
112
 
 
113
 
 order_abgr(v ).R:=c.r;
114
 
 order_abgr(v ).G:=c.g;
115
 
 order_abgr(v ).B:=c.b;
116
 
 order_abgr(v ).A:=c.a;
117
 
 
118
 
 if len > 0 then
119
 
  repeat
120
 
   unsigned(pointer(p )^ ):=v;
121
 
 
122
 
   inc(ptrcomp(p ) ,4 );
123
 
   dec(len );
124
 
 
125
 
  until len = 0;
126
 
 
127
 
end;
128
 
 
129
 
{ abgr32_copy_vline }
130
 
procedure abgr32_copy_vline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr );
131
 
var
132
 
 p : unsigned_ptr;
133
 
 v : unsigned;
134
 
 
135
 
begin
136
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
137
 
 
138
 
 order_abgr(v ).R:=c.r;
139
 
 order_abgr(v ).G:=c.g;
140
 
 order_abgr(v ).B:=c.b;
141
 
 order_abgr(v ).A:=c.a;
142
 
 
143
 
 if len > 0 then
144
 
  repeat
145
 
   p^:=v;
146
 
   p :=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
147
 
 
148
 
   dec(len );
149
 
 
150
 
  until len = 0;
151
 
 
152
 
end;
153
 
 
154
 
{ abgr32_blend_hline }
155
 
procedure abgr32_blend_hline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; cover : int8u );
156
 
var
157
 
 p : unsigned_ptr;
158
 
 v : unsigned;
159
 
 
160
 
 alpha : unsigned;
161
 
 
162
 
begin
163
 
 if c.a <> 0 then
164
 
  begin
165
 
   p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
166
 
 
167
 
   alpha:=(c.a * (cover + 1 ) ) shr 8;
168
 
 
169
 
   if alpha = base_mask then
170
 
    begin
171
 
     order_abgr(v ).R:=c.r;
172
 
     order_abgr(v ).G:=c.g;
173
 
     order_abgr(v ).B:=c.b;
174
 
     order_abgr(v ).A:=c.a;
175
 
 
176
 
     repeat
177
 
      p^:=v;
178
 
 
179
 
      inc(ptrcomp(p ) ,sizeof(unsigned ) );
180
 
      dec(len );
181
 
 
182
 
     until len = 0;
183
 
 
184
 
    end
185
 
   else
186
 
    if cover = 255 then
187
 
     repeat
188
 
      blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha );
189
 
 
190
 
      inc(ptrcomp(p ) ,sizeof(unsigned ) );
191
 
      dec(len );
192
 
 
193
 
     until len = 0
194
 
    else
195
 
     repeat
196
 
      blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha ,cover );
197
 
 
198
 
      inc(ptrcomp(p ) ,sizeof(unsigned ) );
199
 
      dec(len );
200
 
 
201
 
     until len = 0;
202
 
 
203
 
  end;
204
 
 
205
 
end;
206
 
 
207
 
{ abgr32_blend_vline }
208
 
procedure abgr32_blend_vline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; cover : int8u );
209
 
var
210
 
 p : unsigned_ptr;
211
 
 v : unsigned;
212
 
 
213
 
 alpha : unsigned;
214
 
 
215
 
begin
216
 
 if c.a <> 0 then
217
 
  begin
218
 
   p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
219
 
 
220
 
   alpha:=(c.a * (cover + 1 ) ) shr 8;
221
 
 
222
 
   if alpha = base_mask then
223
 
    begin
224
 
     order_abgr(v ).R:=c.r;
225
 
     order_abgr(v ).G:=c.g;
226
 
     order_abgr(v ).B:=c.b;
227
 
     order_abgr(v ).A:=c.a;
228
 
 
229
 
     repeat
230
 
      p^:=v;
231
 
      p :=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
232
 
 
233
 
     until len = 0;
234
 
 
235
 
    end
236
 
   else
237
 
    if cover = 255 then
238
 
     repeat
239
 
      blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha );
240
 
 
241
 
      p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
242
 
 
243
 
      dec(len );
244
 
 
245
 
     until len = 0
246
 
    else
247
 
     repeat
248
 
      blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha ,cover );
249
 
 
250
 
      p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
251
 
 
252
 
      dec(len );
253
 
 
254
 
     until len = 0;
255
 
 
256
 
  end;
257
 
 
258
 
end;
259
 
 
260
 
{ abgr32_blend_solid_hspan }
261
 
procedure abgr32_blend_solid_hspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; covers : int8u_ptr );
262
 
var
263
 
 p : unsigned_ptr;
264
 
 
265
 
 alpha : unsigned;
266
 
 
267
 
begin
268
 
 if c.a <> 0 then
269
 
  begin
270
 
   p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
271
 
 
272
 
   repeat
273
 
    alpha:=(c.a * (covers^ + 1 ) ) shr 8;
274
 
 
275
 
    if alpha = base_mask then
276
 
     begin
277
 
      order_abgr(p^ ).R:=c.r;
278
 
      order_abgr(p^ ).G:=c.g;
279
 
      order_abgr(p^ ).B:=c.b;
280
 
      order_abgr(p^ ).A:=base_mask;
281
 
 
282
 
     end
283
 
    else
284
 
     blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha ,covers^ );
285
 
 
286
 
    inc(ptrcomp(p ) ,4 );
287
 
    inc(ptrcomp(covers ) );
288
 
 
289
 
    dec(len );
290
 
 
291
 
   until len = 0;
292
 
 
293
 
  end;
294
 
 
295
 
end;
296
 
 
297
 
{ abgr32_blend_solid_vspan }
298
 
procedure abgr32_blend_solid_vspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; covers : int8u_ptr );
299
 
var
300
 
 p : unsigned_ptr;
301
 
 
302
 
 alpha : unsigned;
303
 
 
304
 
begin
305
 
 if c.a <> 0 then
306
 
  begin
307
 
   p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
308
 
 
309
 
   repeat
310
 
    alpha:=(c.a * (covers^ + 1 ) ) shr 8;
311
 
 
312
 
    if alpha = base_mask then
313
 
     begin
314
 
      order_abgr(p^ ).R:=c.r;
315
 
      order_abgr(p^ ).G:=c.g;
316
 
      order_abgr(p^ ).B:=c.b;
317
 
      order_abgr(p^ ).A:=base_mask;
318
 
 
319
 
     end
320
 
    else
321
 
     blend_pix_abgr(p ,c.r ,c.g ,c.b ,alpha ,covers^ );
322
 
 
323
 
    p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
324
 
 
325
 
    inc(ptrcomp(covers ) ,sizeof(int8u ) );
326
 
    dec(len );
327
 
 
328
 
   until len = 0;
329
 
 
330
 
  end;
331
 
 
332
 
end;
333
 
 
334
 
{ abgr32_blend_color_hspan }
335
 
procedure abgr32_blend_color_hspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr; covers : int8u_ptr; cover : int8u );
336
 
var
337
 
 p : unsigned_ptr;
338
 
 
339
 
begin
340
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
341
 
 
342
 
 if covers <> NIL then
343
 
  repeat
344
 
   copy_or_blend_pix_abgr(p ,colors.r ,colors.g ,colors.b ,colors.a ,covers^ );
345
 
 
346
 
   inc(ptrcomp(covers ) ,sizeof(int8u ) );
347
 
   inc(ptrcomp(p ) ,4 );
348
 
   inc(ptrcomp(colors ) ,sizeof(aggclr ) );
349
 
   dec(len );
350
 
 
351
 
  until len = 0
352
 
 else
353
 
  if cover = 255 then
354
 
   repeat
355
 
    copy_or_blend_pix_abgr(p ,colors.r ,colors.g ,colors.b ,colors.a );
356
 
 
357
 
    inc(ptrcomp(p ) ,4 );
358
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
359
 
    dec(len );
360
 
 
361
 
   until len = 0
362
 
  else
363
 
   repeat
364
 
    copy_or_blend_pix_abgr(p ,colors.r ,colors.g ,colors.b ,colors.a ,cover );
365
 
 
366
 
    inc(ptrcomp(p ) ,4 );
367
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
368
 
    dec(len );
369
 
    
370
 
   until len = 0;
371
 
 
372
 
end;
373
 
 
374
 
{ abgr32_blend_color_vspan }
375
 
procedure abgr32_blend_color_vspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr; covers : int8u_ptr; cover : int8u );
376
 
var
377
 
 p : unsigned_ptr;
378
 
 
379
 
begin
380
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
381
 
 
382
 
 if covers <> NIL then
383
 
  repeat
384
 
   copy_or_blend_pix_abgr(
385
 
    p ,
386
 
    colors.r ,
387
 
    colors.g ,
388
 
    colors.b ,
389
 
    colors.a ,
390
 
    covers^ );
391
 
 
392
 
   inc(ptrcomp(covers ) ,sizeof(int8u ) );
393
 
 
394
 
   p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
395
 
 
396
 
   inc(ptrcomp(colors ) ,sizeof(aggclr ) );
397
 
   dec(len );
398
 
 
399
 
  until len = 0
400
 
 else
401
 
  if cover = 255 then
402
 
   repeat
403
 
    copy_or_blend_pix_abgr(
404
 
     p ,
405
 
     colors.r ,
406
 
     colors.g ,
407
 
     colors.b ,
408
 
     colors.a );
409
 
 
410
 
    p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
411
 
 
412
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
413
 
    dec(len );
414
 
 
415
 
   until len = 0
416
 
  else
417
 
   repeat
418
 
    copy_or_blend_pix_abgr(
419
 
     p ,
420
 
     colors.r ,
421
 
     colors.g ,
422
 
     colors.b ,
423
 
     colors.a ,
424
 
     cover );
425
 
 
426
 
    p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
427
 
 
428
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
429
 
    dec(len );
430
 
 
431
 
   until len = 0;
432
 
 
433
 
end;
434
 
 
435
 
{ abgr32_blend_from }
436
 
procedure abgr32_blend_from(this : pixel_formats_ptr; from : pixel_formats_ptr; psrc_ : int8u_ptr; xdst ,ydst ,xsrc ,ysrc : int; len : unsigned; cover : int8u );
437
 
var
438
 
 psrc ,pdst : unsigned_ptr;
439
 
 
440
 
 incp : int;
441
 
 
442
 
begin
443
 
 psrc:=unsigned_ptr(psrc_ );
444
 
 pdst:=unsigned_ptr(ptrcomp(this.m_rbuf.row(ydst ) ) + (xdst shl 2 ) * sizeof(int8u ) );
445
 
 incp:=4;
446
 
 
447
 
 if ptrcomp(xdst ) > ptrcomp(xsrc ) then
448
 
  begin
449
 
   inc(ptrcomp(psrc ) ,((len - 1 ) shl 2 ) * sizeof(int8u ) );
450
 
   inc(ptrcomp(pdst ) ,((len - 1 ) shl 2 ) * sizeof(int8u ) );
451
 
 
452
 
   incp:=-4;
453
 
 
454
 
  end;
455
 
 
456
 
 if cover = 255 then
457
 
  repeat
458
 
   copy_or_blend_pix_abgr(
459
 
    pdst ,
460
 
    order_abgr(psrc^ ).R ,
461
 
    order_abgr(psrc^ ).G ,
462
 
    order_abgr(psrc^ ).B ,
463
 
    order_abgr(psrc^ ).A );
464
 
 
465
 
   inc(ptrcomp(psrc ) ,incp );
466
 
   inc(ptrcomp(pdst ) ,incp );
467
 
   dec(len );
468
 
 
469
 
  until len = 0
470
 
 else
471
 
  repeat
472
 
   copy_or_blend_pix_abgr(
473
 
    pdst ,
474
 
    order_abgr(psrc^ ).R ,
475
 
    order_abgr(psrc^ ).G ,
476
 
    order_abgr(psrc^ ).B ,
477
 
    order_abgr(psrc^ ).A ,
478
 
    cover );
479
 
 
480
 
   inc(ptrcomp(psrc ) ,incp );
481
 
   inc(ptrcomp(pdst ) ,incp );
482
 
   dec(len );
483
 
 
484
 
  until len = 0;
485
 
 
486
 
end;
487
 
 
488
 
{ abgr32_copy_color_hspan }
489
 
procedure abgr32_copy_color_hspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr );
490
 
var
491
 
 p : unsigned_ptr;
492
 
 
493
 
begin
494
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
495
 
 
496
 
 repeat
497
 
  order_abgr(pointer(p )^ ).R:=colors.r;
498
 
  order_abgr(pointer(p )^ ).G:=colors.g;
499
 
  order_abgr(pointer(p )^ ).B:=colors.b;
500
 
  order_abgr(pointer(p )^ ).A:=colors.a;
501
 
 
502
 
  inc(ptrcomp(colors ) ,sizeof(aggclr ) );
503
 
  inc(ptrcomp(p ) ,4 );
504
 
  dec(len );
505
 
 
506
 
 until len = 0;
507
 
 
508
 
end;
509
 
 
510
 
{ abgr32_copy_color_vspan }
511
 
procedure abgr32_copy_color_vspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr );
512
 
var
513
 
 p : unsigned_ptr;
514
 
 
515
 
begin
516
 
 p:=unsigned_ptr(ptrcomp(this.m_rbuf.row(y ) ) + (x shl 2 ) );
517
 
 
518
 
 repeat
519
 
  order_abgr(pointer(p )^ ).R:=colors.r;
520
 
  order_abgr(pointer(p )^ ).G:=colors.g;
521
 
  order_abgr(pointer(p )^ ).B:=colors.b;
522
 
  order_abgr(pointer(p )^ ).A:=colors.a;
523
 
 
524
 
  p:=unsigned_ptr(this.m_rbuf.next_row(int8u_ptr(p ) ) );
525
 
 
526
 
  inc(ptrcomp(colors ) ,sizeof(aggclr ) );
527
 
  dec(len );
528
 
 
529
 
 until len = 0;
530
 
 
531
 
end;
532
 
 
533
 
{ abgr32_blend_from_color }
534
 
procedure abgr32_blend_from_color(this : pixel_formats_ptr; from : pixel_formats_ptr; color : aggclr_ptr; xdst ,ydst ,xsrc ,ysrc : int; len : unsigned; cover : int8u );
535
 
var
536
 
 ppsz : unsigned;
537
 
 
538
 
 psrc : int8u_ptr;
539
 
 pdst : unsigned_ptr;
540
 
 
541
 
begin
542
 
 ppsz:=from._pix_width;
543
 
 psrc:=from.row_ptr(ysrc );
544
 
 
545
 
 if psrc <> NIL then
546
 
  begin
547
 
   pdst:=unsigned_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + (xdst shl 2 ) );
548
 
 
549
 
   repeat
550
 
    copy_or_blend_pix_abgr(
551
 
     pdst ,color.r, color.g, color.b, color.a,
552
 
     shr_int32(psrc^ * cover + base_mask ,base_shift ) );
553
 
 
554
 
    inc(ptrcomp(psrc ) ,ppsz );
555
 
    inc(ptrcomp(pdst ) ,4 );
556
 
    dec(len );
557
 
 
558
 
   until len = 0;
559
 
 
560
 
  end;
561
 
 
562
 
end;
563
 
 
564
 
{ abgr32_blend_from_lut }
565
 
procedure abgr32_blend_from_lut(this : pixel_formats_ptr; from : pixel_formats_ptr; color_lut : aggclr_ptr; xdst ,ydst ,xsrc ,ysrc : int; len : unsigned; cover : int8u );
566
 
var
567
 
 ppsz : unsigned;
568
 
 
569
 
 psrc : int8u_ptr;
570
 
 pdst : unsigned_ptr;
571
 
 
572
 
 color : aggclr_ptr;
573
 
 
574
 
begin
575
 
 ppsz:=from._pix_width;
576
 
 psrc:=from.row_ptr(ysrc );
577
 
 
578
 
 if psrc <> NIL then
579
 
  begin
580
 
   pdst:=unsigned_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + (xdst shl 2 ) );
581
 
 
582
 
   if cover = 255 then
583
 
    repeat
584
 
     color:=aggclr_ptr(ptrcomp(color_lut ) + psrc^ * sizeof(aggclr ) );
585
 
 
586
 
     copy_or_blend_pix_abgr(pdst ,color.r, color.g, color.b, color.a );
587
 
 
588
 
     inc(ptrcomp(psrc ) ,ppsz );
589
 
     inc(ptrcomp(pdst ) ,4 );
590
 
     dec(len );
591
 
 
592
 
    until len = 0
593
 
   else
594
 
    repeat
595
 
     color:=aggclr_ptr(ptrcomp(color_lut ) + psrc^ * sizeof(aggclr ) );
596
 
 
597
 
     copy_or_blend_pix_abgr(pdst ,color.r, color.g, color.b, color.a ,cover );
598
 
 
599
 
     inc(ptrcomp(psrc ) ,ppsz );
600
 
     inc(ptrcomp(pdst ) ,4 );
601
 
     dec(len );
602
 
 
603
 
    until len = 0;
604
 
 
605
 
  end;
606
 
 
607
 
end;
608