BGRABitmap Miscellaneous types: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: BGRABitmap Miscellaneous types
| Old | New | Line | |
|---|---|---|---|
| 1 | + | Miscellaneous types in [[BGRABitmap]]. They are provided by _BGRABitmapTypes_ unit. | |
| 2 | + | ||
| 3 | + | ## Contents | |
| 4 | + | ||
| 5 | + | * 1 Miscellaneous types | |
| 6 | + | * 1.1 Imported from GraphType | |
| 7 | + | * 1.2 Integer math | |
| 8 | + | * 1.3 Types provided for fonts | |
| 9 | + | * 1.4 Images and resampling | |
| 10 | + | ||
| 11 | + | ### Miscellaneous types | |
| 12 | + | ||
| 13 | + | **const** BGRABitmapVersion = 11050800; | |
| 14 | + | --- | |
| 15 | + | | Current version expressed as an integer with each part multiplied by 100 | |
| 16 | + | **function** BGRABitmapVersionStr: **string** ; | |
| 17 | + | | String representation of the version, numbers separated by dots | |
| 18 | + | _TMultiFileContainer_ = BGRAMultiFileType.TMultiFileContainer; | |
| 19 | + | | Generic definition of a multifile container | |
| 20 | + | _Int32or64_ = BGRAClasses.Int32or64; | |
| 21 | + | | Signed integer value of at least 32 bits | |
| 22 | + | _UInt32or64_ = BGRAClasses.UInt32or64; | |
| 23 | + | | Unsigned integer value of at least 32 bits | |
| 24 | + | _HDC_ = {$**ifdef** BGRABITMAP_USE_LCL}LCLType.HDC{$**else**}PtrUInt{$**endif**}; | |
| 25 | + | | Device context handle (using LCL if available) | |
| 26 | + | _TFloodfillMode_ = ( | |
| 27 | + | | Options when doing a floodfill (also called bucket fill) | |
| 28 | + | | _fmSet_ , | |
| 29 | + | | | Pixels that are filled are replaced | |
| 30 | + | | _fmDrawWithTransparency_ , | |
| 31 | + | | | Pixels that are filled are drawn upon with the fill color | |
| 32 | + | | _fmLinearBlend_ , | |
| 33 | + | | | Pixels that are filled are drawn without gamma correction upon with the fill color | |
| 34 | + | | _fmXor_ , | |
| 35 | + | | | Pixels that are XORed with the fill color | |
| 36 | + | | _fmProgressive_); | |
| 37 | + | | | 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 | |
| 38 | + | _TMedianOption_ = (moNone, moLowSmooth, moMediumSmooth, moHighSmooth); | |
| 39 | + | | Specifies how much smoothing is applied to the computation of the median | |
| 40 | + | _TRadialBlurType_ = ( | |
| 41 | + | | Specifies the shape of a predefined blur | |
| 42 | + | | _rbNormal_ , | |
| 43 | + | | | Gaussian-like, pixel importance decreases progressively | |
| 44 | + | | _rbDisk_ , | |
| 45 | + | | | Disk blur, pixel importance does not decrease progressively | |
| 46 | + | | _rbCorona_ , | |
| 47 | + | | | Pixel are considered when they are at a certain distance | |
| 48 | + | | _rbPrecise_ , | |
| 49 | + | | | Gaussian-like, but 10 times smaller than _rbNormal_ | |
| 50 | + | | _rbFast_ , | |
| 51 | + | | | Gaussian-like but simplified to be computed faster | |
| 52 | + | | _rbBox_); | |
| 53 | + | | | 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 | |
| 54 | + | | **const** RadialBlurTypeToStr: **array**[TRadialBlurType] **of** **string** = | |
| 55 | + | | | String constants to represent TRadialBlurType values | |
| 56 | + | _TEmbossOption_ = ( | |
| 57 | + | | Possible options when applying emboss filter | |
| 58 | + | | _eoTransparent_ , | |
| 59 | + | | | Transparent output except when there borders were detected | |
| 60 | + | | _eoPreserveHue_); | |
| 61 | + | | | Preserve the original hue | |
| 62 | + | | _TEmbossOptions_ = **set** **of** TEmbossOption; | |
| 63 | + | | | Sets of emboss options | |
| 64 | + | _TBGRAImageFormat_ = ( | |
| 65 | + | | List of image formats | |
| 66 | + | | _ifUnknown_ , | |
| 67 | + | | | Unknown format | |
| 68 | + | | _ifJpeg_ , | |
| 69 | + | | | JPEG format, opaque, lossy compression | |
| 70 | + | | _ifPng_ , | |
| 71 | + | | | PNG format, transparency, lossless compression. Can be animated (see BGRAAnimatedGif) | |
| 72 | + | | _ifGif_ , | |
| 73 | + | | | GIF format, single transparent color, lossless in theory but only low number of colors allowed. Can be animated (see BGRAAnimatedGif) | |
| 74 | + | | _ifBmp_ , | |
| 75 | + | | | BMP format, transparency, no compression. Note that transparency is not supported by all BMP readers so it is recommended to avoid storing images with transparency in this format | |
| 76 | + | | _ifBmpMioMap_ , | |
| 77 | + | | | iGO BMP (16-bit, rudimentary lossless compression) | |
| 78 | + | | _ifIco_ , | |
| 79 | + | | | ICO format, contains different sizes of the same image | |
| 80 | + | | _ifCur_ , | |
| 81 | + | | | CUR format, has hotspot, contains different sizes of the same image | |
| 82 | + | | _ifPcx_ , | |
| 83 | + | | | PCX format, opaque, rudimentary lossless compression | |
| 84 | + | | _ifPaintDotNet_ , | |
| 85 | + | | | Paint.NET format, layers, lossless compression | |
| 86 | + | | _ifLazPaint_ , | |
| 87 | + | | | LazPaint format, layers, lossless compression | |
| 88 | + | | _ifOpenRaster_ , | |
| 89 | + | | | OpenRaster format, layers, lossless compression | |
| 90 | + | | _ifPhoxo_ , | |
| 91 | + | | | Phoxo format, layers | |
| 92 | + | | _ifPsd_ , | |
| 93 | + | | | Photoshop format, layers, rudimentary lossless compression | |
| 94 | + | | _ifTarga_ , | |
| 95 | + | | | Targa format (TGA), transparency, rudimentary lossless compression | |
| 96 | + | | _ifTiff_ , | |
| 97 | + | | | TIFF format, limited support | |
| 98 | + | | _ifXwd_ , | |
| 99 | + | | | X-Window capture, limited support | |
| 100 | + | | _ifXPixMap_ , | |
| 101 | + | | | X-Pixmap, text encoded image, limited support | |
| 102 | + | | _ifPortableAnyMap_ , | |
| 103 | + | | | text or binary encoded image, no compression, extension PBM, PGM, PPM | |
| 104 | + | | _ifSvg_ , | |
| 105 | + | | | Scalable Vector Graphic, vectorial, read-only as raster | |
| 106 | + | | _ifWebP_ , | |
| 107 | + | | | Lossless or lossy compression using V8 algorithm (need libwebp library) | |
| 108 | + | | _ifAvif_ | |
| 109 | + | | | Lossless or lossy compression using Avif algorithm (need libavif library) | |
| 110 | + | | _DefaultBGRAImageReader_ : **array**[TBGRAImageFormat] **of** TFPCustomImageReaderClass; | |
| 111 | + | | | List of stream readers for images | |
| 112 | + | | _DefaultBGRAImageWriter_ : **array**[TBGRAImageFormat] **of** TFPCustomImageWriterClass; | |
| 113 | + | | | List of stream writers for images | |
| 114 | + | | **function** DetectFileFormat(AFilenameUTF8: **string**): TBGRAImageFormat; | |
| 115 | + | | | Detect the file format of a given file | |
| 116 | + | | **function** DetectFileFormat(AStream: TStream; ASuggestedExtensionUTF8: **string** = ''): TBGRAImageFormat; | |
| 117 | + | | | Detect the file format of a given stream. _ASuggestedExtensionUTF8_ can be provided to guess the format | |
| 118 | + | | **function** SuggestImageFormat(AFilenameOrExtensionUTF8: **string**): TBGRAImageFormat; | |
| 119 | + | | | Returns the file format that is most likely to be stored in the given filename (according to its extension) | |
| 120 | + | | **function** SuggestImageExtension(AFormat: TBGRAImageFormat): **string** ; | |
| 121 | + | | | Returns a likely image extension for the format | |
| 122 | + | | **function** CreateBGRAImageReader(AFormat: TBGRAImageFormat): TFPCustomImageReader; | |
| 123 | + | | | Create an image reader for the given format | |
| 124 | + | | **function** CreateBGRAImageWriter(AFormat: TBGRAImageFormat; AHasTransparentPixels: boolean): TFPCustomImageWriter; | |
| 125 | + | | | Create an image writer for the given format. _AHasTransparentPixels_ specifies if alpha channel must be supported | |
| 126 | + | _TBGRALoadingOption_ = ( | |
| 127 | + | | Possible options when loading an image | |
| 128 | + | | _loKeepTransparentRGB_ , | |
| 129 | + | | | Do not clear RGB channels when alpha is zero (not recommended) | |
| 130 | + | | _loBmpAutoOpaque_ , | |
| 131 | + | | | Consider BMP to be opaque if no alpha value is provided (for compatibility) | |
| 132 | + | | _loJpegQuick_); | |
| 133 | + | | | Load JPEG quickly however with a lower quality | |
| 134 | + | | _TBGRALoadingOptions_ = **set** **of** TBGRALoadingOption; | |
| 135 | + | | | Set of options when loading | |
| 136 | + | _TTextLayout_ = BGRAGraphics.TTextLayout; | |
| 137 | + | | Text layout (vertical position) | |
| 138 | + | | _tlTop_ = BGRAGraphics.tlTop; | |
| 139 | + | | | Text aligned to the top | |
| 140 | + | | _tlCenter_ = BGRAGraphics.tlCenter; | |
| 141 | + | | | Text aligned vertically to the center | |
| 142 | + | | _tlBottom_ = BGRAGraphics.tlBottom; | |
| 143 | + | | | Text aligned to the bottom | |
| 144 | + | _TFontBidiMode_ = BGRAUnicode.TFontBidiMode; | |
| 145 | + | | Bidi-mode preference (right-to-left or left-to-right) | |
| 146 | + | | _fbmAuto_ = BGRAUnicode.fbmAuto; | |
| 147 | + | | | Automatic bidi-mode, depending on first letter type | |
| 148 | + | | _fbmLeftToRight_ = BGRAUnicode.fbmLeftToRight; | |
| 149 | + | | | Always left-to-right (but can embed another direction) | |
| 150 | + | | _fbmRightToLeft_ = BGRAUnicode.fbmRightToLeft; | |
| 151 | + | | | Always right-to-left (but can embed another direction) | |
| 152 | + | _TBidiTextAlignment_ = ( | |
| 153 | + | | Alignment relative to the bidi-mode | |
| 154 | + | | _btaNatural_ , | |
| 155 | + | | | Natural alignment: left-aligned for left-to-right and right-aligned for right-to-left text | |
| 156 | + | | _btaOpposite_ , | |
| 157 | + | | | Opposite of natural alignment | |
| 158 | + | | _btaLeftJustify_ , | |
| 159 | + | | | Always left-aligned | |
| 160 | + | | _btaRightJustify_ , | |
| 161 | + | | | Always right-aligned | |
| 162 | + | | _btaCenter_); | |
| 163 | + | | | Centered | |
| 164 | + | | **function** AlignmentToBidiTextAlignment(AAlign: TAlignment; ARightToLeft: boolean): TBidiTextAlignment; **overload** ; | |
| 165 | + | | | Converts an alignment to a bidi alignement relative to a bidi-mode | |
| 166 | + | | **function** AlignmentToBidiTextAlignment(AAlign: TAlignment): TBidiTextAlignment; **overload** ; | |
| 167 | + | | | Converts an alignment to a bidi alignement independent of bidi-mode | |
| 168 | + | | **function** BidiTextAlignmentToAlignment(ABidiAlign: TBidiTextAlignment; ARightToLeft: boolean): TAlignment; | |
| 169 | + | | | Converts a bidi alignment to a classic alignement according to bidi-mode | |
| 170 | + | **function** CheckPutImageBounds(x, y, tx, ty: integer; **out** minxb, minyb, maxxb, maxyb, ignoreleft: integer; **const** cliprect: TRect): boolean; | |
| 171 | + | | Checks the bounds of an image in the given clipping rectangle | |
| 172 | + | ||
| 173 | + | #### Imported from GraphType | |
| 174 | + | ||
| 175 | + | _TRawImageLineOrder_ = ( | |
| 176 | + | --- | |
| 177 | + | | Order of the lines in an image | |
| 178 | + | | _riloTopToBottom_ , | |
| 179 | + | | | The first line in memory (line 0) is the top line | |
| 180 | + | | _riloBottomToTop_); | |
| 181 | + | | | The first line in memory (line 0) is the bottom line | |
| 182 | + | _TRawImageBitOrder_ = ( | |
| 183 | + | | Order of the bits in a byte containing pixel values | |
| 184 | + | | _riboBitsInOrder_ , | |
| 185 | + | | | The lowest bit is on the left. So with a monochrome picture, bit 0 would be pixel 0 | |
| 186 | + | | _riboReversedBits_); | |
| 187 | + | | | The lowest bit is on the right. So with a momochrome picture, bit 0 would be pixel 7 (bit 1 would be pixel 6, ...) | |
| 188 | + | _TRawImageByteOrder_ = ( | |
| 189 | + | | Order of the bytes in a group of byte containing pixel values | |
| 190 | + | | _riboLSBFirst_ , | |
| 191 | + | | | Least significant byte first (little endian) | |
| 192 | + | | _riboMSBFirst_); | |
| 193 | + | | | most significant byte first (big endian) | |
| 194 | + | _TGraphicsBevelCut_ = | |
| 195 | + | | Definition of a single line 3D bevel | |
| 196 | + | | _bvNone_ , | |
| 197 | + | | | No bevel | |
| 198 | + | | _bvLowered_ , | |
| 199 | + | | | Shape is lowered, light is on the bottom-right corner | |
| 200 | + | | _bvRaised_ , | |
| 201 | + | | | Shape is raised, light is on the top-left corner | |
| 202 | + | | _bvSpace_); | |
| 203 | + | | | Shape is at the same level, there is no particular lighting | |
| 204 | + | ||
| 205 | + | #### Integer math | |
| 206 | + | ||
| 207 | + | **function** PositiveMod(value, cycle: Int32or64): Int32or64; **inline** ; **overload** ; | |
| 208 | + | --- | |
| 209 | + | | Computes the value modulo cycle, and if the _value_ is negative, the result is still positive | |
| 210 | + | **function** Sin65536(value: word): Int32or64; **inline** ; | |
| 211 | + | | Returns an integer approximation of the sine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle | |
| 212 | + | **function** Cos65536(value: word): Int32or64; **inline** ; | |
| 213 | + | | Returns an integer approximation of the cosine. Value ranges from 0 to 65535, where 65536 corresponds to the next cycle | |
| 214 | + | **function** ByteSqrt(value: byte): byte; **inline** ; | |
| 215 | + | | Returns the square root of the given byte, considering that 255 is equal to unity | |
| 216 | + | ||
| 217 | + | #### Types provided for fonts | |
| 218 | + | ||
| 219 | + | _TBGRAFontQuality_ = ( | |
| 220 | + | --- | |
| 221 | + | | Quality to be used to render text | |
| 222 | + | | _fqSystem_ , | |
| 223 | + | | | Use the system capabilities. It is rather fast however it may be not be smoothed. | |
| 224 | + | | _fqSystemClearType_ , | |
| 225 | + | | | Use the system capabilities to render with ClearType. This quality is of course better than _fqSystem_ however it may not be perfect. | |
| 226 | + | | _fqFineAntialiasing_ , | |
| 227 | + | | | Garanties a high quality antialiasing. | |
| 228 | + | | _fqFineClearTypeRGB_ , | |
| 229 | + | | | Fine antialiasing with ClearType assuming an LCD display in red/green/blue order | |
| 230 | + | | _fqFineClearTypeBGR_); | |
| 231 | + | | | Fine antialiasing with ClearType assuming an LCD display in blue/green/red order | |
| 232 | + | | _TGetFineClearTypeAutoFunc_ = **function**(): TBGRAFontQuality; | |
| 233 | + | | | Function type to detect the adequate ClearType mode | |
| 234 | + | | _fqFineClearType_ : TGetFineClearTypeAutoFunc; | |
| 235 | + | | | Provide function to detect the adequate ClearType mode | |
| 236 | + | _TFontPixelMetric_ = **record** | |
| 237 | + | | Measurements of a font | |
| 238 | + | | _Defined_ : boolean; | |
| 239 | + | | | The values have been computed | |
| 240 | + | | _Baseline_ , | |
| 241 | + | | | Position of the baseline, where most letters lie | |
| 242 | + | | _xLine_ , | |
| 243 | + | | | Position of the top of the small letters (x being one of them) | |
| 244 | + | | _CapLine_ , | |
| 245 | + | | | Position of the top of the UPPERCASE letters | |
| 246 | + | | _DescentLine_ , | |
| 247 | + | | | Position of the bottom of letters like g and p | |
| 248 | + | | _Lineheight_ : integer; | |
| 249 | + | | | Total line height including line spacing defined by the font | |
| 250 | + | _TFontPixelMetricF_ = **record** | |
| 251 | + | | Measurements of a font in floating point values | |
| 252 | + | | _Defined_ : boolean; | |
| 253 | + | | | The values have been computed | |
| 254 | + | | _Baseline_ , | |
| 255 | + | | | Position of the baseline, where most letters lie | |
| 256 | + | | _xLine_ , | |
| 257 | + | | | Position of the top of the small letters (x being one of them) | |
| 258 | + | | _CapLine_ , | |
| 259 | + | | | Position of the top of the UPPERCASE letters | |
| 260 | + | | _DescentLine_ , | |
| 261 | + | | | Position of the bottom of letters like g and p | |
| 262 | + | | _Lineheight_ : single; | |
| 263 | + | | | Total line height including line spacing defined by the font | |
| 264 | + | _TFontVerticalAnchor_ = ( | |
| 265 | + | | 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 | |
| 266 | + | | _fvaTop_ , | |
| 267 | + | | | The top of the font. Everything will be drawn below the start coordinate. | |
| 268 | + | | _fvaCenter_ , | |
| 269 | + | | | The center of the font | |
| 270 | + | | _fvaCapLine_ , | |
| 271 | + | | | The top of capital letters | |
| 272 | + | | _fvaCapCenter_ , | |
| 273 | + | | | The center of capital letters | |
| 274 | + | | _fvaXLine_ , | |
| 275 | + | | | The top of small letters | |
| 276 | + | | _fvaXCenter_ , | |
| 277 | + | | | The center of small letters | |
| 278 | + | | _fvaBaseline_ , | |
| 279 | + | | | The baseline, the bottom of most letters | |
| 280 | + | | _fvaDescentLine_ , | |
| 281 | + | | | The bottom of letters that go below the baseline | |
| 282 | + | | _fvaBottom_); | |
| 283 | + | | | The bottom of the font. Everything will be drawn above the start coordinate | |
| 284 | + | _TWordBreakHandler_ = **procedure**(**var** ABeforeUTF8, AAfterUTF8: **string**) **of** **object** ; | |
| 285 | + | | Definition of a function that handles work-break | |
| 286 | + | _TBGRATypeWriterAlignment_ = (twaTopLeft, twaTop, twaTopRight, twaLeft, twaMiddle, twaRight, twaBottomLeft, twaBottom, twaBottomRight); | |
| 287 | + | | Alignment for a typewriter, that does not have any more information than a square shape containing glyphs | |
| 288 | + | _TBGRATypeWriterOutlineMode_ = (twoPath, twoFill, twoStroke, twoFillOverStroke, twoStrokeOverFill, twoFillThenStroke, twoStrokeThenFill); | |
| 289 | + | | How a typewriter must render its content on a Canvas2d | |
| 290 | + | _TBGRACustomFontRenderer_ = **class** | |
| 291 | + | | Abstract class for all font renderers | |
| 292 | + | | _FFontEmHeightF_ : single; | |
| 293 | + | | | Specifies the height of the font without taking into account additional line spacing. A negative value means that it is the full height instead | |
| 294 | + | | **function** GetFontEmHeight: integer; | |
| 295 | + | | | Retrieves the em-height of the font | |
| 296 | + | | **procedure** SetFontEmHeight(AValue: integer); | |
| 297 | + | | | Sets the font height as em-height | |
| 298 | + | | _FontName_ : **string** ; | |
| 299 | + | | | Specifies the font to use. Unless the font renderer accept otherwise, the name is in human readable form, like 'Arial', 'Times New Roman', ... | |
| 300 | + | | _FontStyle_ : TFontStyles; | |
| 301 | + | | | 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 | |
| 302 | + | | _FontQuality_ : TBGRAFontQuality; | |
| 303 | + | | | Specifies the quality of rendering. Default value is fqSystem | |
| 304 | + | | _FontOrientation_ : integer; | |
| 305 | + | | | Specifies the rotation of the text, for functions that support text rotation. It is expressed in tenth of degrees, positive values going counter-clockwise | |
| 306 | + | | **function** GetFontPixelMetric: TFontPixelMetric; **virtual** ; **abstract** ; | |
| 307 | + | | | Returns measurement for the current font in pixels | |
| 308 | + | | **function** GetFontPixelMetricF: TFontPixelMetricF; **virtual** ; | |
| 309 | + | | | Returns measurement for the current font in fractional pixels | |
| 310 | + | | **function** FontExists(AName: **string**): boolean; **virtual** ; **abstract** ; | |
| 311 | + | | | Checks whether a font exists | |
| 312 | + | | **function** TextVisible(**const** AColor: TBGRAPixel): boolean; **virtual** ; | |
| 313 | + | | | Checks if any text would be visible using the specified color | |
| 314 | + | | **function** TextSize(sUTF8: **string**): TSize; **overload** ; **virtual** ; **abstract** ; | |
| 315 | + | | | Returns the total size of the string provided using the current font. Orientation is not taken into account, so that the width is horizontal | |
| 316 | + | | **function** TextSizeF(sUTF8: **string**): TPointF; **overload** ; **virtual** ; | |
| 317 | + | | | Returns the total floating point size of the string provided using the current font. Orientation is not taken into account, so that the width is horizontal | |
| 318 | + | | **function** TextSize(sUTF8: **string** ; AMaxWidth: integer; ARightToLeft: boolean): TSize; **overload** ; **virtual** ; **abstract** ; | |
| 319 | + | | | Returns the total size of the string provided given a maximum width and RTL mode, using the current font. Orientation is not taken into account, so that the width is along the text | |
| 320 | + | | **function** TextSizeF(sUTF8: **string** ; AMaxWidthF: single; ARightToLeft: boolean): TPointF; **overload** ; **virtual** ; | |
| 321 | + | | | Returns the total floating point size of the string provided given a maximum width and RTL mode, using the current font. Orientation is not taken into account, so that the width is along the text | |
| 322 | + | | **function** TextSizeAngle(sUTF8: **string** ; orientationTenthDegCCW: integer): TSize; **virtual** ; | |
| 323 | + | | | Returns the total size of the string provided using the current font, with the given orientation, along the text | |
| 324 | + | | **function** TextSizeAngleF(sUTF8: **string** ; orientationTenthDegCCW: integer): TPointF; **virtual** ; | |
| 325 | + | | | Returns the total floating-point size of the string provided using the current font, with the given orientation, along the text | |
| 326 | + | | **function** TextFitInfo(sUTF8: **string** ; AMaxWidth: integer): integer; **virtual** ; **abstract** ; | |
| 327 | + | | | Returns the number of Unicode characters that fit into the specified size | |
| 328 | + | | **function** TextFitInfoF(sUTF8: **string** ; AMaxWidthF: single): integer; **virtual** ; | |
| 329 | + | | | Returns the number of Unicode characters that fit into the specified floating-point size | |
| 330 | + | | **procedure** TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: **string** ; c: TBGRAPixel; align: TAlignment); **overload** ; **virtual** ; **abstract** ; | |
| 331 | + | | | 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 | |
| 332 | + | | **procedure** TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: **string** ; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); **overload** ; **virtual** ; | |
| 333 | + | | | Same as above but with given RTL mode | |
| 334 | + | | **procedure** TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: **string** ; texture: IBGRAScanner; align: TAlignment); **overload** ; **virtual** ; **abstract** ; | |
| 335 | + | | | 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 | |
| 336 | + | | **procedure** TextOut(ADest: TBGRACustomBitmap; x, y: single; sUTF8: **string** ; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); **overload** ; **virtual** ; | |
| 337 | + | | | Same as above but with given RTL mode | |
| 338 | + | | **procedure** TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: **string** ; c: TBGRAPixel; align: TAlignment); **overload** ; **virtual** ; **abstract** ; | |
| 339 | + | | | Same as above, except that the orientation is specified, overriding the value of the property _FontOrientation_ | |
| 340 | + | | **procedure** TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: **string** ; c: TBGRAPixel; align: TAlignment; ARightToLeft: boolean); **overload** ; **virtual** ; | |
| 341 | + | | | Same as above but with given RTL mode | |
| 342 | + | | **procedure** TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: **string** ; texture: IBGRAScanner; align: TAlignment); **overload** ; **virtual** ; **abstract** ; | |
| 343 | + | | | Same as above, except that the orientation is specified, overriding the value of the property _FontOrientation_ | |
| 344 | + | | **procedure** TextOutAngle(ADest: TBGRACustomBitmap; x, y: single; orientationTenthDegCCW: integer; sUTF8: **string** ; texture: IBGRAScanner; align: TAlignment; ARightToLeft: boolean); **overload** ; **virtual** ; | |
| 345 | + | | | Same as above but with given RTL mode | |
| 346 | + | | **procedure** TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: **string** ; style: TTextStyle; c: TBGRAPixel); **overload** ; **virtual** ; **abstract** ; | |
| 347 | + | | | 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. | |
| 348 | + | | **procedure** TextRect(ADest: TBGRACustomBitmap; ARect: TRect; x, y: integer; sUTF8: **string** ; style: TTextStyle; texture: IBGRAScanner); **overload** ; **virtual** ; **abstract** ; | |
| 349 | + | | | Same as above except a _texture_ is used to fill the text | |
| 350 | + | | **procedure** CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: **string** ; align: TAlignment); **virtual** ; //optional | |
| 351 | + | | | 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. | |
| 352 | + | | **procedure** CopyTextPathTo(ADest: IBGRAPath; x, y: single; s: **string** ; align: TAlignment; ARightToLeft: boolean); **virtual** ; //optional | |
| 353 | + | | | Same as above but with given RTL mode | |
| 354 | + | | **function** HandlesTextPath: boolean; **virtual** ; | |
| 355 | + | | | Check whether the renderer can produce text path | |
| 356 | + | | **property** FontEmHeight: integer **read** GetFontEmHeight **write** SetFontEmHeight; | |
| 357 | + | | | Font em-height as an integer | |
| 358 | + | | **property** FontEmHeightF: single **read** FFontEmHeightF **write** FFontEmHeightF; | |
| 359 | + | | | Font em-height as a single-precision floating point value | |
| 360 | + | _TBGRATextOutImproveReadabilityMode_ = ( | |
| 361 | + | | Output mode for the improved renderer for readability. This is used by the font renderer based on LCL in BGRAText | |
| 362 | + | | _irMask_ , | |
| 363 | + | | | Render the grayscale mask | |
| 364 | + | | _irNormal_ , | |
| 365 | + | | | Render normally with provided the color or texture | |
| 366 | + | | _irClearTypeRGB_ , | |
| 367 | + | | | Render with ClearType for RGB ordered display | |
| 368 | + | | _irClearTypeBGR_); | |
| 369 | + | | | Render with ClearType for BGR ordered display | |
| 370 | + | **function** CleanTextOutString(**const** s: **string**): **string** ; | |
| 371 | + | | 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 | |
| 372 | + | **function** RemoveLineEnding(**var** s: **string** ; indexByte: integer): boolean; | |
| 373 | + | | Remove the line ending at the specified position or return False. This works with UTF8 strings however the index is the byte index | |
| 374 | + | **function** RemoveLineEndingUTF8(**var** sUTF8: **string** ; indexUTF8: integer): boolean; | |
| 375 | + | | 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 | |
| 376 | + | **procedure** BGRADefaultWordBreakHandler(**var** ABefore, AAfter: **string**); | |
| 377 | + | | Default word break handler | |
| 378 | + | ||
| 379 | + | #### Images and resampling | |
| 380 | + | ||
| 381 | + | _TResampleMode_ = ( | |
| 382 | + | --- | |
| 383 | + | | How the resample is to be computed | |
| 384 | + | | _rmSimpleStretch_ , | |
| 385 | + | | | Low quality resample by repeating pixels, stretching them | |
| 386 | + | | _rmFineResample_); | |
| 387 | + | | | 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) | |
| 388 | + | _TResampleFilter_ = ( | |
| 389 | + | | List of resample filter to be used with _rmFineResample_ | |
| 390 | + | | _rfBox_ , | |
| 391 | + | | | Equivalent of simple stretch with high quality and pixel-centered coordinates | |
| 392 | + | | _rfLinear_ , | |
| 393 | + | | | Linear interpolation giving slow transition between pixels | |
| 394 | + | | _rfHalfCosine_ , | |
| 395 | + | | | Mix of _rfLinear_ and _rfCosine_ giving medium speed stransition between pixels | |
| 396 | + | | _rfCosine_ , | |
| 397 | + | | | Cosine-like interpolation giving fast transition between pixels | |
| 398 | + | | _rfBicubic_ , | |
| 399 | + | | | Simple bi-cubic filter (blurry) | |
| 400 | + | | _rfMitchell_ , | |
| 401 | + | | | Mitchell filter, good for downsizing interpolation | |
| 402 | + | | _rfSpline_ , | |
| 403 | + | | | Spline filter, good for upsizing interpolation, however slightly blurry | |
| 404 | + | | _rfLanczos2_ , | |
| 405 | + | | | Lanczos with radius 2, blur is corrected | |
| 406 | + | | _rfLanczos3_ , | |
| 407 | + | | | Lanczos with radius 3, high contrast | |
| 408 | + | | _rfLanczos4_ , | |
| 409 | + | | | Lanczos with radius 4, high contrast | |
| 410 | + | | _rfBestQuality_); | |
| 411 | + | | | Best quality using rfMitchell or rfSpline | |
| 412 | + | | _ResampleFilterStr_ : **array**[TResampleFilter] **of** **string** = | |
| 413 | + | | | List of strings to represent resample filters | |
| 414 | + | | **function** StrToResampleFilter(str: **string**): TResampleFilter; | |
| 415 | + | | | Gives the sample filter represented by a string | |
| 416 | + | _TQuickImageInfo_ = **record** | |
| 417 | + | | Image information from superficial analysis | |
| 418 | + | | _Width_ , | |
| 419 | + | | | Width in pixels | |
| 420 | + | | _Height_ , | |
| 421 | + | | | Height in pixels | |
| 422 | + | | _ColorDepth_ , | |
| 423 | + | | | Bitdepth for colors (1, 2, 4, 8 for images with palette/grayscale, 16, 24 or 48 if each channel is present) | |
| 424 | + | | _AlphaDepth_ : integer; | |
| 425 | + | | | Bitdepth for alpha (0 if no alpha channel, 1 if bit mask, 8 or 16 if alpha channel) | |
| 426 | + | _TBGRAImageReader_ = **class**(TFPCustomImageReader) | |
| 427 | + | | Bitmap reader with additional features | |
| 428 | + | | **function** GetQuickInfo(AStream: TStream): TQuickImageInfo; **virtual** ; **abstract** ; | |
| 429 | + | | | Return bitmap information (size, bit depth) | |
| 430 | + | | **function** GetBitmapDraft(AStream: TStream; AMaxWidth, AMaxHeight: integer; **out** AOriginalWidth,AOriginalHeight: integer): TBGRACustomBitmap; **virtual** ; **abstract** ; | |
| 431 | + | | | Return a draft of the bitmap, the ratio may change compared to the original width and height (useful to make thumbnails) | |
| 432 | + | _TBGRACustomWriterPNG_ = **class**(TFPCustomImageWriter) | |
| 433 | + | | Generic definition for a PNG writer with alpha option | |
| 434 | + | | **function** GetUseAlpha: boolean; **virtual** ; **abstract** ; | |
| 435 | + | | | Gets whether or not to use the alpha channel | |
| 436 | + | | **procedure** SetUseAlpha(AValue: boolean); **virtual** ; **abstract** ; | |
| 437 | + | | | Sets whether or not to use the alpha channel | |
| 438 | + | | **property** UseAlpha : boolean **read** GetUseAlpha **write** SetUseAlpha; | |
| 439 | + | | | Whether or not to use the alpha channel | |
| 440 | + | **operator** =(**const** AGuid1, AGuid2: TGuid): boolean; | |
| 441 | + | | Check whether to GUID are equal | |
| 442 | + | _TBGRAResourceManager_ = **class** | |
| 443 | + | | Generic class for embedded resource management | |
| 444 | + | | **var** BGRAResource : TBGRAResourceManager; | |
| 445 | + | | | Provides a resource manager | |
| 446 | + | **function** ResourceFile(AFilename: **string**): **string** ; | |
| 447 | + | | Return the full path for a resource file on the disk. On Windows and Linux, it can be next to the binary but on MacOS, it can be outside of the application bundle when debugging | |
| 448 | + | ||
| 449 | + | --- | |
| 450 | + | *From the Free Pascal wiki, page "BGRABitmap Miscellaneous types", as the Internet Archive kept it on 2025-05-15. Copyright stays with the author who wrote it, according to the old wiki's [[Licensing]] page. If you have concerns about this material, [message the admin](/wiki-contact).* |
