Dynamsoft Panorama - API Reference
Public Member Functions | List of all members
Dynamsoft.Panorama.PanoramaStitcher Class Reference

Defines a class that provides functions for Panorama stitching. More...

Public Member Functions

 PanoramaStitcher ()
 Default constructor More...
 
void Release ()
 Releases an instance of Dynamsoft Panorama Stitcher. More...
 
EnumErrorCode InitRuntimeSettingsWithString (string jsonSetting, out string errorMessage)
 Initializes Panorama settings with the parameters obtained from a JSON string. More...
 
EnumErrorCode SetResultCallback (CB_PanoramaResult cb, IntPtr pUser)
 Sets callback function to process panorama result, including stitched image and barcodes. More...
 
EnumErrorCode SetErrorCodeCallback (CB_PanoramaErrorCode cb, IntPtr pUser)
 Sets callback function to process errors generated during image stitching. More...
 
DPS_RuntimeSettings GetRuntimeSettings ()
 Gets current settings and saves them into a struct. More...
 
EnumErrorCode UpdateRuntimeSettings (DPS_RuntimeSettings pSetting, out string errorMsg)
 Updates runtime settings with a given struct. More...
 
string OutputSettingsToString ()
 Outputs runtime settings to a string. More...
 
Initialization Functions
EnumErrorCode InitLicense (string keyWin)
 Reads product key and activates the SDK. More...
 
EnumErrorCode InitLicenseFromServer (string licenseServer, string keyWin)
 Initializes the license and connections to the specified server for online verification. More...
 
EnumErrorCode InitLicenseFromLicenseContent (string keyWin, string licenseContent)
 Initializes the license and connects to the specified server for online verification. More...
 
string OutputLicenseToString ()
 Outputs the license content as an encrypted string from the license server to be used for offline license verification. More...
 
Stitching Functions
int StartPanoramaStitchingByFile ()
 Starts threads to manage images reading from file, this function should be used with AppendNewFrameByFile Function. More...
 
int StartPanoramaStitchingByBuffer (int width, int height, int stride, EnumImagePixelFormat format)
 Starts threads to manage images reading from buffer, this function should be used with AppendNewFrameByBuffer Function. More...
 
int AppendNewFrameByFile (string fileName)
 Appends a new frame from a file to the inner frame queue. More...
 
int AppendNewFrameByBuffer (IntPtr pBuffer)
 Appends a new frame image buffer from a file to the inner frame queue. More...
 
void WaitForFinishStitching ()
 Waits for finishing stitching all frames in the inner frame queue. More...
 
void StopPanoramaStitching ()
 Stops stitching immediately, avoid stitching the remaining frames in the inner frame queue. More...
 
Result Functions
PanoramaResult [] GetFinalResults ()
 Gets the image and barcodes results. More...
 
RunningState GetRunningState ()
 Gets running state of Panorama program. More...
 

Detailed Description

Defines a class that provides functions for Panorama stitching.

Constructor & Destructor Documentation

◆ PanoramaStitcher()

Dynamsoft.Panorama.PanoramaStitcher.PanoramaStitcher ( )
inline

Default constructor

Member Function Documentation

◆ AppendNewFrameByBuffer()

int Dynamsoft.Panorama.PanoramaStitcher.AppendNewFrameByBuffer ( IntPtr  pBuffer)
inline

Appends a new frame image buffer from a file to the inner frame queue.

Parameters
pBufferThe array of bytes which contain the image data.
Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaSticthing();
panorama.release();
Remarks:
The size of the incoming images should be the same as the image size declared in StartPanoramaStitchingByBuffer().

◆ AppendNewFrameByFile()

int Dynamsoft.Panorama.PanoramaStitcher.AppendNewFrameByFile ( string  fileName)
inline

Appends a new frame from a file to the inner frame queue.

Parameters
fileNameA string defining the file name.
Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByFile();
panorama.AppendNewFrameByFile("C:\\Users\\*****\\1.jpg");
panorama.StopPanoramaSticthing();
panorama.release();
Remarks:
The size of the incoming images should be the same.

◆ GetFinalResults()

PanoramaResult [] Dynamsoft.Panorama.PanoramaStitcher.GetFinalResults ( )
inline

Gets the image and barcodes results.

Returns
Returns Panorama results.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
PanoramaResult[] pResult = panorama.GetFinalResults();
panorama.release();

◆ GetRunningState()

RunningState Dynamsoft.Panorama.PanoramaStitcher.GetRunningState ( )
inline

Gets running state of Panorama program.

Returns
Returns Panorama running state.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
RunningState pRunningState = panorama.GetRunningState();
panorama.StopPanoramaStitching();
panorama.release();

◆ GetRuntimeSettings()

DPS_RuntimeSettings Dynamsoft.Panorama.PanoramaStitcher.GetRuntimeSettings ( )
inline

Gets current settings and saves them into a struct.

Returns
Returns struct contained runtime settings;
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
DPS_RuntimeSettings settings = panorama.GetRuntimeSettings();
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ InitLicense()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.InitLicense ( string  keyWin)
inline

