CImage:CreateSynth


The CreateSynth method constructs a new synthetic image containing noise of various type and, optionally, randomly placed stars.

Syntax

bSuccess = CImage:CreateSynth( CImSynthInfo )

where

    CImSynthInfo is a class object that contains information about the synthetic image.

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

  

This method creates a synthetic image using the peoperties contained in the CImSynthInfo object. The default properties can be changed by setting new values or loading all the CImSynthInfo properties from the system Registry using CImSynthInfo:Open. Additional methods that may be useful are SynthStarCount and SynthGetStar.

Example

The following sdcript creates a synthetic image, displays it, and then uses the CImage:SynthGetStar method to fetch the properties of the first 10 synthetic stars. The output from one line of the script's listing loop might look like the following (here, for the 3rd artificial star):

 

    3: 808.712, 841.744, 1681.18

 

The following script lists the star's index, x coordinate, y coordinate, and total luminosity.

I = CImage:new()

-- create a CImage object

C = CImSynthInfo:new()

-- create CImSynthInfo with default vlaues

C.nStarCount = 10000

-- 10,000 synthetic stars

bOk = I:CreateSynth( C )

-- Create the synthetic image

if not bOk then Exit() end

-- if not created, then exit the script

V = I:Display()

-- display the synthetic image

 

 

for i = 1, 10 do

-- list the properties of the first 10 stars

  t = I:SynthGetStar( i )

-- fetch the star's data table

  Printf("%d: %lg,%lg,%lg\n", t.n,t.x,t.y,t.lum )

-- print the star's Index, X, Y, and Luminosity

end

-- end of printing loop

Related Topics

Create

SynthStarCount

SynthGetStar

CImage class

CImSynthInfo class