Overview
SepiaEffectLib applies a warm, vintage sepia tone to images, wrapping the FireMonkey TSepiaEffect component. The adjustable intensity allows anything from a subtle warm tint to a full antique photograph look.
| Property | Details |
|---|---|
| Library | SepiaEffectLib |
| Prefix | sepia_ |
| Wraps | TSepiaEffect |
| Functions | 12 |
| Type | Visual effect (color) |
| Category | Count | Description |
|---|---|---|
| Creation / Destruction | 2 | Create and free effect |
| Sepia Amount | 2 | Get/set intensity |
| Effect Control | 4 | Enabled and trigger get/set |
| Error Handling | 4 | Error codes and messages |
📷 Vintage Photography: Sepia toning was originally a chemical process that gave early photographs their characteristic warm brown tone. This effect recreates that classic look digitally — perfect for nostalgic or retro aesthetics.
Cross-Platform Support
| Platform | Support |
|---|---|
| Windows | ✅ Full support |
| Linux | ✅ Full support |
| Android | ✅ Full support |
Creation & Destruction
sepia#(parent#)
Creates a new sepia effect attached to the specified visual control.
| Parameter | Type | Description |
|---|---|---|
parent# | Pointer | Target visual control |
| Returns | Pointer | Effect handle, or 0 on failure |
sepia_free(effect#)
Destroys the effect and releases associated resources.
Error Handling
| Function | Signature | Description |
|---|---|---|
sepia_error() | sepia_error@ | Returns last error code (0 = none) |
sepia_errormsg$() | sepia_errormsg$@ | Returns last error message |
sepia_strerror$(code) | sepia_strerror$@n | Converts error code to text |
sepia_clearerror() | sepia_clearerror@ | Clears the error state |
Sepia Amount
Controls the intensity of the sepia toning. At 0 the image is unmodified; at 1 the image has full sepia tone.
| Function | Signature | Description |
|---|---|---|
sepia_amount#(effect#, value) | sepia_amount#@#n | Set sepia intensity (0–1) |
sepia_amount(effect#) | sepia_amount@# | Get sepia amount |
| Value | Effect |
|---|---|
0.0 | No sepia (original colors) |
0.2–0.4 | Subtle warm tint |
0.5–0.7 | Moderate sepia (lightly vintage) |
0.8–1.0 | Full antique photograph look |
Effect Control
| Function | Signature | Description |
|---|---|---|
sepia_enabled#(effect#, value) | sepia_enabled#@#n | Enable (1) or disable (0) |
sepia_enabled(effect#) | sepia_enabled@# | Gets enabled state |
sepia_trigger#(effect#, trigger$) | sepia_trigger#@#$ | Sets trigger string |
sepia_trigger$(effect#) | sepia_trigger$@# | Gets trigger string |
Complete Examples
Example 1: Adjustable Sepia
let frm# = Pointer#(0) let img# = Pointer#(0) let sepia# = Pointer#(0) let trkAmt# = Pointer#(0) let lblAmt# = Pointer#(0) frm# = form#("Sepia Control", 450, 400) img# = image#(frm#) image_bounds#(img#, 125, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150") sepia# = sepia#(img#) sepia_amount#(sepia#, 0.5) lblAmt# = label#(frm#, "Sepia Amount: 0.50", 50, 200) trkAmt# = trackbar#(frm#) trackbar_bounds#(trkAmt#, 50, 230, 350, 30) trackbar_max#(trkAmt#, 100) trackbar_value#(trkAmt#, 50) trackbar_onchange#(trkAmt#, "OnAmount") form_show(frm#) function OnAmount(sender#) local a let a = trackbar_value(trkAmt#) / 100 sepia_amount#(sepia#, a) label_text#(lblAmt#, "Sepia Amount: " + stri$(a, 2)) endfunction
Example 2: Before/After Comparison
let frm# = Pointer#(0) frm# = form#("Sepia Comparison", 500, 300) ' Original image let img1# = image#(frm#) image_bounds#(img1#, 50, 30, 180, 135) image_load#(img1#, "https://picsum.photos/180/135") let lbl1# = label#(frm#, "Original", 110, 175) ' Sepia image let img2# = image#(frm#) image_bounds#(img2#, 270, 30, 180, 135) image_load#(img2#, "https://picsum.photos/180/135") let sepia# = sepia#(img2#) sepia_amount#(sepia#, 1) let lbl2# = label#(frm#, "Sepia", 335, 175) form_show(frm#)
Example 3: Full Sepia Effect
let frm# = Pointer#(0) let img# = Pointer#(0) let sepia# = Pointer#(0) frm# = form#("Sepia Effect Demo", 400, 350) img# = image#(frm#) image_bounds#(img#, 100, 30, 200, 150) image_load#(img#, "https://picsum.photos/200/150") sepia# = sepia#(img#) sepia_amount#(sepia#, 1) form_show(frm#)
Quick Reference
| Function | Signature | Description |
|---|---|---|
| CREATION & DESTRUCTION | ||
sepia#(parent#) | sepia#@# | Create effect |
sepia_free(effect#) | sepia_free@# | Destroy effect |
| SEPIA AMOUNT | ||
sepia_amount#(effect#, value) | sepia_amount#@#n | Set intensity (0–1) |
sepia_amount(effect#) | sepia_amount@# | Get intensity |
| EFFECT CONTROL | ||
sepia_enabled#(effect#, value) | sepia_enabled#@#n | Enable/disable |
sepia_enabled(effect#) | sepia_enabled@# | Get enabled state |
sepia_trigger#(effect#, trigger$) | sepia_trigger#@#$ | Set trigger |
sepia_trigger$(effect#) | sepia_trigger$@# | Get trigger |
| ERROR HANDLING | ||
sepia_error() | sepia_error@ | Last error code |
sepia_errormsg$() | sepia_errormsg$@ | Last error message |
sepia_strerror$(code) | sepia_strerror$@n | Code to text |
sepia_clearerror() | sepia_clearerror@ | Clear error state |
See Also
| Library | Description |
|---|---|
MonochromeEffectLib | Black and white conversion |
HueAdjustEffectLib | Hue/color adjustment |
ContrastEffectLib | Contrast adjustment |
