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

« back to all changes in this revision

Viewing changes to components/aggpas/src/pf_gray8_pre.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_gray_pre }
5
 
procedure blend_pix_gray_pre(p : int8u_ptr; cv ,alpha ,cover : unsigned ); overload;
6
 
begin
7
 
 alpha:=base_mask - alpha;
8
 
 cover:=(cover + 1 ) shl (base_shift - 8 );
9
 
 
10
 
 p^:=int8u((p^ * alpha + cv * cover ) shr base_shift );
11
 
 
12
 
end;
13
 
 
14
 
{ blend_pix_gray_pre }
15
 
procedure blend_pix_gray_pre(p : int8u_ptr; cv ,alpha : unsigned ); overload;
16
 
begin
17
 
 p^:=int8u(((p^ * (base_mask - alpha ) ) shr base_shift ) + cv );
18
 
 
19
 
end;
20
 
 
21
 
{ copy_or_blend_pix_gray_pre }
22
 
procedure copy_or_blend_pix_gray_pre(p : int8u_ptr; c : aggclr_ptr; cover : unsigned ); overload;
23
 
var
24
 
 alpha : unsigned;
25
 
 
26
 
begin
27
 
 if  c.a <> 0 then
28
 
  begin
29
 
   alpha:=(c.a * (cover + 1 ) ) shr 8;
30
 
 
31
 
   if alpha = base_mask then
32
 
    p^:=c.v
33
 
   else
34
 
    blend_pix_gray_pre(p ,c.v ,alpha ,cover );
35
 
 
36
 
  end;
37
 
 
38
 
end;
39
 
 
40
 
{ copy_or_blend_pix_pre }
41
 
procedure copy_or_blend_pix_pre(p : int8u_ptr; c : aggclr_ptr ); overload;
42
 
begin
43
 
 if c.a <> 0 then
44
 
  if c.a = base_mask then
45
 
   p^:=c.v
46
 
  else
47
 
   blend_pix_gray_pre(p ,c.v ,c.a );
48
 
 
49
 
end;
50
 
 
51
 
{ gray8_pre_blend_pixel }
52
 
procedure gray8_pre_blend_pixel(this : pixel_formats_ptr; x ,y : int; c : aggclr_ptr; cover : int8u );
53
 
begin
54
 
 copy_or_blend_pix_gray_pre(
55
 
  int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset ) ,
56
 
  c ,cover );
57
 
 
58
 
end;
59
 
 
60
 
{ gray8_pre_blend_hline }
61
 
procedure gray8_pre_blend_hline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; cover : int8u );
62
 
var
63
 
 p : int8u_ptr;
64
 
 
65
 
 alpha : unsigned;
66
 
 
67
 
begin
68
 
 if c.a <> 0 then
69
 
  begin
70
 
   p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
71
 
 
72
 
   alpha:=(c.a * (cover + 1 ) ) shr 8;
73
 
 
74
 
   if alpha = base_mask then
75
 
    repeat
76
 
     p^:=c.v;
77
 
 
78
 
     inc(ptrcomp(p ) ,this.m_step );
79
 
     dec(len );
80
 
 
81
 
    until len = 0
82
 
   else
83
 
    repeat
84
 
     blend_pix_gray_pre(p ,c.v ,alpha ,cover );
85
 
 
86
 
     inc(ptrcomp(p ) ,this.m_step );
87
 
     dec(len );
88
 
 
89
 
    until len = 0;
90
 
 
91
 
  end;
92
 
 
93
 
end;
94
 
 
95
 
{ gray8_pre_blend_vline }
96
 
procedure gray8_pre_blend_vline(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; cover : int8u );
97
 
var
98
 
 p : int8u_ptr;
99
 
 
100
 
 alpha : unsigned;
101
 
 
102
 
begin
103
 
 if c.a <> 0 then
104
 
  begin
105
 
   p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
106
 
 
107
 
   alpha:=(c.a * (cover + 1 ) ) shr 8;
108
 
 
109
 
   if alpha = base_mask then
110
 
    repeat
111
 
     p^:=c.v;
112
 
     p :=this.m_rbuf.next_row(p );
