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

« back to all changes in this revision

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