2
// AggPas 2.4 RM3 pixel format definition file
5
procedure blend_pix_gray_pre(p : int8u_ptr; cv ,alpha ,cover : unsigned ); overload;
7
alpha:=base_mask - alpha;
8
cover:=(cover + 1 ) shl (base_shift - 8 );
10
p^:=int8u((p^ * alpha + cv * cover ) shr base_shift );
14
{ blend_pix_gray_pre }
15
procedure blend_pix_gray_pre(p : int8u_ptr; cv ,alpha : unsigned ); overload;
17
p^:=int8u(((p^ * (base_mask - alpha ) ) shr base_shift ) + cv );
21
{ copy_or_blend_pix_gray_pre }
22
procedure copy_or_blend_pix_gray_pre(p : int8u_ptr; c : aggclr_ptr; cover : unsigned ); overload;
29
alpha:=(c.a * (cover + 1 ) ) shr 8;
31
if alpha = base_mask then
34
blend_pix_gray_pre(p ,c.v ,alpha ,cover );
40
{ copy_or_blend_pix_pre }
41
procedure copy_or_blend_pix_pre(p : int8u_ptr; c : aggclr_ptr ); overload;
44
if c.a = base_mask then
47
blend_pix_gray_pre(p ,c.v ,c.a );
51
{ gray8_pre_blend_pixel }
52
procedure gray8_pre_blend_pixel(this : pixel_formats_ptr; x ,y : int; c : aggclr_ptr; cover : int8u );
54
copy_or_blend_pix_gray_pre(
55
int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset ) ,
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 );
70
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
72
alpha:=(c.a * (cover + 1 ) ) shr 8;
74
if alpha = base_mask then
78
inc(ptrcomp(p ) ,this.m_step );
84
blend_pix_gray_pre(p ,c.v ,alpha ,cover );
86
inc(ptrcomp(p ) ,this.m_step );
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 );
105
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
107
alpha:=(c.a * (cover + 1 ) ) shr 8;
109
if alpha = base_mask then
112
p :=this.m_rbuf.next_row(p );
119
blend_pix_gray_pre(p ,c.v ,alpha ,cover );
121
p:=this.m_rbuf.next_row(p );
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 );
141
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
144
alpha:=(c.a * (covers^ + 1 ) ) shr 8;
146
if alpha = base_mask then
149
blend_pix_gray_pre(p ,c.v ,alpha ,covers^ );
151
inc(ptrcomp(p ) ,this.m_step );
152
inc(ptrcomp(covers ) );
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 );
171
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
174
alpha:=(c.a * (covers^ + 1 ) ) shr 8;
176
if alpha = base_mask then
179
blend_pix_gray_pre(p ,c.v ,alpha ,covers^ );
181
p:=this.m_rbuf.next_row(p );
183
inc(ptrcomp(covers ) ,sizeof(int8u ) );
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 );
198
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
200
if covers <> NIL then
202
copy_or_blend_pix_gray_pre(p ,colors ,covers^ );
204
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
205
inc(ptrcomp(covers ) ,sizeof(int8u ) );
206
inc(ptrcomp(p ) ,this.m_step );
213
if colors.a = base_mask then
216
copy_or_blend_pix_pre(p ,colors );
218
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
219
inc(ptrcomp(p ) ,this.m_step );
225
copy_or_blend_pix_gray_pre(p ,colors ,cover );
227
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
228
inc(ptrcomp(p ) ,this.m_step );
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 );
241
p:=int8u_ptr(ptrcomp(this.m_rbuf.row(y ) ) + x * this.m_step + this.m_offset );
243
if covers <> NIL then
245
copy_or_blend_pix_gray_pre(p ,colors ,covers^ );
247
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
248
inc(ptrcomp(covers ) ,sizeof(int8u ) );
250
p:=this.m_rbuf.next_row(p );
258
if colors.a = base_mask then
261
copy_or_blend_pix_pre(p ,colors );
263
p:=this.m_rbuf.next_row(p );
265
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
272
copy_or_blend_pix_gray_pre(p ,colors ,cover );
274
inc(ptrcomp(colors ) ,sizeof(aggclr ) );
276
p:=this.m_rbuf.next_row(p );
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 );
289
psrc ,pdst : int8u_ptr;
292
ppsz:=from._pix_width;
293
psrc:=from.row_ptr(ysrc );
297
pdst:=int8u_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + xdst * this.m_step + this.m_offset );
300
copy_or_blend_pix_gray_pre(
302
shr_int32(psrc^ * cover + base_mask ,base_shift ) );
304
inc(ptrcomp(psrc ) ,ppsz );
305
inc(ptrcomp(pdst ) ,this.m_step );
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 );
319
psrc ,pdst : int8u_ptr;
322
ppsz:=from._pix_width;
323
psrc:=from.row_ptr(ysrc );
327
pdst:=int8u_ptr(ptrcomp(this.m_rbuf.row_xy(xdst ,ydst ,len ) ) + xdst * this.m_step + this.m_offset );
330
copy_or_blend_pix_gray_pre(
331
pdst ,aggclr_ptr(ptrcomp(color_lut ) + psrc^ * sizeof(aggclr ) ) ,cover );
333
inc(ptrcomp(psrc ) ,ppsz );
334
inc(ptrcomp(pdst ) ,this.m_step );