113
 
 
114
 
     dec(len );
115
 
 
116
 
    until len = 0
117
 
   else
118
 
    repeat
119
 
     blend_pix_gray_pre(p ,c.v ,alpha ,cover );
120
 
 
121
 
     p:=this.m_rbuf.next_row(p );
122
 
 
123
 
     dec(len );
124
 
 
125
 
    until len = 0;
126
 
 
127
 
  end;
128
 
 
129
 
end;
130
 
 
131
 
{ gray8_pre_blend_solid_hspan }
132
 
procedure gray8_pre_blend_solid_hspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; covers : int8u_ptr );
133
 
var
134
 
 p : int8u_ptr;
135
 
 
136
 
 alpha : unsigned;
137
 
 
138
 
begin
139
 
 if c.a <> 0 then
140
 
  begin
141
 
   p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
142
 
 
143
 
   repeat
144
 
    alpha:=(c.a * (covers^ + 1 ) ) shr 8;
145
 
 
146
 
    if alpha = base_mask then
147
 
     p^:=c.v
148
 
    else
149
 
     blend_pix_gray_pre(p ,c.v ,alpha ,covers^ );
150
 
 
151
 
    inc(ptrcomp(p ) ,this.m_step );
152
 
    inc(ptrcomp(covers ) );
153
 
    dec(len );
154
 
 
155
 
   until len = 0;
156
 
 
157
 
  end;
158
 
 
159
 
end;
160
 
 
161
 
{ gray8_pre_blend_solid_vspan }
162
 
procedure gray8_pre_blend_solid_vspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; c : aggclr_ptr; covers : int8u_ptr );
163
 
var
164
 
 p : int8u_ptr;
165
 
 
166
 
 alpha : unsigned;
167
 
 
168
 
begin
169
 
 if c.a <> 0 then
170
 
  begin
171
 
   p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
172
 
 
173
 
   repeat
174
 
    alpha:=(c.a * (covers^ + 1 ) ) shr 8;
175
 
 
176
 
    if alpha = base_mask then
177
 
     p^:=c.v
178
 
    else
179
 
     blend_pix_gray_pre(p ,c.v ,alpha ,covers^ );
180
 
 
181
 
    p:=this.m_rbuf.next_row(p );
182
 
 
183
 
    inc(ptrcomp(covers ) ,sizeof(int8u ) );
184
 
    dec(len );
185
 
 
186
 
   until len = 0;
187
 
 
188
 
  end;
189
 
 
190
 
end;
191
 
 
192
 
{ gray8_pre_blend_color_hspan }
193
 
procedure gray8_pre_blend_color_hspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr; covers : int8u_ptr; cover : int8u );
194
 
var
195
 
 p : int8u_ptr;
196
 
 
197
 
begin
198
 
 p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
199
 
 
200
 
 if covers <> NIL then
201
 
  repeat
202
 
   copy_or_blend_pix_gray_pre(p ,colors ,covers^ );
203
 
 
204
 
   inc(ptrcomp(colors ) ,sizeof(aggclr ) );
205
 
   inc(ptrcomp(covers ) ,sizeof(int8u ) );
206
 
   inc(ptrcomp(p ) ,this.m_step );
207
 
   dec(len );
208
 
 
209
 
  until len = 0
210
 
 else
211
 
  if cover = 255 then
212
 
   repeat
213
 
    if colors.a = base_mask then
214
 
     p^:=colors.v
215
 
    else
216
 
     copy_or_blend_pix_pre(p ,colors );
217
 
 
218
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
219
 
    inc(ptrcomp(p ) ,this.m_step );
220
 
    dec(len );
221
 
 
222
 
   until len = 0
223
 
  else
224
 
   repeat
225
 
    copy_or_blend_pix_gray_pre(p ,colors ,cover );
226
 
 
227
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
228
 
    inc(ptrcomp(p ) ,this.m_step );
229
 
    dec(len );
230
 
 
231
 
   until len = 0;
232
 
 
233
 
end;
234
 
 
235
 
{ gray8_pre_blend_color_vspan }
236
 
