pl_BGRAbitmap
- Details
- Category: Graphics
- Published: Sunday, 20 October 2013 05:45
- Written by Sternas Stefanos
- Hits: 19601
pl_BGRAbitmap
It's the port of BGRAbitmap library to CodeTyphon Studio.
BGRAbitmap is a Cross-platform Graphical Library with transparency (alpha channel) and Direct pixel access for fast image processing.
Integrated drawing functions
- draw/erase pixels
- draw a line with or without antialiasing
- floating point coordinates
- floating point pen width
- rectangle (frame or fill)
- ellipse and polygons with antialiasing
- spline computation (rounded curve)
- simple fill (Floodfill) or progressive fill
- color gradient rendering (linear, radial...)
- round rectangles
- texts with transparency
Image manipulation
Available filters (prefixed with Filter) :
- Radial blur : non directional blur
- Motion blur : directional blur
- Custom blur : blur according to a mask
- Median : computes the median of colors around each pixel, which softens corners
- Pixelate : simplifies the image with rectangles of the same color
- Smooth : soften whole image, complementary to Sharpen
- Sharpen : makes contours more accute, complementary to Smooth
- Contour : draws contours on a white background (like a pencil drawing)
- Emboss : draws contours with shadow
- EmbossHighlight : draws contours of a selection defined with grayscale
- Grayscale : converts colors to grayscale with gamma correction
- Normalize : uses whole range of color luminosity
- Rotate : rotation of the image around a point
- Sphere : distorts the image to make it look like projected on a sphere
- Twirl : distorts the image with a twirl effect
- Cylinder : distorts the image to make it look like projected on a cylinder
- Plane : computes a high precision projection on a horizontal plane. This is quite slow.
- SmartZoom3 : resizes the image x3 and detects borders, to have a useful zoom with ancient games sprites. Some functions are not prefixed with Filter, because they do not return a newly allocated image. They modify the image in-place :
- VerticalFlip : flips the image vertically
- HorizontalFlip : flips the image horizontally
- Negative : inverse of colors
- LinearNegative : inverse without gamma correction
- SwapRedBlue : swap red and blue channels (to convert between BGRA and RGBA)
- ConvertToLinearRGB : to convert from sRGB to RGB. Note the format used by BGRABitmap is sRGB when using dmDrawWithTransparency and RGB when using dmLinearBlend.
- ConvertFromLinearRGB : convert from RGB to sRGB.
Images combination
Available modes are the following:
- LinearBlend : simple superimposition without gamma correction (equivalent to dmFastBlend)
- Transparent : superimposition with gamma correction
- Multiply : multiplication of color values (with gamma correction)
- LinearMultiply : multiplication of color values (without gamma correction)
- Additive : addition of color values (with gamma correction)
- LinearAdd : addition of color values (without gamma correction)
- Difference : difference of color values (with gamma correction)
- LinearDifference : difference of color values (without gamma correction)
- Negation : makes common colors disappear (with gamma correction)
- LinearNegation : makes common colors disappear (without gamma correction)
- Reflect, Glow : for light effects
- ColorBurn, ColorDodge, Overlay, Screen : misc. filters
- Lighten : keeps the lightest color values
- Darken : keeps the darkest color values
- Xor : exclusive or of color values
Home page
https://github.com/bgrabitmap/bgrabitmap
You can explore Units, Functions, Procedures, Classes, etc in our
Source Documentation