CImage:Byteswap


The Byteswap method swaps the byte within the image pixels.

Syntax

bSuccess = CImage:Byteswap()

where

    bSuccess is the returned success code. On success it is true, otherwise false.

  

The Byteswap operation can be needed when exchanging images across different computer architecture that store numbers with opposite byte orders.

Example

The following script loads an image from the file sPath, swaps the pixel byte order, and saves the result back to the file:

I = CImage:new()

-- create a new CImage

I:Open(sPath)

-- load the image from a file named sPath

I:Byteswap()

-- perform the operation

I:Save()

 

Related Topics

CImage class