2
This file is part of the Free Pascal run time library.
4
A file in Amiga system run time library.
5
Copyright (c) 2003 by Nils Sj�holm.
6
member of the Amiga RTL development team.
8
This is a unit for render.library
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
21
First version of this unit.
24
Changed cardinal > longword.
25
Changed startcode for unit.
28
nils.sjoholm@mailbox.swipnet.se Nils Sjoholm
32
{$I useamigasmartlink.inc}
33
{$ifdef use_amiga_smartlink}
35
{$endif use_amiga_smartlink}
40
USES Exec,utility,graphics;
42
VAR RenderBase : pLibrary;
45
pPLANEPTR = ^PLANEPTR;
48
RENDERNAME : PChar = 'render.library';
51
$VER: render.h v40 (19.12.2002)
52
render.library definitions
56
RND_TAGBASE = TAG_USER + $1000;
62
{ type of memhandler, see below }
63
RND_MemType = RND_TAGBASE + 1;
64
{ ptr to block of memory }
65
RND_MemBlock = RND_TAGBASE + 2;
66
{ size of memblock [bytes] }
67
RND_MemSize = RND_TAGBASE + 3;
68
{ memflags (exec/memory.h) }
69
RND_MemFlags = RND_TAGBASE + 18;
70
{ to pass a memhandler as an argument }
71
RND_RMHandler = RND_TAGBASE + 12;
75
{ v39 exec dynamic pool }
77
{ private memory pool }
79
{ common public memory }
86
{ palette import/export format }
87
RND_PaletteFormat = RND_TAGBASE + 19;
88
{ tag to indicate a palette is EHB }
89
RND_EHBPalette = RND_TAGBASE + 22;
90
{ first palette entry }
91
RND_FirstColor = RND_TAGBASE + 23;
92
{ dispose the old palette and load a new one }
93
RND_NewPalette = RND_TAGBASE + 24;
94
{ quantization factors }
95
RND_RGBWeight = RND_TAGBASE + 11;
99
{ ULONG red,green,blue }
105
{ render.library palette }
108
palette sort mode types
109
for the use with SortPalette()
111
{ no particular order }
112
PALMODE_NONE = $0000;
113
{ sort palette entries by brightness }
114
PALMODE_BRIGHTNESS = $0001;
115
{ sort palette entries by the number of pixels that they represent.
116
You must supply the RND_Histogram taglist argument. }
117
PALMODE_POPULARITY = $0002;
118
{ sort palette entries by the number of histogram entries that they
119
represent. You must supply the RND_Histogram taglist argument. }
120
PALMODE_REPRESENTATION = $0003;
121
{ sort palette entries by their optical significance for the human
122
eye. Implementation is unknown to you and may change.
123
You must supply the RND_Histogram taglist argument. }
124
PALMODE_SIGNIFICANCE = $0004;
125
{ sort palette entries by color intensity }
126
PALMODE_SATURATION = $0005;
127
{ By default, sort direction is descending, i.e. the precedence is
128
more-to-less. Combine with this flag to invert the sort direction. }
129
PALMODE_ASCENDING = $0008;
135
{ histogram type, see below }
136
RND_HSType = RND_TAGBASE + 4;
137
{ a histogram as an argument }
138
RND_Histogram = RND_TAGBASE + 9;
140
Histogram / Palette types
141
to be specified with RND_HSType
143
{ 12bit dynamic histogram }
145
{ 15bit dynamic histogram }
147
{ 18bit dynamic histogram }
149
{ 21bit dynamic histogram }
151
{ 24bit dynamic histogram }
153
{ 12bit tabular histogram }
154
HSTYPE_12BIT_TURBO = 20;
155
{ 15bit tabular histogram }
156
HSTYPE_15BIT_TURBO = 21;
157
{ 18bit tabular histogram }
158
HSTYPE_18BIT_TURBO = 22;
160
tags that can be queried via QueryHistogram()
162
{ # pixels in a histogram }
163
RND_NumPixels = RND_TAGBASE + 5;
164
{ # colors in a histogram }
165
RND_NumColors = RND_TAGBASE + 6;
168
rendering and conversions
171
{ color mode, see below }
172
RND_ColorMode = RND_TAGBASE + 7;
173
{ dither mode, see below }
174
RND_DitherMode = RND_TAGBASE + 8;
176
RND_DitherAmount = RND_TAGBASE + 26;
177
{ first color index to be output }
178
RND_OffsetColorZero = RND_TAGBASE + 10;
181
to be specified with RND_ColorMode
183
{ normal palette lookup }
184
COLORMODE_CLUT = $0000;
186
COLORMODE_HAM8 = $0001;
188
COLORMODE_HAM6 = $0002;
189
{ mask to determine COLORMODE }
190
COLORMODE_MASK = $0003;
193
to be specified with RND_DitherMode
196
DITHERMODE_NONE = $0000;
197
{ Floyd-Steinberg dither }
198
DITHERMODE_FS = $0001;
199
{ random dither. amount required. }
200
DITHERMODE_RANDOM = $0002;
202
DITHERMODE_EDD = $0003;
208
{ progress callback hook }
209
RND_ProgressHook = RND_TAGBASE + 13;
210
{ total input width [pixels] }
211
RND_SourceWidth = RND_TAGBASE + 14;
212
{ total output width [pixels] }
213
RND_DestWidth = RND_TAGBASE + 15;
214
{ ptr to a chunky conversion table }
215
RND_PenTable = RND_TAGBASE + 16;
216
{ chunky data left edge [pixels] }
217
RND_LeftEdge = RND_TAGBASE + 17;
218
{ line callback hook }
219
RND_LineHook = RND_TAGBASE + 20;
221
RND_MapEngine = RND_TAGBASE + 27;
223
RND_Interleave = RND_TAGBASE + 28;
225
RND_Palette = RND_TAGBASE + 29;
227
RND_Weight = RND_TAGBASE + 30;
229
RND_ScaleEngine = RND_TAGBASE + 31;
230
{ Texture coordinates }
231
RND_DestCoordinates = RND_TAGBASE + 42;
232
{ backcolor for filling }
233
RND_BGColor = RND_TAGBASE + 43;
234
{ backpen for filling }
235
RND_BGPen = RND_TAGBASE + 44;
238
alpha-channel and masking
241
{ custom alpha-channel }
242
RND_AlphaChannel = RND_TAGBASE + 32;
243
{ bytes between alpha-channel pixels }
244
RND_AlphaModulo = RND_TAGBASE + 33;
245
{ width of alpha-channel array }
246
RND_AlphaWidth = RND_TAGBASE + 34;
247
{ masking RGB for CreateAlphaArray }
248
RND_MaskRGB = RND_TAGBASE + 35;
249
{ mask value for outside color range }
250
RND_MaskFalse = RND_TAGBASE + 36;
251
{ mask value for inside color range }
252
RND_MaskTrue = RND_TAGBASE + 37;
253
{ total source width for 3channel operations }
254
RND_SourceWidth2 = RND_TAGBASE + 38;
255
{ second custom alpha-channel }
256
RND_AlphaChannel2 = RND_TAGBASE + 39;
257
{ pixel modulo for a second alpha-channel }
258
RND_AlphaModulo2 = RND_TAGBASE + 40;
259
{ width of a second alpha-channel array }
260
RND_AlphaWidth2 = RND_TAGBASE + 41;
266
{ pixel format, see below }
267
RND_PixelFormat = RND_TAGBASE + 25;
271
PIXFMT_CHUNKY_CLUT = (1 shl PIXFMTB_CHUNKY) + COLORMODE_CLUT;
272
PIXFMT_0RGB_32 = (1 shl PIXFMTB_RGB) + 0;
274
these types are currently not used by render.library, but
275
some of them are applicable for guigfx.library functions:
277
PIXFMT_CHUNKY_HAM8 = (1 shl PIXFMTB_CHUNKY) + COLORMODE_HAM8;
278
PIXFMT_CHUNKY_HAM6 = (1 shl PIXFMTB_CHUNKY) + COLORMODE_HAM6;
279
PIXFMT_BITMAP_CLUT = (1 shl PIXFMTB_BITMAP) + COLORMODE_CLUT;
280
PIXFMT_BITMAP_HAM8 = (1 shl PIXFMTB_BITMAP) + COLORMODE_HAM8;
281
PIXFMT_BITMAP_HAM6 = (1 shl PIXFMTB_BITMAP) + COLORMODE_HAM6;
282
PIXFMT_RGB_24 = (1 shl PIXFMTB_RGB) + 1;
286
PIXFMT_BITMAP_RGB = (1 shl PIXFMTB_BITMAP) + (1 shl PIXFMTB_RGB);
289
ExtractPalette return codes
291
You must at least check for EXTP_SUCCESS.
292
EXTP_NO_DATA indicates that there were no colors
297
EXTP_NOT_ENOUGH_MEMORY = 1;
298
EXTP_CALLBACK_ABORTED = 2;
302
AddRGB, AddRGBImage and AddChunkyImage return codes
304
You must at least check for ADDH_SUCCESS.
305
If not delivered, the histogram might be
310
ADDH_NOT_ENOUGH_MEMORY = 1;
311
ADDH_CALLBACK_ABORTED = 2;
317
You must at least check for REND_SUCCESS.
318
If not delivered, the image has not been
323
REND_NOT_ENOUGH_MEMORY = 1;
324
REND_CALLBACK_ABORTED = 2;
325
REND_NO_VALID_PALETTE = 3;
329
SortPalette return codes
331
You must at least check for SORTP_SUCCESS.
332
SORTP_NO_DATA indicates that there were data missing,
333
e.g. you specified no histogram or the histogram was empty.
338
SORTP_NOT_ENOUGH_MEMORY = 2;
339
SORTP_NOT_IMPLEMENTED = 3;
342
conversion return codes
344
These return codes apply to conversion functions
345
such as Chunky2RGB and ConvertChunky.
349
CONV_CALLBACK_ABORTED = 1;
350
CONV_NOT_ENOUGH_MEMORY = 2;
357
FUNCTION AddChunkyImageA(histogram : POINTER; chunky : pByte; width : WORD; height : WORD; palette : POINTER; taglist : pTagItem) : longword;
358
FUNCTION AddHistogramA(histogram1 : POINTER; histogram2 : POINTER; taglist : pTagItem) : longword;
359
FUNCTION AddRGB(histogram : POINTER; RGB : longword; count : longword) : longword;
360
FUNCTION AddRGBImageA(histogram : POINTER; rgb : pULONG; width : WORD; height : WORD; taglist : pTagItem) : longword;
361
FUNCTION AllocRenderMem(rendermemhandler : POINTER; size : longword) : POINTER;
362
FUNCTION AllocRenderVec(rendermemhandler : POINTER; size : longword) : POINTER;
363
FUNCTION AllocRenderVecClear(rendermemhandler : POINTER; size : longword) : POINTER;
364
PROCEDURE ApplyAlphaChannelA(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; taglist : pTagItem);
365
FUNCTION BestPen(palette : POINTER; rgb : longword) : LONGINT;
366
PROCEDURE Chunky2BitMapA(chunky : pByte; sx : WORD; sy : WORD; width : WORD; height : WORD; bitmap : pBitMap; dx : WORD; dy : WORD; taglist : pTagItem);
367
FUNCTION Chunky2RGBA(chunky : pByte; width : WORD; height : WORD; rgb : pULONG; palette : POINTER; taglist : pTagItem) : longword;
368
FUNCTION ChunkyArrayDiversityA(chunky : pByte; palette : POINTER; width : WORD; height : WORD; taglist : pTagItem) : LONGINT;
369
FUNCTION ConvertChunkyA(source : pByte; oldpalette : POINTER; width : WORD; height : WORD; dest : pByte; newpalette : POINTER; taglist : pTagItem) : longword;
370
FUNCTION CountRGB(histogram : POINTER; rgb : longword) : longword;
371
PROCEDURE CreateAlphaArrayA(rgbarray : pULONG; width : WORD; height : WORD; taglist : pTagItem);
372
FUNCTION CreateHistogramA(taglist : pTagItem) : POINTER;
373
FUNCTION CreateMapEngineA(palette : POINTER; taglist : pTagItem) : POINTER;
374
FUNCTION CreatePaletteA(taglist : pTagItem) : POINTER;
375
PROCEDURE CreatePenTableA(chunky : pByte; oldpalette : POINTER; width : WORD; height : WORD; newpalette : POINTER; convtab : pByte; taglist : pTagItem);
376
FUNCTION CreateRMHandlerA(taglist : pTagItem) : POINTER;
377
FUNCTION CreateScaleEngineA(sourcewidth : WORD; sourceheight : WORD; destwidth : WORD; destheight : WORD; taglist : pTagItem) : POINTER;
378
PROCEDURE DeleteHistogram(histogram : POINTER);
379
PROCEDURE DeleteMapEngine(engine : POINTER);
380
PROCEDURE DeletePalette(palette : POINTER);
381
PROCEDURE DeleteRMHandler(rmh : POINTER);
382
PROCEDURE DeleteScaleEngine(engine : POINTER);
383
PROCEDURE ExportPaletteA(palette : POINTER; coltab : POINTER; taglist : pTagItem);
384
PROCEDURE ExtractAlphaChannelA(rgbarray : pULONG; width : WORD; height : WORD; chunkyarray : pByte; taglist : pTagItem);
385
FUNCTION ExtractPaletteA(histogram : POINTER; palette : pULONG; numcolors : WORD; taglist : pTagItem) : longword;
386
PROCEDURE FlushPalette(palette : POINTER);
387
PROCEDURE FreeRenderMem(rendermemhandler : POINTER; mem : POINTER; size : longword);
388
PROCEDURE FreeRenderVec(mem : POINTER);
389
PROCEDURE ImportPaletteA(palette : POINTER; coltab : POINTER; numcols : WORD; taglist : pTagItem);
390
PROCEDURE InsertAlphaChannelA(maskarray : pByte; width : WORD; height : WORD; rgbarray : pULONG; taglist : pTagItem);
391
FUNCTION MapChunkyArrayA(engine : POINTER; source : pByte; palette : POINTER; width : WORD; height : WORD; dest : pByte; taglist : pTagItem) : longword;
392
FUNCTION MapRGBArrayA(engine : POINTER; rgb : pULONG; width : WORD; height : WORD; chunky : pByte; taglist : pTagItem) : longword;
393
PROCEDURE MixAlphaChannelA(source1 : pULONG; source2 : pULONG; width : WORD; height : WORD; dest : pULONG; taglist : pTagItem);
394
PROCEDURE MixRGBArrayA(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; ratio : WORD; taglist : pTagItem);
395
PROCEDURE Planar2ChunkyA(planetab : pPLANEPTR; bytewidth : WORD; height : WORD; depth : WORD; bytesperrow : WORD; chunky : pByte; taglist : pTagItem);
396
FUNCTION QueryHistogram(histogram : POINTER; d0arg : longword) : longword;
397
FUNCTION RenderA(rgb : pULONG; width : WORD; height : WORD; chunky : pByte; palette : POINTER; taglist : pTagItem) : longword;
398
FUNCTION RGBArrayDiversityA(rgb : pULONG; width : WORD; height : WORD; taglist : pTagItem) : LONGINT;
399
FUNCTION ScaleA(engine : POINTER; source : POINTER; dest : POINTER; taglist : pTagItem) : longword;
400
FUNCTION ScaleOrdinate(source : WORD; dest : WORD; ordinate : WORD) : WORD;
401
FUNCTION SortPaletteA(palette : POINTER; mode : longword; taglist : pTagItem) : longword;
402
PROCEDURE TintRGBArrayA(source : pULONG; width : WORD; height : WORD; RGB : longword; ratio : WORD; dest : pULONG; taglist : pTagItem);
404
Functions and procedures with array of const go here
406
FUNCTION AddChunkyImage(histogram : POINTER; chunky : pByte; width : WORD; height : WORD; palette : POINTER; const taglist : Array Of Const) : longword;
407
FUNCTION AddHistogram(histogram1 : POINTER; histogram2 : POINTER; const taglist : Array Of Const) : longword;
408
FUNCTION AddRGBImage(histogram : POINTER; rgb : pULONG; width : WORD; height : WORD; const taglist : Array Of Const) : longword;
409
PROCEDURE ApplyAlphaChannel(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; const taglist : Array Of Const);
410
PROCEDURE Chunky2BitMap(chunky : pByte; sx : WORD; sy : WORD; width : WORD; height : WORD; bitmap : pBitMap; dx : WORD; dy : WORD; const taglist : Array Of Const);
411
FUNCTION Chunky2RGB(chunky : pByte; width : WORD; height : WORD; rgb : pULONG; palette : POINTER; const taglist : Array Of Const) : longword;
412
FUNCTION ChunkyArrayDiversity(chunky : pByte; palette : POINTER; width : WORD; height : WORD; const taglist : Array Of Const) : LONGINT;
413
FUNCTION ConvertChunky(source : pByte; oldpalette : POINTER; width : WORD; height : WORD; dest : pByte; newpalette : POINTER; const taglist : Array Of Const) : longword;
414
PROCEDURE CreateAlphaArray(rgbarray : pULONG; width : WORD; height : WORD; const taglist : Array Of Const);
415
FUNCTION CreateHistogram(const taglist : Array Of Const) : POINTER;
416
FUNCTION CreateMapEngine(palette : POINTER; const taglist : Array Of Const) : POINTER;
417
FUNCTION CreatePalette(const taglist : Array Of Const) : POINTER;
418
PROCEDURE CreatePenTable(chunky : pByte; oldpalette : POINTER; width : WORD; height : WORD; newpalette : POINTER; convtab : pByte; const taglist : Array Of Const);
419
FUNCTION CreateRMHandler(const taglist : Array Of Const) : POINTER;
420
FUNCTION CreateScaleEngine(sourcewidth : WORD; sourceheight : WORD; destwidth : WORD; destheight : WORD; const taglist : Array Of Const) : POINTER;
421
PROCEDURE ExportPalette(palette : POINTER; coltab : POINTER; const taglist : Array Of Const);
422
PROCEDURE ExtractAlphaChannel(rgbarray : pULONG; width : WORD; height : WORD; chunkyarray : pByte; const taglist : Array Of Const);
423
FUNCTION ExtractPalette(histogram : POINTER; palette : pULONG; numcolors : WORD; const taglist : Array Of Const) : longword;
424
PROCEDURE ImportPalette(palette : POINTER; coltab : POINTER; numcols : WORD; const taglist : Array Of Const);
425
PROCEDURE InsertAlphaChannel(maskarray : pByte; width : WORD; height : WORD; rgbarray : pULONG; const taglist : Array Of Const);
426
FUNCTION MapChunkyArray(engine : POINTER; source : pByte; palette : POINTER; width : WORD; height : WORD; dest : pByte; const taglist : Array Of Const) : longword;
427
FUNCTION MapRGBArray(engine : POINTER; rgb : pULONG; width : WORD; height : WORD; chunky : pByte; const taglist : Array Of Const) : longword;
428
PROCEDURE MixAlphaChannel(source1 : pULONG; source2 : pULONG; width : WORD; height : WORD; dest : pULONG; const taglist : Array Of Const);
429
PROCEDURE MixRGBArray(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; ratio : WORD; const taglist : Array Of Const);
430
PROCEDURE Planar2Chunky(planetab : pPLANEPTR; bytewidth : WORD; height : WORD; depth : WORD; bytesperrow : WORD; chunky : pByte; const taglist : Array Of Const);
431
FUNCTION RenderTags(rgb : pULONG; width : WORD; height : WORD; chunky : pByte; palette : POINTER; const taglist : Array Of Const) : longword;
432
FUNCTION RGBArrayDiversity(rgb : pULONG; width : WORD; height : WORD; const taglist : Array Of Const) : LONGINT;
433
FUNCTION Scale(engine : POINTER; source : POINTER; dest : POINTER; const taglist : Array Of Const) : longword;
434
FUNCTION SortPalette(palette : POINTER; mode : longword; const taglist : Array Of Const) : longword;
435
PROCEDURE TintRGBArray(source : pULONG; width : WORD; height : WORD; RGB : longword; ratio : WORD; dest : pULONG; const taglist : Array Of Const);
437
{You can remove this include and use a define instead}
438
{$I useautoopenlib.inc}
439
{$ifdef use_init_openlib}
440
procedure InitRENDERLibrary;
441
{$endif use_init_openlib}
443
{This is a variable that knows how the unit is compiled}
445
RENDERIsCompiledHow : longint;
450
{$ifndef dont_use_openlib}
452
{$endif dont_use_openlib}
455
FUNCTION AddChunkyImageA(histogram : POINTER; chunky : pByte; width : WORD; height : WORD; palette : POINTER; taglist : pTagItem) : longword;
465
MOVEA.L RenderBase,A6
472
FUNCTION AddHistogramA(histogram1 : POINTER; histogram2 : POINTER; taglist : pTagItem) : longword;
476
MOVEA.L histogram1,A0
477
MOVEA.L histogram2,A1
479
MOVEA.L RenderBase,A6
486
FUNCTION AddRGB(histogram : POINTER; RGB : longword; count : longword) : longword;
493
MOVEA.L RenderBase,A6
500
FUNCTION AddRGBImageA(histogram : POINTER; rgb : pULONG; width : WORD; height : WORD; taglist : pTagItem) : longword;
509
MOVEA.L RenderBase,A6
516
FUNCTION AllocRenderMem(rendermemhandler : POINTER; size : longword) : POINTER;
520
MOVEA.L rendermemhandler,A0
522
MOVEA.L RenderBase,A6
529
FUNCTION AllocRenderVec(rendermemhandler : POINTER; size : longword) : POINTER;
533
MOVEA.L rendermemhandler,A0
535
MOVEA.L RenderBase,A6
542
FUNCTION AllocRenderVecClear(rendermemhandler : POINTER; size : longword) : POINTER;
546
MOVEA.L rendermemhandler,A0
548
MOVEA.L RenderBase,A6
555
PROCEDURE ApplyAlphaChannelA(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; taglist : pTagItem);
559
MOVEA.L sourcearray,A0
564
MOVEA.L RenderBase,A6
570
FUNCTION BestPen(palette : POINTER; rgb : longword) : LONGINT;
576
MOVEA.L RenderBase,A6
583
PROCEDURE Chunky2BitMapA(chunky : pByte; sx : WORD; sy : WORD; width : WORD; height : WORD; bitmap : pBitMap; dx : WORD; dy : WORD; taglist : pTagItem);
596
MOVEA.L RenderBase,A6
602
FUNCTION Chunky2RGBA(chunky : pByte; width : WORD; height : WORD; rgb : pULONG; palette : POINTER; taglist : pTagItem) : longword;
612
MOVEA.L RenderBase,A6
619
FUNCTION ChunkyArrayDiversityA(chunky : pByte; palette : POINTER; width : WORD; height : WORD; taglist : pTagItem) : LONGINT;
628
MOVEA.L RenderBase,A6
635
FUNCTION ConvertChunkyA(source : pByte; oldpalette : POINTER; width : WORD; height : WORD; dest : pByte; newpalette : POINTER; taglist : pTagItem) : longword;
640
MOVEA.L oldpalette,A1
644
MOVEA.L newpalette,A3
646
MOVEA.L RenderBase,A6
653
FUNCTION CountRGB(histogram : POINTER; rgb : longword) : longword;
659
MOVEA.L RenderBase,A6
666
PROCEDURE CreateAlphaArrayA(rgbarray : pULONG; width : WORD; height : WORD; taglist : pTagItem);
674
MOVEA.L RenderBase,A6
680
FUNCTION CreateHistogramA(taglist : pTagItem) : POINTER;
685
MOVEA.L RenderBase,A6
692
FUNCTION CreateMapEngineA(palette : POINTER; taglist : pTagItem) : POINTER;
698
MOVEA.L RenderBase,A6
705
FUNCTION CreatePaletteA(taglist : pTagItem) : POINTER;
710
MOVEA.L RenderBase,A6
717
PROCEDURE CreatePenTableA(chunky : pByte; oldpalette : POINTER; width : WORD; height : WORD; newpalette : POINTER; convtab : pByte; taglist : pTagItem);
722
MOVEA.L oldpalette,A1
725
MOVEA.L newpalette,A2
728
MOVEA.L RenderBase,A6
734
FUNCTION CreateRMHandlerA(taglist : pTagItem) : POINTER;
739
MOVEA.L RenderBase,A6
746
FUNCTION CreateScaleEngineA(sourcewidth : WORD; sourceheight : WORD; destwidth : WORD; destheight : WORD; taglist : pTagItem) : POINTER;
750
MOVE.L sourcewidth,D0
751
MOVE.L sourceheight,D1
755
MOVEA.L RenderBase,A6
762
PROCEDURE DeleteHistogram(histogram : POINTER);
767
MOVEA.L RenderBase,A6
773
PROCEDURE DeleteMapEngine(engine : POINTER);
778
MOVEA.L RenderBase,A6
784
PROCEDURE DeletePalette(palette : POINTER);
789
MOVEA.L RenderBase,A6
795
PROCEDURE DeleteRMHandler(rmh : POINTER);
800
MOVEA.L RenderBase,A6
806
PROCEDURE DeleteScaleEngine(engine : POINTER);
811
MOVEA.L RenderBase,A6
817
PROCEDURE ExportPaletteA(palette : POINTER; coltab : POINTER; taglist : pTagItem);
824
MOVEA.L RenderBase,A6
830
PROCEDURE ExtractAlphaChannelA(rgbarray : pULONG; width : WORD; height : WORD; chunkyarray : pByte; taglist : pTagItem);
837
MOVEA.L chunkyarray,A1
839
MOVEA.L RenderBase,A6
845
FUNCTION ExtractPaletteA(histogram : POINTER; palette : pULONG; numcolors : WORD; taglist : pTagItem) : longword;
853
MOVEA.L RenderBase,A6
860
PROCEDURE FlushPalette(palette : POINTER);
865
MOVEA.L RenderBase,A6
871
PROCEDURE FreeRenderMem(rendermemhandler : POINTER; mem : POINTER; size : longword);
875
MOVEA.L rendermemhandler,A0
878
MOVEA.L RenderBase,A6
884
PROCEDURE FreeRenderVec(mem : POINTER);
889
MOVEA.L RenderBase,A6
895
PROCEDURE ImportPaletteA(palette : POINTER; coltab : POINTER; numcols : WORD; taglist : pTagItem);
903
MOVEA.L RenderBase,A6
909
PROCEDURE InsertAlphaChannelA(maskarray : pByte; width : WORD; height : WORD; rgbarray : pULONG; taglist : pTagItem);
918
MOVEA.L RenderBase,A6
924
FUNCTION MapChunkyArrayA(engine : POINTER; source : pByte; palette : POINTER; width : WORD; height : WORD; dest : pByte; taglist : pTagItem) : longword;
935
MOVEA.L RenderBase,A6
942
FUNCTION MapRGBArrayA(engine : POINTER; rgb : pULONG; width : WORD; height : WORD; chunky : pByte; taglist : pTagItem) : longword;
952
MOVEA.L RenderBase,A6
959
PROCEDURE MixAlphaChannelA(source1 : pULONG; source2 : pULONG; width : WORD; height : WORD; dest : pULONG; taglist : pTagItem);
969
MOVEA.L RenderBase,A6
975
PROCEDURE MixRGBArrayA(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; ratio : WORD; taglist : pTagItem);
979
MOVEA.L sourcearray,A0
985
MOVEA.L RenderBase,A6
991
PROCEDURE Planar2ChunkyA(planetab : pPLANEPTR; bytewidth : WORD; height : WORD; depth : WORD; bytesperrow : WORD; chunky : pByte; taglist : pTagItem);
999
MOVE.L bytesperrow,D3
1002
MOVEA.L RenderBase,A6
1008
FUNCTION QueryHistogram(histogram : POINTER; d0arg : longword) : longword;
1012
MOVEA.L histogram,A0
1014
MOVEA.L RenderBase,A6
1021
FUNCTION RenderA(rgb : pULONG; width : WORD; height : WORD; chunky : pByte; palette : POINTER; taglist : pTagItem) : longword;
1031
MOVEA.L RenderBase,A6
1038
FUNCTION RGBArrayDiversityA(rgb : pULONG; width : WORD; height : WORD; taglist : pTagItem) : LONGINT;
1046
MOVEA.L RenderBase,A6
1053
FUNCTION ScaleA(engine : POINTER; source : POINTER; dest : POINTER; taglist : pTagItem) : longword;
1061
MOVEA.L RenderBase,A6
1068
FUNCTION ScaleOrdinate(source : WORD; dest : WORD; ordinate : WORD) : WORD;
1075
MOVEA.L RenderBase,A6
1082
FUNCTION SortPaletteA(palette : POINTER; mode : longword; taglist : pTagItem) : longword;
1089
MOVEA.L RenderBase,A6
1096
PROCEDURE TintRGBArrayA(source : pULONG; width : WORD; height : WORD; RGB : longword; ratio : WORD; dest : pULONG; taglist : pTagItem);
1107
MOVEA.L RenderBase,A6
1114
Functions and procedures with array of const go here
1116
FUNCTION AddChunkyImage(histogram : POINTER; chunky : pByte; width : WORD; height : WORD; palette : POINTER; const taglist : Array Of Const) : longword;
1118
AddChunkyImage := AddChunkyImageA(histogram , chunky , width , height , palette , readintags(taglist));
1121
FUNCTION AddHistogram(histogram1 : POINTER; histogram2 : POINTER; const taglist : Array Of Const) : longword;
1123
AddHistogram := AddHistogramA(histogram1 , histogram2 , readintags(taglist));
1126
FUNCTION AddRGBImage(histogram : POINTER; rgb : pULONG; width : WORD; height : WORD; const taglist : Array Of Const) : longword;
1128
AddRGBImage := AddRGBImageA(histogram , rgb , width , height , readintags(taglist));
1131
PROCEDURE ApplyAlphaChannel(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; const taglist : Array Of Const);
1133
ApplyAlphaChannelA(sourcearray , width , height , destarray , readintags(taglist));
1136
PROCEDURE Chunky2BitMap(chunky : pByte; sx : WORD; sy : WORD; width : WORD; height : WORD; bitmap : pBitMap; dx : WORD; dy : WORD; const taglist : Array Of Const);
1138
Chunky2BitMapA(chunky , sx , sy , width , height , bitmap , dx , dy , readintags(taglist));
1141
FUNCTION Chunky2RGB(chunky : pByte; width : WORD; height : WORD; rgb : pULONG; palette : POINTER; const taglist : Array Of Const) : longword;
1143
Chunky2RGB := Chunky2RGBA(chunky , width , height , rgb , palette , readintags(taglist));
1146
FUNCTION ChunkyArrayDiversity(chunky : pByte; palette : POINTER; width : WORD; height : WORD; const taglist : Array Of Const) : LONGINT;
1148
ChunkyArrayDiversity := ChunkyArrayDiversityA(chunky , palette , width , height , readintags(taglist));
1151
FUNCTION ConvertChunky(source : pByte; oldpalette : POINTER; width : WORD; height : WORD; dest : pByte; newpalette : POINTER; const taglist : Array Of Const) : longword;
1153
ConvertChunky := ConvertChunkyA(source , oldpalette , width , height , dest , newpalette , readintags(taglist));
1156
PROCEDURE CreateAlphaArray(rgbarray : pULONG; width : WORD; height : WORD; const taglist : Array Of Const);
1158
CreateAlphaArrayA(rgbarray , width , height , readintags(taglist));
1161
FUNCTION CreateHistogram(const taglist : Array Of Const) : POINTER;
1163
CreateHistogram := CreateHistogramA(readintags(taglist));
1166
FUNCTION CreateMapEngine(palette : POINTER; const taglist : Array Of Const) : POINTER;
1168
CreateMapEngine := CreateMapEngineA(palette , readintags(taglist));
1171
FUNCTION CreatePalette(const taglist : Array Of Const) : POINTER;
1173
CreatePalette := CreatePaletteA(readintags(taglist));
1176
PROCEDURE CreatePenTable(chunky : pByte; oldpalette : POINTER; width : WORD; height : WORD; newpalette : POINTER; convtab : pByte; const taglist : Array Of Const);
1178
CreatePenTableA(chunky , oldpalette , width , height , newpalette , convtab , readintags(taglist));
1181
FUNCTION CreateRMHandler(const taglist : Array Of Const) : POINTER;
1183
CreateRMHandler := CreateRMHandlerA(readintags(taglist));
1186
FUNCTION CreateScaleEngine(sourcewidth : WORD; sourceheight : WORD; destwidth : WORD; destheight : WORD; const taglist : Array Of Const) : POINTER;
1188
CreateScaleEngine := CreateScaleEngineA(sourcewidth , sourceheight , destwidth , destheight , readintags(taglist));
1191
PROCEDURE ExportPalette(palette : POINTER; coltab : POINTER; const taglist : Array Of Const);
1193
ExportPaletteA(palette , coltab , readintags(taglist));
1196
PROCEDURE ExtractAlphaChannel(rgbarray : pULONG; width : WORD; height : WORD; chunkyarray : pByte; const taglist : Array Of Const);
1198
ExtractAlphaChannelA(rgbarray , width , height , chunkyarray , readintags(taglist));
1201
FUNCTION ExtractPalette(histogram : POINTER; palette : pULONG; numcolors : WORD; const taglist : Array Of Const) : longword;
1203
ExtractPalette := ExtractPaletteA(histogram , palette , numcolors , readintags(taglist));
1206
PROCEDURE ImportPalette(palette : POINTER; coltab : POINTER; numcols : WORD; const taglist : Array Of Const);
1208
ImportPaletteA(palette , coltab , numcols , readintags(taglist));
1211
PROCEDURE InsertAlphaChannel(maskarray : pByte; width : WORD; height : WORD; rgbarray : pULONG; const taglist : Array Of Const);
1213
InsertAlphaChannelA(maskarray , width , height , rgbarray , readintags(taglist));
1216
FUNCTION MapChunkyArray(engine : POINTER; source : pByte; palette : POINTER; width : WORD; height : WORD; dest : pByte; const taglist : Array Of Const) : longword;
1218
MapChunkyArray := MapChunkyArrayA(engine , source , palette , width , height , dest , readintags(taglist));
1221
FUNCTION MapRGBArray(engine : POINTER; rgb : pULONG; width : WORD; height : WORD; chunky : pByte; const taglist : Array Of Const) : longword;
1223
MapRGBArray := MapRGBArrayA(engine , rgb , width , height , chunky , readintags(taglist));
1226
PROCEDURE MixAlphaChannel(source1 : pULONG; source2 : pULONG; width : WORD; height : WORD; dest : pULONG; const taglist : Array Of Const);
1228
MixAlphaChannelA(source1 , source2 , width , height , dest , readintags(taglist));
1231
PROCEDURE MixRGBArray(sourcearray : pULONG; width : WORD; height : WORD; destarray : pULONG; ratio : WORD; const taglist : Array Of Const);
1233
MixRGBArrayA(sourcearray , width , height , destarray , ratio , readintags(taglist));
1236
PROCEDURE Planar2Chunky(planetab : pPLANEPTR; bytewidth : WORD; height : WORD; depth : WORD; bytesperrow : WORD; chunky : pByte; const taglist : Array Of Const);
1238
Planar2ChunkyA(planetab , bytewidth , height , depth , bytesperrow , chunky , readintags(taglist));
1241
FUNCTION RenderTags(rgb : pULONG; width : WORD; height : WORD; chunky : pByte; palette : POINTER; const taglist : Array Of Const) : longword;
1243
RenderTags := RenderA(rgb , width , height , chunky , palette , readintags(taglist));
1246
FUNCTION RGBArrayDiversity(rgb : pULONG; width : WORD; height : WORD; const taglist : Array Of Const) : LONGINT;
1248
RGBArrayDiversity := RGBArrayDiversityA(rgb , width , height , readintags(taglist));
1251
FUNCTION Scale(engine : POINTER; source : POINTER; dest : POINTER; const taglist : Array Of Const) : longword;
1253
Scale := ScaleA(engine , source , dest , readintags(taglist));
1256
FUNCTION SortPalette(palette : POINTER; mode : longword; const taglist : Array Of Const) : longword;
1258
SortPalette := SortPaletteA(palette , mode , readintags(taglist));
1261
PROCEDURE TintRGBArray(source : pULONG; width : WORD; height : WORD; RGB : longword; ratio : WORD; dest : pULONG; const taglist : Array Of Const);
1263
TintRGBArrayA(source , width , height , RGB , ratio , dest , readintags(taglist));
1267
{ Change VERSION and LIBVERSION to proper values }
1269
VERSION : string[2] = '0';
1270
LIBVERSION : longword = 0;
1272
{$ifdef use_init_openlib}
1273
{$Info Compiling initopening of render.library}
1274
{$Info don't forget to use InitRENDERLibrary in the beginning of your program}
1277
render_exit : Pointer;
1279
procedure CloserenderLibrary;
1281
ExitProc := render_exit;
1282
if RenderBase <> nil then begin
1283
CloseLibrary(RenderBase);
1288
procedure InitRENDERLibrary;
1291
RenderBase := OpenLibrary(RENDERNAME,LIBVERSION);
1292
if RenderBase <> nil then begin
1293
render_exit := ExitProc;
1294
ExitProc := @CloserenderLibrary;
1296
MessageBox('FPC Pascal Error',
1297
'Can''t open render.library version ' + VERSION + #10 +
1298
'Deallocating resources and closing down',
1305
RENDERIsCompiledHow := 2;
1306
{$endif use_init_openlib}
1308
{$ifdef use_auto_openlib}
1309
{$Info Compiling autoopening of render.library}
1312
render_exit : Pointer;
1314
procedure CloserenderLibrary;
1316
ExitProc := render_exit;
1317
if RenderBase <> nil then begin
1318
CloseLibrary(RenderBase);
1325
RenderBase := OpenLibrary(RENDERNAME,LIBVERSION);
1326
if RenderBase <> nil then begin
1327
render_exit := ExitProc;
1328
ExitProc := @CloserenderLibrary;
1329
RENDERIsCompiledHow := 1;
1331
MessageBox('FPC Pascal Error',
1332
'Can''t open render.library version ' + VERSION + #10 +
1333
'Deallocating resources and closing down',
1338
{$endif use_auto_openlib}
1340
{$ifdef dont_use_openlib}
1342
RENDERIsCompiledHow := 3;
1343
{$Warning No autoopening of render.library compiled}
1344
{$Warning Make sure you open render.library yourself}
1345
{$endif dont_use_openlib}
1348
END. (* UNIT RENDER *)