API referenceImages

pdfReverseImage

Vertically flip (mirror top-to-bottom) the pixel data of the

C
int32_t __stdcall pdfReverseImage(PPDF IPDF, int32_t Reset);
Delphi
function pdfReverseImage(const IPDF: PPDF; Reset: Integer): Integer; stdcall;

Purpose. Vertically flip (mirror top-to-bottom) the pixel data of the currently selected image (via pdfSelectImage, next chapter) in place, or restore its original unflipped data.

Description. Operates on whatever image pdfSelectImage last made current (SelectedImageH), not a handle passed as a parameter — there is no way to target an arbitrary image directly through this call. Only supports raw 8-bit-per-component, non-JPEG image data (IsJpeg or BPC <> 8 both fail outright — a JPEG-sourced or non-8-bit image cannot be flipped through this call). On the first flip of a given image, the original row bytes are cached (FImageOrig) before the in-place top/bottom row-swap is performed; passing Reset <> 0 restores that cached original instead of flipping again (repeated non-reset calls toggle the image back and forth, since each flip is a full row-order reversal, not a cumulative rotation).

Parameters.

ParameterDescription
IPDFDocument handle.
Reset0 = flip the current image vertically; non-zero = restore the cached original (pre-flip) pixel data instead.

Return value. 1 on success; 0 if no image is currently selected, the selected image is JPEG-sourced or not 8-bit-per-component, or (for Reset <> 0) no cached original exists yet for that image.

See also. pdfSelectImage.

C# (P/Invoke)

wrappers/dotnet/LumasPdf.cs
public static extern int pdfReverseImage(IntPtr IPDF, int Reset);
Area
Images
Category

Core

Exported names

pdfReverseImage

String variants

The …A form takes UTF-8, …W takes UTF-16; a bare name aliases the ANSI form.

See working code

Worked examples — complete programs in ten languages.