procedure gray8_pre_blend_color_vspan(this : pixel_formats_ptr; x ,y : int; len : unsigned; colors : aggclr_ptr; covers : int8u_ptr; cover : int8u );
237
 
var
238
 
 p : int8u_ptr;
239
 
 
240
 
begin
241
 
 p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
242
 
 
243
 
 if covers <> NIL then
244
 
  repeat
245
 
   copy_or_blend_pix_gray_pre(p ,colors ,covers^ );
246
 
 
247
 
   inc(ptrcomp(colors ) ,sizeof(aggclr ) );
248
 
   inc(ptrcomp(covers ) ,sizeof(int8u ) );
249
 
 
250
 
   p:=this.m_rbuf.next_row(p );
251
 
 
252
 
   dec(len );
253
 
 
254
 
  until len = 0
255
 
 else
256
 
  if cover = 255 then
257
 
   repeat
258
 
    if colors.a = base_mask then
259
 
     p^:=colors.v
260
 
    else
261
 
     copy_or_blend_pix_pre(p ,colors );
262
 
 
263
 
    p:=this.m_rbuf.next_row(p );
264
 
 
265
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
266
 
    dec(len );
267
 
 
268
 
   until len = 0
269
 
 
270
 
  else
271
 
   repeat
272
 
    copy_or_blend_pix_gray_pre(p ,colors ,cover );
273
 
 
274
 
    inc(ptrcomp(colors ) ,sizeof(aggclr ) );
275
 
 
276
 
    p:=this.m_rbuf.next_row(p );
277
 
 
278
 
    dec(len );
279
 
 
280
 
   until len = 0;
281
 
 
282
 
end;
283
 
 
284
 
{ gray8_pre_blend_from_color }
285
 
procedure gray8_pre_blend_from_color(this : pixel_formats_ptr; from : pixel_formats_ptr; color : aggclr_ptr; xdst ,ydst ,xsrc ,ysrc : int; len : unsigned; cover : int8u );
286
 
var
287
 
 ppsz : unsigned;
288
 
 
289
 
 psrc ,pdst : int8u_ptr;
290
 
 
291
 
begin
292
 
 ppsz:=from._pix_width;
293
 
 psrc:=from.row_ptr(ysrc );
294
 
 
295
 
 if psrc <> NIL then
296
 
  begin
297
 
   pdst:=int8u_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + xdst * this.m_step + this.m_offset );
298
 
 
299
 
   repeat
300
 
    copy_or_blend_pix_gray_pre(
301
 
     pdst ,color ,
302
 
     shr_int32(psrc^ * cover + base_mask ,base_shift ) );
303
 
 
304
 
    inc(ptrcomp(psrc ) ,ppsz );
305
 
    inc(ptrcomp(pdst ) ,this.m_step );
306
 
    dec(len );
307
 
 
308
 
   until len = 0;
309
 
 
310
 
  end;
311
 
 
312
 
end;
313
 
 
314
 
{ gray8_pre_blend_from_lut }
315
 
procedure gray8_pre_blend_from_lut(this : pixel_formats_ptr; from : pixel_formats_ptr; color_lut : aggclr_ptr; xdst ,ydst ,xsrc ,ysrc : int; len : unsigned; cover : int8u );
316
 
var
317
 
 ppsz : unsigned;
318
 
 
319
 
 psrc ,pdst : int8u_ptr;
320
 
 
321
 
begin
322
 
 ppsz:=from._pix_width;
323
 
 psrc:=from.row_ptr(ysrc );
324
 
 
325
 
 if psrc <> NIL then
326
 
  begin
327
 
   pdst:=int8u_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + xdst * this.m_step + this.m_offset );
328
 
 
329
 
   repeat
330
 
    copy_or_blend_pix_gray_pre(
331
 
     pdst ,aggclr_ptr(ptrcomp(color_lut ) + psrc^ * sizeof(aggclr ) ) ,cover );
332
 
 
333
 
    inc(ptrcomp(psrc ) ,ppsz );
334
 
    inc(ptrcomp(pdst ) ,this.m_step );
335
 
    dec(len );
336
 
 
337
 
   until len = 0;
338
 
 
339
 
  end;
340
 
 
341
 
end;
342