Skip to main content

ZOS-API interface 2025 R1

ZOSAPI.Analysis.Data.IAR_DataGridRgb Interface Reference

Last update: 17.07.2025

Public Member Functions

IAR_Rgb GetValue (int x, int y)
 Gets the specified point.
 
void FillValues (uint fullSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] rData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] gData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] bData)
 Retries all RGB data at once, into the specified buffers.
 

Properties

String Description [get]
 
String XLabel [get]
 
String YLabel [get]
 
String ValueLabel [get]
 
uint Nx [get]
 
uint Ny [get]
 
double Dx [get]
 
double Dy [get]
 
double MinX [get]
 
double MinY [get]
 
IAR_Rgb[,] Values [get]
 

Detailed Description

Member Function Documentation

◆ FillValues()

void ZOSAPI.Analysis.Data.IAR_DataGridRgb.FillValues ( uint  fullSize,
[Out] float[]  rData,
[Out] float[]  gData,
[Out] float[]  bData 
)

Retries all RGB data at once, into the specified buffers.

Usage (see Example 24 for a full sample)

C#

// Reads values from detector color raw data
// Prints RGB data into single file
d4_raw.FillValues((uint)(x_pixels * y_pixels), rData, gData, bData);

C++

// Reads values from detector color raw data
// Prints RGB data into single file
d4_raw->FillValues((x_pixels * y_pixels), rData, gData, bData);

Matlab

% reads values from detector color raw data
% Loads RGB data into System.Single buffer
d4_raw.FillValues((x_pixels * y_pixels), rData, gData, bData);
% Converts buffer to RGB array; rotates & resizes RGB array
dData = zeros(y_pixels, x_pixels, 3) - 1;
dData(:,:,1) = rot90(reshape(rData.double ./ 255, x_pixels, y_pixels));
dData(:,:,2) = rot90(reshape(gData.double ./ 255, x_pixels, y_pixels));
dData(:,:,3) = rot90(reshape(bData.double ./ 255, x_pixels, y_pixels));

Python

# FillValues() method still in development for Python
# creates 3D array to store normalized RGB data
data = np.zeros([y_pixels, x_pixels, 3])
for y in range(0, y_pixels):
for x in range(0, x_pixels):
rgb = d4_raw.GetValue(x, y)
data[y, x, 0] = rgb.R / 255
data[y, x, 1] = rgb.G / 255
data[y, x, 2] = rgb.B / 255
Parameters
fullSizeThe full size (Nx * Ny).
rDataThe r data.
gDataThe g data.
bDataThe b data.
Examples
CSharpStandalone_24_nsc_detectors.cs, and CSharpStandalone_25_source_spectrum_diffraction_grating.cs.

◆ GetValue()

IAR_Rgb ZOSAPI.Analysis.Data.IAR_DataGridRgb.GetValue ( int  x,
int  y 
)

Gets the specified point.

Usage (see Example 25 for a full sample)

C#

// Loads RGB data into System.Single buffer
ZOSAPI.Analysis.Data.IAR_ det_results = det.GetResults();
det_raw.FillValues((uint)(x_pixel * y_pixel), rData, gData, bData);
Definition: IAR_Base.cs:286
void FillValues(uint fullSize, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] rData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] gData, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex=0)][In][Out]float[] bData)
Retries all RGB data at once, into the specified buffers.
Properties and methods for retrieving analysis window data. This interface can be accessed via the IA...
Definition: IAR_Base.cs:21
IAR_DataGridRgb GetDataGridRgb(int index)
Definition: IAR_Base.cs:11
Definition: IAS_FieldCurvatureAndDistortion.cs:5
The ZOSAPI namespace contains classes for initially connecting to zemax. See also ZOSAPI_Connection,...
Definition: IAS_FieldCurvatureAndDistortion.cs:5

C++

// Loads RGB data into arrays
det->GetResults()->GetDataGridRgb(0)->FillValues((x_pixel * y_pixel), rData, gData, bData);

Matlab

% Loads RGB data into System.Single buffer
det_raw = det.GetResults().DataGridsRgb.Get(0);
det_raw.FillValues((x_pixel * y_pixel), rData, gData, bData);

Python

det_raw = det.GetResults().GetDataGridRgb(0)
# FillValues() method still in development for Python; need to use GetValue()
xpix = o5.ObjectData.NumberXPixels
ypix = o5.ObjectData.NumberYPixels
data = np.zeros([ypix, xpix, 3])
for y in range(0, ypix):
for x in range(0, xpix):
rgb = det_raw.GetValue(x, y)
data[y, x, 0] = rgb.R / 255
data[y, x, 1] = rgb.G / 255
data[y, x, 2] = rgb.B / 255
Parameters
xThe row (0 to Nx-1).
yThe col (0 to Ny-1).
Returns

Property Documentation

◆ Description

String ZOSAPI.Analysis.Data.IAR_DataGridRgb.Description
get

◆ Dx

double ZOSAPI.Analysis.Data.IAR_DataGridRgb.Dx
get

◆ Dy

double ZOSAPI.Analysis.Data.IAR_DataGridRgb.Dy
get

◆ MinX

double ZOSAPI.Analysis.Data.IAR_DataGridRgb.MinX
get

◆ MinY

double ZOSAPI.Analysis.Data.IAR_DataGridRgb.MinY
get

◆ Nx

uint ZOSAPI.Analysis.Data.IAR_DataGridRgb.Nx
get

◆ Ny

uint ZOSAPI.Analysis.Data.IAR_DataGridRgb.Ny
get

◆ ValueLabel

String ZOSAPI.Analysis.Data.IAR_DataGridRgb.ValueLabel
get

◆ Values

IAR_Rgb [,] ZOSAPI.Analysis.Data.IAR_DataGridRgb.Values
get

◆ XLabel

String ZOSAPI.Analysis.Data.IAR_DataGridRgb.XLabel
get

◆ YLabel

String ZOSAPI.Analysis.Data.IAR_DataGridRgb.YLabel
get

Connect with Ansys