CImage:KwdGetSectEx


The KwdGetSectEx method returns the 4 values from a section type keyword plus a boolean success flag. An example of a section keyword is BIASSEC, which has a value with the format '[c1:c2,r1:r2]', as in '[1030:1044,1:1024]'.

Syntax

c1, c2, r1, r2, bOK = CImage:KwdGetSectEx( sKwd )

bullet.gif    sKwd is the keyword name.

bullet.gif    c1, c2 are the first and second column values of the keyword.

bullet.gif    r1, r2 are the first and second row values of the keyword.

bullet.gif    bOK is the success flag: true on success or false on failure.

Remarks

This method parses the section keyword into its 4 components. If the keyword is not in the image header, then the default values 0, 0, 0, 0 are returned with bOK = false. Testing the returned flag for true/false tells whether the keyword is in the header. Alternatively, KwdGetSect returns only the 4 components from the section keyword value.

Example

Suppose a CImage named I exists and contains keyword "BIASSEC". The following script returns the region components stored in the BIASSEC keyword:

c1,c2,r1,r2,bOK = I:KwdGetSectEx("BIASSEC")

-- read the keyword value

if bOK then

-- print the values

  Printf( "R= %d,%d, %d,%d", c1,c2,r1,r2)

 

else

 

  Printf("Keyword not present or is invalid")

end

 

Related Topics

CImage class

KwdGetSect

KwdSetSect

KwdGetNumEx

KwdGetStrEx

KwdGetValEx


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2024 Mirametrics, Inc. All Rights Reserved.