Difference between revisions of "BGRABitmap Miscellaneous types"
From Lazarus wiki
Jump to navigationJump to search (added font types) |
(→Miscellaneous types: added TBGRACustomFontRenderer) |
||
Line 122: | Line 122: | ||
<tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">How a typewriter must render its content on a Canvas2d</td></tr> | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">How a typewriter must render its content on a Canvas2d</td></tr> | ||
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr style="background: white;"><td colspan="3">'' | + | <tr style="background: white;"><td colspan="3">''TBGRACustomFontRenderer'' = '''class'''</td></tr> |
− | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2"> | + | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Abstract class for all font renderers</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''FontName'': '''string''';</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Specifies the font to use. Unless the font renderer accept otherwise, the name is in human readable form, like 'Arial', 'Times New Roman', ...</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''FontStyle'': TFontStyles;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Specifies the set of styles to be applied to the font. These can be fsBold, fsItalic, fsStrikeOut, fsUnderline. So the value [fsBold,fsItalic] means that the font must be bold and italic</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''FontQuality'' : TBGRAFontQuality;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Specifies the quality of rendering. Default value is fqSystem</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''FontOrientation'': integer;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Specifies the rotation of the text, for functions that support text rotation. It is expressed in tenth of degrees, positive values going counter-clockwise</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''FontEmHeight'': integer;</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Specifies the height of the font without taking into account additional line spacing. A negative value means that it is the full height instead</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' GetFontPixelMetric: TFontPixelMetric; virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Returns measurement for the current font in pixels</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''function''' TextSize(sUTF8: '''string'''): TSize; virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Returns the total size of the string provided using the current font. Orientation is not taken into account, so that the width is along the text</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''procedure''' TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: '''string'''; c: TBGRAPixel; align: TAlignment); virtual; abstract;</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Draws the UTF8 encoded string, with color ''c''. If align is taLeftJustify, (''x'',''y'') is the top-left corner. If align is taCenter, (''x'',''y'') is at the top and middle of the text. If align is taRightJustify, (''x'',''y'') is the top-right corner. The value of ''FontOrientation'' is taken into account, so that the text may be rotated</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''procedure''' TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: '''string'''; texture: IBGRAScanner; align: TAlignment); virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Same as above functions, except that the text is filled using texture. The value of ''FontOrientation'' is taken into account, so that the text may be rotated</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''procedure''' TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: '''string'''; c: TBGRAPixel; align: TAlignment); virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Same as above, except that the orientation is specified, overriding the value of the property ''FontOrientation''</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''procedure''' TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: '''string'''; texture: IBGRAScanner; align: TAlignment); virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Same as above, except that the orientation is specified, overriding the value of the property ''FontOrientation''</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''procedure''' TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: '''string'''; style: TTextStyle; c: TBGRAPixel); virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Draw the UTF8 encoded string at the coordinate (''x'',''y''), clipped inside the rectangle ''ARect''. Additional style information is provided by the style parameter. The color ''c'' is used to fill the text. No rotation is applied.</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''procedure''' TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: '''string'''; style: TTextStyle; texture: IBGRAScanner); virtual; abstract;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Same as above except a ''texture'' is used to fill the text</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''procedure''' CopyTextPathTo({%H-}ADest: IBGRAPath; {%H-}x, {%H-}y: single; {%H-}s: '''string'''; {%H-}align: TAlignment); virtual; //optional</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Copy the path for the UTF8 encoded string into ''ADest''. If ''align'' is ''taLeftJustify'', (''x'',''y'') is the top-left corner. If ''align'' is ''taCenter'', (''x'',''y'') is at the top and middle of the text. If ''align'' is ''taRightJustify'', (''x'',''y'') is the top-right corner.</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: #f0f0ff;"><td colspan="3">''TBGRATextOutImproveReadabilityMode'' = (irMask, irNormal, irClearTypeRGB, irClearTypeBGR);</td></tr> |
− | <tr | + | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Output mode for the improved renderer for readability. This is used by the font renderer based on LCL in ''BGRAText''</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' CleanTextOutString(s: '''string'''): '''string''';</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Removes line ending and tab characters from a string (for a function like ''TextOut'' that does not handle this). this works with UTF8 strings as well</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''function''' RemoveLineEnding('''var''' s: '''string'''; indexByte: integer): boolean;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Remove the line ending at the specified position or return False. This works with UTF8 strings however the index is the byte index</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' RemoveLineEndingUTF8('''var''' sUTF8: '''string'''; indexUTF8: integer): boolean;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Remove the line ending at the specified position or return False. The index is the character index, that may be different from the byte index</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''procedure''' BGRADefaultWordBreakHandler('''var''' ABefore, AAfter: '''string''');</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Default word break handler, that simply divide when there is a space</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: white;"><td colspan="3">''TResampleMode'' = (</td></tr> |
− | <tr | + | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">How the resample is to be computed</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rmSimpleStretch'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Low quality resample by repeating pixels, stretching them</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rmFineResample'');</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Use resample filters. This gives high quality resampling however this the proportion changes slightly because the first and last pixel are considered to occupy only half a unit as they are considered as the border of the picture (pixel-centered coordinates)</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: #f0f0ff;"><td colspan="3">''TResampleFilter'' = (</td></tr> |
− | <tr | + | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">List of resample filter to be used with ''rmFineResample''</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfBox'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Equivalent of simple stretch with high quality and pixel-centered coordinates</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rfLinear'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Linear interpolation giving slow transition between pixels</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfHalfCosine'',</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Mix of ''rfLinear'' and ''rfCosine'' giving medium speed stransition between pixels</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rfCosine'',</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Cosine-like interpolation giving fast transition between pixels</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfBicubic'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Simple bi-cubic filter (blurry)</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rfMitchell'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Mitchell filter, good for downsizing interpolation</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfSpline'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Spline filter, good for upsizing interpolation, however slightly blurry</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rfLanczos''2,</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Lanczos with radius 2, blur is corrected</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfLanczos''3,</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Lanczos with radius 3, high contrast</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rfLanczos''4,</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Lanczos with radius 4, high contrast</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rfBestQuality'');</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Best quality using rfMitchell or rfSpline</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ResampleFilterStr'' : '''array'''[TResampleFilter] '''of''' '''string''' =</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">List of strings to represent resample filters</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' StrToResampleFilter(str: '''string'''): TResampleFilter;</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Gives the sample filter represented by a string</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: #f0f0ff;"><td colspan="3">''TFloodfillMode'' = (</td></tr> |
− | <tr | + | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Options when doing a floodfill (also called bucket fill)</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''fmSet'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Pixels that are filled are replaced</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''fmDrawWithTransparency'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Pixels that are filled are drawn upon with the fill color</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''fmProgressive'');</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Pixels that are filled are drawn upon to the extent that the color underneath is similar to the start color. The more different the different is, the less it is drawn upon</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: #f0f0ff;"><td colspan="3">''TMedianOption'' = (moNone, moLowSmooth, moMediumSmooth, moHighSmooth);</td></tr> |
− | <tr | + | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Specifies how much smoothing is applied to the computation of the median</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: white;"><td colspan="3">''TRadialBlurType'' = (</td></tr> |
− | <tr | + | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Specifies the shape of a predefined blur</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rbNormal'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Gaussian-like, pixel importance decreases progressively</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rbDisk'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Disk blur, pixel importance does not decrease progressively</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rbCorona'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Pixel are considered when they are at a certain distance</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rbPrecise'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Gaussian-like, but 10 times smaller than ''rbNormal''</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''rbFast'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Gaussian-like but simplified to be computed faster</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''rbBox'');</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Box blur, pixel importance does not decrease progressively and the pixels are included when they are in a square. This is much faster than ''rbFast'' however you may get square shapes in the resulting image</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr style="background: #f0f0ff;"><td colspan="3">''TBGRAImageFormat'' = (</td></tr> |
− | <tr | + | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">List of image formats</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifUnknown'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Unknown format</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifJpeg'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">JPEG format, opaque, lossy compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">'' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifPng'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">PNG format, transparency, lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifGif'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">GIF format, single transparent color, lossless in theory but only low number of colors allowed</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifBmp'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">BMP format, transparency, no compression. Note that transparency is not supported by all BMP readers so it is not recommended to avoid storing images with transparency in this format</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifIco'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">ICO format, contains different sizes of the same image</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: white;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifPcx'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">PCX format, opaque, rudimentary lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''' | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifPaintDotNet'',</td></tr> |
− | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;"> | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Paint.NET format, layers, lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifLazPaint'',</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">LazPaint format, layers, lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifOpenRaster'',</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">OpenRaster format, layers, lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr | + | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifPsd'',</td></tr> |
− | <tr | + | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Photoshop format, layers, rudimentary lossless compression</td></tr> |
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
− | <tr style="background: #f0f0ff;"><td colspan="3">'''function''' ByteSqrt(value: byte): byte; '''inline''';</td></tr> | + | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifTarga'',</td></tr> |
− | <tr style="background: | + | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Targa format (TGA), transparency, rudimentary lossless compression</td></tr> |
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifTiff'',</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">TIFF format, limited support</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifXwd'',</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">X-Window capture, limited support</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">''ifXPixMap'',</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">X-Pixmap, text encoded image, limited support</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''ifBmpMioMap'');</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">iGO BMP, limited support</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">''DefaultBGRAImageReader'': '''array'''[TBGRAImageFormat] '''of''' TFPCustomImageReaderClass;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">List of stream readers for images</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">''DefaultBGRAImageWriter'': '''array'''[TBGRAImageFormat] '''of''' TFPCustomImageWriterClass;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">List of stream writers for images</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' DetectFileFormat(AFilenameUTF8: '''string'''): TBGRAImageFormat;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Detect the file format of a given file</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''function''' DetectFileFormat(AStream: TStream; ASuggestedExtensionUTF8: '''string''' = ''): TBGRAImageFormat;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Detect the file format of a given stream. ''ASuggestedExtensionUTF8'' can be provided to guess the format</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' SuggestImageFormat(AFilenameOrExtensionUTF8: '''string'''): TBGRAImageFormat;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Returns the file format that is most likely to be stored in the given filename (according to its extension)</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: #f0f0ff;">'''function''' CreateBGRAImageReader(AFormat: TBGRAImageFormat): TFPCustomImageReader;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: #f0f0ff;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Create an image reader for the given format</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr><td width="10%"></td><td colspan="2" style="background: white;">'''function''' CreateBGRAImageWriter(AFormat: TBGRAImageFormat; AHasTransparentPixels: boolean): TFPCustomImageWriter;</td></tr> | ||
+ | <tr><td width="10%"></td><td width="10%" style="background: white;"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;">Create an image writer for the given format. ''AHasTransparentPixels'' specifies if alpha channel must be supported</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr style="background: #f0f0ff;"><td colspan="3">'''function''' PositiveMod(value, cycle: Int32'''or'''64): Int32'''or'''64; '''inline'''; '''overload''';</td></tr> | ||
+ | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Computes the value modulo cycle, and if the ''value'' is negative, the result is still positive</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr style="background: white;"><td colspan="3">'''function''' Sin65536(value: word): Int32'''or'''64; '''inline''';</td></tr> | ||
+ | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Returns an integer approximation of the sine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr style="background: #f0f0ff;"><td colspan="3">'''function''' Cos65536(value: word): Int32'''or'''64; '''inline''';</td></tr> | ||
+ | <tr style="background: #f0f0ff;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Returns an integer approximation of the cosine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle</td></tr> | ||
+ | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
+ | <tr style="background: white;"><td colspan="3">'''function''' ByteSqrt(value: byte): byte; '''inline''';</td></tr> | ||
+ | <tr style="background: white;"><td width="10%"></td><td style="border: 1px solid #e0e0a0; background: #ffffe4;" colspan="2">Returns the square root of the given byte, considering that 255 is equal to unity</td></tr> | ||
<tr style="height: 8px;"><td colspan="3"></td></tr> | <tr style="height: 8px;"><td colspan="3"></td></tr> | ||
</table> | </table> |
Revision as of 01:13, 30 April 2015
Miscellaneous types in BGRABitmap.
Miscellaneous types
TRawImageLineOrder = ( | ||
Order of the lines in an image | ||
riloTopToBottom, | ||
The first line in memory (line 0) is the top line | ||
riloBottomToTop); | ||
The first line in memory (line 0) is the bottom line | ||
TRawImageBitOrder = ( | ||
Order of the bits in a byte containing pixel values | ||
riboBitsInOrder, | ||
The lowest bit is on the left. So with a monochrome picture, bit 0 would be pixel 0 | ||
riboReversedBits); | ||
The lowest bit is on the right. So with a momochrome picture, bit 0 would be pixel 7 (bit 1 would be pixel 6, ...) | ||
TRawImageByteOrder = ( | ||
Order of the bytes in a group of byte containing pixel values | ||
riboLSBFirst, | ||
Least significant byte first (little endian) | ||
riboMSBFirst); | ||
most significant byte first (big endian) | ||
TGraphicsBevelCut = | ||
Definition of a single line 3D bevel | ||
bvNone, | ||
No bevel | ||
bvLowered, | ||
Shape is lowered, light is on the bottom-right corner | ||
bvRaised, | ||
Shape is raised, light is on the top-left corner | ||
bvSpace); | ||
Shape is at the same level, there is no particular lighting | ||
TBGRAFontQuality = ( | ||
Quality to be used to render text | ||
fqSystem, | ||
Use the system capabilities. It is rather fast however it may be not be smoothed. | ||
fqSystemClearType, | ||
Use the system capabilities to render with ClearType. This quality is of course better than fqSystem however it may not be perfect. | ||
fqFineAntialiasing, | ||
Garanties a high quality antialiasing. | ||
fqFineClearTypeRGB, | ||
Fine antialiasing with ClearType in assuming an LCD display in red/green/blue order | ||
fqFineClearTypeBGR); | ||
Fine antialiasing with ClearType in assuming an LCD display in blue/green/red order | ||
TFontPixelMetric = record | ||
Measurements of a font | ||
Defined: boolean; | ||
The values have been computed | ||
Baseline, | ||
Position of the baseline, where most letters lie | ||
xLine, | ||
Position of the top of the small letters (x being one of them) | ||
CapLine, | ||
Position of the top of the UPPERCASE letters | ||
DescentLine, | ||
Position of the bottom of letters like g and p | ||
Lineheight: integer; | ||
Total line height including line spacing defined by the font | ||
TFontVerticalAnchor = ( | ||
Vertical anchoring of the font. When text is drawn, a start coordinate is necessary. Text can be positioned in different ways. This enum defines what position it is regarding the font | ||
fvaTop, | ||
The top of the font. Everything will be drawn below the start coordinate. | ||
fvaCenter, | ||
The center of the font | ||
fvaCapLine, | ||
The top of capital letters | ||
fvaCapCenter, | ||
The center of capital letters | ||
fvaXLine, | ||
The top of small letters | ||
fvaXCenter, | ||
The center of small letters | ||
fvaBaseline, | ||
The baseline, the bottom of most letters | ||
fvaDescentLine, | ||
The bottom of letters that go below the baseline | ||
fvaBottom); | ||
The bottom of the font. Everything will be drawn above the start coordinate | ||
TWordBreakHandler = procedure(var ABeforeUTF8, AAfterUTF8: string) of object; | ||
Definition of a function that handles work-break | ||
TBGRATypeWriterAlignment = (twaTopLeft, twaTop, twaTopRight, twaLeft, twaMiddle, twaRight, twaBottomLeft, twaBottom, twaBottomRight); | ||
Alignment for a typewriter, that does not have any more information than a square shape containing glyphs | ||
TBGRATypeWriterOutlineMode = (twoPath, twoFill, twoStroke, twoFillOverStroke, twoStrokeOverFill, twoFillThenStroke, twoStrokeThenFill); | ||
How a typewriter must render its content on a Canvas2d | ||
TBGRACustomFontRenderer = class | ||
Abstract class for all font renderers | ||
FontName: string; | ||
Specifies the font to use. Unless the font renderer accept otherwise, the name is in human readable form, like 'Arial', 'Times New Roman', ... | ||
FontStyle: TFontStyles; | ||
Specifies the set of styles to be applied to the font. These can be fsBold, fsItalic, fsStrikeOut, fsUnderline. So the value [fsBold,fsItalic] means that the font must be bold and italic | ||
FontQuality : TBGRAFontQuality; | ||
Specifies the quality of rendering. Default value is fqSystem | ||
FontOrientation: integer; | ||
Specifies the rotation of the text, for functions that support text rotation. It is expressed in tenth of degrees, positive values going counter-clockwise | ||
FontEmHeight: integer; | ||
Specifies the height of the font without taking into account additional line spacing. A negative value means that it is the full height instead | ||
function GetFontPixelMetric: TFontPixelMetric; virtual; abstract; | ||
Returns measurement for the current font in pixels | ||
function TextSize(sUTF8: string): TSize; virtual; abstract; | ||
Returns the total size of the string provided using the current font. Orientation is not taken into account, so that the width is along the text | ||
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; c: TBGRAPixel; align: TAlignment); virtual; abstract; | ||
Draws the UTF8 encoded string, with color c. If align is taLeftJustify, (x,y) is the top-left corner. If align is taCenter, (x,y) is at the top and middle of the text. If align is taRightJustify, (x,y) is the top-right corner. The value of FontOrientation is taken into account, so that the text may be rotated | ||
procedure TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: string; texture: IBGRAScanner; align: TAlignment); virtual; abstract; | ||
Same as above functions, except that the text is filled using texture. The value of FontOrientation is taken into account, so that the text may be rotated | ||
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; c: TBGRAPixel; align: TAlignment); virtual; abstract; | ||
Same as above, except that the orientation is specified, overriding the value of the property FontOrientation | ||
procedure TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: string; texture: IBGRAScanner; align: TAlignment); virtual; abstract; | ||
Same as above, except that the orientation is specified, overriding the value of the property FontOrientation | ||
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; c: TBGRAPixel); virtual; abstract; | ||
Draw the UTF8 encoded string at the coordinate (x,y), clipped inside the rectangle ARect. Additional style information is provided by the style parameter. The color c is used to fill the text. No rotation is applied. | ||
procedure TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: string; style: TTextStyle; texture: IBGRAScanner); virtual; abstract; | ||
Same as above except a texture is used to fill the text | ||
procedure CopyTextPathTo({%H-}ADest: IBGRAPath; {%H-}x, {%H-}y: single; {%H-}s: string; {%H-}align: TAlignment); virtual; //optional | ||
Copy the path for the UTF8 encoded string into ADest. If align is taLeftJustify, (x,y) is the top-left corner. If align is taCenter, (x,y) is at the top and middle of the text. If align is taRightJustify, (x,y) is the top-right corner. | ||
TBGRATextOutImproveReadabilityMode = (irMask, irNormal, irClearTypeRGB, irClearTypeBGR); | ||
Output mode for the improved renderer for readability. This is used by the font renderer based on LCL in BGRAText | ||
function CleanTextOutString(s: string): string; | ||
Removes line ending and tab characters from a string (for a function like TextOut that does not handle this). this works with UTF8 strings as well | ||
function RemoveLineEnding(var s: string; indexByte: integer): boolean; | ||
Remove the line ending at the specified position or return False. This works with UTF8 strings however the index is the byte index | ||
function RemoveLineEndingUTF8(var sUTF8: string; indexUTF8: integer): boolean; | ||
Remove the line ending at the specified position or return False. The index is the character index, that may be different from the byte index | ||
procedure BGRADefaultWordBreakHandler(var ABefore, AAfter: string); | ||
Default word break handler, that simply divide when there is a space | ||
TResampleMode = ( | ||
How the resample is to be computed | ||
rmSimpleStretch, | ||
Low quality resample by repeating pixels, stretching them | ||
rmFineResample); | ||
Use resample filters. This gives high quality resampling however this the proportion changes slightly because the first and last pixel are considered to occupy only half a unit as they are considered as the border of the picture (pixel-centered coordinates) | ||
TResampleFilter = ( | ||
List of resample filter to be used with rmFineResample | ||
rfBox, | ||
Equivalent of simple stretch with high quality and pixel-centered coordinates | ||
rfLinear, | ||
Linear interpolation giving slow transition between pixels | ||
rfHalfCosine, | ||
Mix of rfLinear and rfCosine giving medium speed stransition between pixels | ||
rfCosine, | ||
Cosine-like interpolation giving fast transition between pixels | ||
rfBicubic, | ||
Simple bi-cubic filter (blurry) | ||
rfMitchell, | ||
Mitchell filter, good for downsizing interpolation | ||
rfSpline, | ||
Spline filter, good for upsizing interpolation, however slightly blurry | ||
rfLanczos2, | ||
Lanczos with radius 2, blur is corrected | ||
rfLanczos3, | ||
Lanczos with radius 3, high contrast | ||
rfLanczos4, | ||
Lanczos with radius 4, high contrast | ||
rfBestQuality); | ||
Best quality using rfMitchell or rfSpline | ||
ResampleFilterStr : array[TResampleFilter] of string = | ||
List of strings to represent resample filters | ||
function StrToResampleFilter(str: string): TResampleFilter; | ||
Gives the sample filter represented by a string | ||
TFloodfillMode = ( | ||
Options when doing a floodfill (also called bucket fill) | ||
fmSet, | ||
Pixels that are filled are replaced | ||
fmDrawWithTransparency, | ||
Pixels that are filled are drawn upon with the fill color | ||
fmProgressive); | ||
Pixels that are filled are drawn upon to the extent that the color underneath is similar to the start color. The more different the different is, the less it is drawn upon | ||
TMedianOption = (moNone, moLowSmooth, moMediumSmooth, moHighSmooth); | ||
Specifies how much smoothing is applied to the computation of the median | ||
TRadialBlurType = ( | ||
Specifies the shape of a predefined blur | ||
rbNormal, | ||
Gaussian-like, pixel importance decreases progressively | ||
rbDisk, | ||
Disk blur, pixel importance does not decrease progressively | ||
rbCorona, | ||
Pixel are considered when they are at a certain distance | ||
rbPrecise, | ||
Gaussian-like, but 10 times smaller than rbNormal | ||
rbFast, | ||
Gaussian-like but simplified to be computed faster | ||
rbBox); | ||
Box blur, pixel importance does not decrease progressively and the pixels are included when they are in a square. This is much faster than rbFast however you may get square shapes in the resulting image | ||
TBGRAImageFormat = ( | ||
List of image formats | ||
ifUnknown, | ||
Unknown format | ||
ifJpeg, | ||
JPEG format, opaque, lossy compression | ||
ifPng, | ||
PNG format, transparency, lossless compression | ||
ifGif, | ||
GIF format, single transparent color, lossless in theory but only low number of colors allowed | ||
ifBmp, | ||
BMP format, transparency, no compression. Note that transparency is not supported by all BMP readers so it is not recommended to avoid storing images with transparency in this format | ||
ifIco, | ||
ICO format, contains different sizes of the same image | ||
ifPcx, | ||
PCX format, opaque, rudimentary lossless compression | ||
ifPaintDotNet, | ||
Paint.NET format, layers, lossless compression | ||
ifLazPaint, | ||
LazPaint format, layers, lossless compression | ||
ifOpenRaster, | ||
OpenRaster format, layers, lossless compression | ||
ifPsd, | ||
Photoshop format, layers, rudimentary lossless compression | ||
ifTarga, | ||
Targa format (TGA), transparency, rudimentary lossless compression | ||
ifTiff, | ||
TIFF format, limited support | ||
ifXwd, | ||
X-Window capture, limited support | ||
ifXPixMap, | ||
X-Pixmap, text encoded image, limited support | ||
ifBmpMioMap); | ||
iGO BMP, limited support | ||
DefaultBGRAImageReader: array[TBGRAImageFormat] of TFPCustomImageReaderClass; | ||
List of stream readers for images | ||
DefaultBGRAImageWriter: array[TBGRAImageFormat] of TFPCustomImageWriterClass; | ||
List of stream writers for images | ||
function DetectFileFormat(AFilenameUTF8: string): TBGRAImageFormat; | ||
Detect the file format of a given file | ||
function DetectFileFormat(AStream: TStream; ASuggestedExtensionUTF8: string = ): TBGRAImageFormat; | ||
Detect the file format of a given stream. ASuggestedExtensionUTF8 can be provided to guess the format | ||
function SuggestImageFormat(AFilenameOrExtensionUTF8: string): TBGRAImageFormat; | ||
Returns the file format that is most likely to be stored in the given filename (according to its extension) | ||
function CreateBGRAImageReader(AFormat: TBGRAImageFormat): TFPCustomImageReader; | ||
Create an image reader for the given format | ||
function CreateBGRAImageWriter(AFormat: TBGRAImageFormat; AHasTransparentPixels: boolean): TFPCustomImageWriter; | ||
Create an image writer for the given format. AHasTransparentPixels specifies if alpha channel must be supported | ||
function PositiveMod(value, cycle: Int32or64): Int32or64; inline; overload; | ||
Computes the value modulo cycle, and if the value is negative, the result is still positive | ||
function Sin65536(value: word): Int32or64; inline; | ||
Returns an integer approximation of the sine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle | ||
function Cos65536(value: word): Int32or64; inline; | ||
Returns an integer approximation of the cosine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle | ||
function ByteSqrt(value: byte): byte; inline; | ||
Returns the square root of the given byte, considering that 255 is equal to unity | ||