CountLUTColors example for Delphi
procedure TForm1.Button1Click(Sender: TObject);
var
nRet: L_INT;
uNumberOfEntries: L_UINT;
nFirstIndex: L_INT;
begin
{ check the linearity of the LUT and computes its window width and center
by using GetLinearVOILUT method. }
LEADImage1.Load('e:\image1.cmp', 0, 1, 1 );
if ( LEADImage1.IsSigned) then
begin
nRet:= LEADImage1.CountLUTColors( uNumberOfEntries, nFirstIndex, COUNT_LUT_SIGNED );
end
else
nRet:= LEADImage1.CountLUTColors ( uNumberOfEntries, nFirstIndex, COUNT_LUT_UNSIGNED );
if(nRet = SUCCESS) then
begin
ShowMessage( 'Number of entries = ' + IntToStr(uNumberOfEntries));
end;
end;