DBWriteLUT

Demonstrates how to write LUT.

Remarks

This example illustrates how to handle LUT related operations. Here, we first initialize a LUT which linearly maps input values from 0 to 127 to the full output range 0 to 255, and then write the LUT to a file.

Code

  local byte lut[256], int tfid, int i
  local string temp_file
  for i = 1 to 256
    if( i < 129 )then
      lut[i] = i*2-1
    else
      lut[i] = 255
    endif
  endfor
  
  temp_file = "./my.pix"
  delete temp_file noerror
  call CopyFile(GetPCIHOME() + "/demo/irvine.pix", \
                temp_file)
  tfid = DBOpen( temp_file, "r+" )
  call DBWriteLUT( tfid, 2, lut )
  call DBClose( tfid )

© PCI Geomatics Enterprises, Inc.®, 2026. All rights reserved.