Reads product key and activates the SDK.

Parameters
keyWinThe license key of Barcode Reader.
Returns
Returns error code.

◆ InitLicenseFromLicenseContent()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.InitLicenseFromLicenseContent ( string  keyWin,
string  licenseContent 
)
inline

Initializes the license and connects to the specified server for online verification.

Parameters
keyWinThe license key.
licenseContentAn encrypted string representing the license content (quota, expiration date, barcode type, etc.) obtained from the method OutputLicenseToString().
Returns
Returns error code.

◆ InitLicenseFromServer()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.InitLicenseFromServer ( string  licenseServer,
string  keyWin 
)
inline

Initializes the license and connections to the specified server for online verification.

Parameters
licenseServerThe URL of the license server.
keyWinThe license key.
Returns
Returns error code.

◆ InitRuntimeSettingsWithString()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.InitRuntimeSettingsWithString ( string  jsonSetting,
out string  errorMessage 
)
inline

Initializes Panorama settings with the parameters obtained from a JSON string.

Parameters
jsonSettingA JSON string that represents the content of the settings.
errorMessageThe error message string.
Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
panorama.InitRuntimeSettingsWithString("{\"PreviewImgScaleRatio\": 0.25, \"ResultImgScaleRatio\":1}");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ OutputLicenseToString()

string Dynamsoft.Panorama.PanoramaStitcher.OutputLicenseToString ( )
inline

Outputs the license content as an encrypted string from the license server to be used for offline license verification.

Returns
The output string which stores the contents of license.

◆ OutputSettingsToString()

string Dynamsoft.Panorama.PanoramaStitcher.OutputSettingsToString ( )
inline

Outputs runtime settings to a string.

Returns
Returns setting string.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
string pContent = panorama.OutputSettingsToString();
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ Release()

void Dynamsoft.Panorama.PanoramaStitcher.Release ( )
inline

Releases an instance of Dynamsoft Panorama Stitcher.

◆ SetErrorCodeCallback()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.SetErrorCodeCallback ( CB_PanoramaErrorCode  cb,
IntPtr  pUser 
)
inline

Sets callback function to process errors generated during image stitching.

Parameters
cbCallback function.
pUserCustomized arguments passed to your function.
Returns
Returns error code.
Code Snippet:
panorama.SetErrorCodeCallback(ErrorFunction, NULL);
panorama.release();

◆ SetResultCallback()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.SetResultCallback ( CB_PanoramaResult  cb,
IntPtr  pUser 
)
inline

Sets callback function to process panorama result, including stitched image and barcodes.

Parameters
cbCallback function.
pUserCustomized arguments passed to your function.
Returns
Returns error code.
Code Snippet:
panorama.SetResultCallback(ResultFunction, NULL);
panorama.release();

◆ StartPanoramaStitchingByBuffer()

int Dynamsoft.Panorama.PanoramaStitcher.StartPanoramaStitchingByBuffer ( int  width,
int  height,
int  stride,
EnumImagePixelFormat  format 
)
inline

Starts threads to manage images reading from buffer, this function should be used with AppendNewFrameByBuffer Function.

Parameters
widthThe width of the frame image in pixels.
heightThe height of the frame image in pixels.
strideiStride The stride (or scan width) of the frame image.
formatformat The image pixel format used in the image byte array.
Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ StartPanoramaStitchingByFile()

int Dynamsoft.Panorama.PanoramaStitcher.StartPanoramaStitchingByFile ( )
inline

Starts threads to manage images reading from file, this function should be used with AppendNewFrameByFile Function.

Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByFile();
panorama.AppendNewFrameByFile("C:\\Users\\*****\\1.jpg");
panorama.StopPanoramaStitching();
panorama.release();

◆ StopPanoramaStitching()

void Dynamsoft.Panorama.PanoramaStitcher.StopPanoramaStitching ( )
inline

Stops stitching immediately, avoid stitching the remaining frames in the inner frame queue.

Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ UpdateRuntimeSettings()

EnumErrorCode Dynamsoft.Panorama.PanoramaStitcher.UpdateRuntimeSettings ( DPS_RuntimeSettings  pSetting,
out string  errorMsg 
)
inline

Updates runtime settings with a given struct.

Parameters
pSettingThe struct of template settings.
errorMsgThe error message string.
Returns
Returns error code.
Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
DPS_RuntimeSettings settings = panorama.GetRuntimeSettings();
panorama.UpdateRuntimeSettings(settings);
int ret = panorama.StartPanoramaByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.StopPanoramaStitching();
panorama.release();

◆ WaitForFinishStitching()

void Dynamsoft.Panorama.PanoramaStitcher.WaitForFinishStitching ( )
inline

Waits for finishing stitching all frames in the inner frame queue.

Code Snippet:
panorama.InitLicense("t0260NwAAAHV***************");
int ret = panorama.StartPanoramaStitchingByBuffer(1080, 1920, 3240, DPS_IPF_RGB_888);
panorama.AppendNewFrameByBuffer(pBuffer);
panorama.WaitForFinishStitching();
panorama.StopPanoramaSticthing();
panorama.release();