PUCLIB 1.7.0.0
PHOTRON USB Control Library
Loading...
Searching...
No Matches
pucutil Namespace Reference

Functions

DLL_EXPORT PUCRESULT WINAPI ExtractSequenceNo (const PUCHAR pData, UINT32 nWidth, UINT32 nHeight, PUSHORT pSeqNo)
 This extracts the sequence number from the compressed image data. (UC1 only)
DLL_EXPORT PUCRESULT WINAPI ExtractSequenceNo_GBE2 (const PUCHAR pData, PUSHORT pSeqNo)
 This extracts the sequence number from the transfer data. (GbE-2 only)
DLL_EXPORT PUCRESULT WINAPI DecodeData (PUINT8 pDst, UINT32 nX, UINT32 nY, UINT32 nWidth, UINT32 nHeight, UINT32 nLineBytes, const PUINT8 pSrc, const PUSHORT pQVals)
 This unpacks the compressed image data to luminance data.
DLL_EXPORT PUCRESULT WINAPI DecodeDataMultiThread (PUINT8 pDst, UINT32 nX, UINT32 nY, UINT32 nWidth, UINT32 nHeight, UINT32 nLineBytes, const PUINT8 pSrc, const PUSHORT pQVals, UINT32 nThreadCount)
 This unpacks the compressed image data to luminance data. This process is multithreaded.
DLL_EXPORT PUCRESULT WINAPI DecodeDCTData (PINT16 pDst, UINT32 nX, UINT32 nY, UINT32 nWidth, UINT32 nHeight, UINT32 nLineBytes, const PUINT8 pSrc, const PUSHORT pQVals)
 This unpacks the compressed image data to DCT coefficients.
DLL_EXPORT PUCRESULT WINAPI DecodeDCData (PUINT8 pDst, UINT32 nBlockX, UINT32 nBlockY, UINT32 nBlockCountX, UINT32 nBlockCountY, const PUINT8 pSrc)
 Decodes the DC component of compressed image data.
DLL_EXPORT PUCRESULT WINAPI GetAvailableGPUProcess ()
 This retrieves whether the PC is capable of GPU processing.
DLL_EXPORT PUCRESULT WINAPI SetupGPUDecode (PUC_GPU_SETUP_PARAM param)
 Allocates memory for GPU processing.
DLL_EXPORT PUCRESULT WINAPI TeardownGPUDecode ()
 Releases memory used by GPU processing.
DLL_EXPORT PUCRESULT WINAPI DecodeGPU (bool download, unsigned char *pSrc, unsigned char **pDst, UINT32 lineBytes)
 This unpacks the compressed image data to luminance data.(GPU processing)
DLL_EXPORT PUCRESULT WINAPI GetGPULastError (int &errorCode)
 This retrieves the error code from the last GPU processing.
DLL_EXPORT PUCRESULT WINAPI IsSetupGPUDecode (bool &status)
 This retrieves whether GPU decode memory is allocated.
DLL_EXPORT PUCRESULT WINAPI GetTimeCode2EPOC (PUINT8 pSrc, time_t *time)
 This converts the time code in the transfer data into epoch time. (GbE-2 only)
DLL_EXPORT PUCRESULT WINAPI ExtractGbe2XferHeader (const PUCHAR pData, PPUC_GBE2_XFER_HEADER pHeader)
 This parses the header of the transfer data. (GbE-2 only)
DLL_EXPORT PUCRESULT WINAPI SetWhiteBalanceGain (double nGainR, double nGainG, double nGainB)
 Sets the per-channel white balance gain applied during GbE-2 color (bayer) decoding. 1.0 = no change. Stored process-globally and used by the next decode..

Function Documentation

◆ DecodeData()

DLL_EXPORT PUCRESULT WINAPI DecodeData ( PUINT8 pDst,
UINT32 nX,
UINT32 nY,
UINT32 nWidth,
UINT32 nHeight,
UINT32 nLineBytes,
const PUINT8 pSrc,
const PUSHORT pQVals )

This unpacks the compressed image data to luminance data.

Parameters
[out]pDstThe buffer at the unpacking destination. The size of the width must be allocated rounded up to a multiple of four. (e.g., If the width is 1246 px, a buffer is required 1248 bytes at least)
For the GbE-2 color model, BGR 24-bit data (3 bytes per pixel, nWidth*3 bytes per line) is written, so at least nWidth*nHeight*3 bytes are required.
[in]nXThe upper left coordinate X for starting unpacking. This must be 0, or a multiple of 8.
[in]nYThe upper left coordinate Y for starting unpacking. This must be 0, or a multiple of 8.
[in]nWidthThe width for unpacking
[in]nHeightThe height for unpacking
[in]nLineBytesThe number of bytes of the buffer width at the unpacking destination
For the GbE-2 color model, pass nWidth. (This is the line width of the bayer data before conversion, not of the BGR output.)
[in]pSrcThe compressed image data
[in]pQValsA quantization table
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
PUC_GetXferDataSize
PUC_GetMaxXferDataSize

◆ DecodeDataMultiThread()

DLL_EXPORT PUCRESULT WINAPI DecodeDataMultiThread ( PUINT8 pDst,
UINT32 nX,
UINT32 nY,
UINT32 nWidth,
UINT32 nHeight,
UINT32 nLineBytes,
const PUINT8 pSrc,
const PUSHORT pQVals,
UINT32 nThreadCount )

This unpacks the compressed image data to luminance data. This process is multithreaded.

Parameters
[out]pDstThe buffer at the unpacking destination. The size of the width must be allocated rounded up to a multiple of four. (e.g., If the width is 1246 px, a buffer is required 1248 bytes at least)
For the GbE-2 color model, BGR 24-bit data (3 bytes per pixel, nWidth*3 bytes per line) is written, so at least nWidth*nHeight*3 bytes are required.
[in]nXThe upper left coordinate X for starting unpacking. This must be 0, or a multiple of 8.
[in]nYThe upper left coordinate Y for starting unpacking. This must be 0, or a multiple of 8.
[in]nWidthThe width for unpacking
[in]nHeightThe height for unpacking
[in]nLineBytesThe number of bytes of the buffer width at the unpacking destination
For the GbE-2 color model, pass nWidth. (This is the line width of the bayer data before conversion, not of the BGR output.)
[in]pSrcThe compressed image data
[in]pQValsA quantization table
[in]nThreadCountThe number of threads to process in multiple threads.
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
PUC_GetXferDataSize
PUC_GetMaxXferDataSize
PUC_DecodeData

◆ DecodeDCData()

DLL_EXPORT PUCRESULT WINAPI DecodeDCData ( PUINT8 pDst,
UINT32 nBlockX,
UINT32 nBlockY,
UINT32 nBlockCountX,
UINT32 nBlockCountY,
const PUINT8 pSrc )

Decodes the DC component of compressed image data.

Parameters
[out]pDstThe buffer at the decoding destination. Must be allocated for the total number of blocks included in the decoding range.
[in]nBlockXThe block coordinates X for starting decoding
[in]nBlockYThe block coordinates Y for starting decoding
[in]nBlockCountXNumber of blocks in the X direction to be decoded
[in]nBlockCountYNumber of blocks in the Y direction to be decoded
[in]pSrcThe compressed image data
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
PUC_GetXferDataSize
PUC_GetMaxXferDataSize

◆ DecodeDCTData()

DLL_EXPORT PUCRESULT WINAPI DecodeDCTData ( PINT16 pDst,
UINT32 nX,
UINT32 nY,
UINT32 nWidth,
UINT32 nHeight,
UINT32 nLineBytes,
const PUINT8 pSrc,
const PUSHORT pQVals )

This unpacks the compressed image data to DCT coefficients.

Parameters
[out]pDstThe buffer at the unpacking destination. The size of the width must be allocated rounded up to a multiple of four. (e.g., If the width is 1246 px, a buffer is required 1248 bytes at least)
[in]nXThe upper left coordinate X for starting unpacking. This must be 0, or a multiple of 8.
[in]nYThe upper left coordinate Y for starting unpacking. This must be 0, or a multiple of 8.
[in]nWidthThe width for unpacking. For the GbE-2, this must be a multiple of 8.
[in]nHeightThe height for unpacking. For the GbE-2, this must be a multiple of 8.
[in]nLineBytesThe number of bytes of the buffer width at the unpacking destination. This must be at least nWidth * 2.
[in]pSrcThe compressed image data
[in]pQValsA quantization table
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
PUC_GetXferDataSize
PUC_GetMaxXferDataSize

◆ DecodeGPU()

DLL_EXPORT PUCRESULT WINAPI DecodeGPU ( bool download,
unsigned char * pSrc,
unsigned char ** pDst,
UINT32 lineBytes )

This unpacks the compressed image data to luminance data.(GPU processing)

Parameters
[in]downloadIf false is specified, the decoded data is stored in device (GPU) memory; if true is specified, it is stored in host (CPU) memory.
[in]pSrcThe original encoded frame data to be decoded.
[out]pDstThe decoded processing result frame data, which is output to device memory or host memory depending on the setting of the download argument.
[in]lineBytesThe number of bytes of the buffer width at the unpacking destination
If the download argument is true, the data decoded by the GPU is copied to the address specified by this argument.
Therefore, it is necessary to allocate a buffer in host memory in advance.
The size of the width must be allocated rounded up to a multiple of four. (e.g., If the width is 1246 px, a buffer is required 1248 bytes at least)
If the download argument is false, the address of the device memory of the data decoded by the GPU is acquired. Allocation of host memory is not required.
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.

◆ ExtractGbe2XferHeader()

DLL_EXPORT PUCRESULT WINAPI ExtractGbe2XferHeader ( const PUCHAR pData,
PPUC_GBE2_XFER_HEADER pHeader )

This parses the header of the transfer data. (GbE-2 only)

This retrieves the image number, the packet loss flag, the synchronization/PTP/trigger status and the epoch time all at once.
The model is identified by the model code in the transfer data header (2nd byte). For UC1 data, PUC_ERROR_NOTSUPPORT will be returned.
For data with an unknown model code, PUC_ERROR_XFER_DATA_INVALID_HEADER will be returned. This also applies to a frame whose first packet (including the header) was lost, because the missing part is filled with 0.
If failed, the output is not modified.

Parameters
[in]pDataThe transfer data
[out]pHeaderThe storage destination for the parsed header
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
ExtractSequenceNo_GBE2
GetTimeCode2EPOC

◆ ExtractSequenceNo()

DLL_EXPORT PUCRESULT WINAPI ExtractSequenceNo ( const PUCHAR pData,
UINT32 nWidth,
UINT32 nHeight,
PUSHORT pSeqNo )

This extracts the sequence number from the compressed image data. (UC1 only)

The model is identified by the model code in the transfer data header (2nd byte).
For GbE-2 data, PUC_ERROR_NOTSUPPORT will be returned. Use ExtractSequenceNo_GBE2 instead.
For data with an unknown model code, PUC_ERROR_XFER_DATA_INVALID_HEADER will be returned.

Parameters
[in]pDataThe compressed image data
[in]nWidthThe image width
[in]nHeightThe image height
[out]pSeqNoThe storage destination for the sequence number extracted
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.

◆ ExtractSequenceNo_GBE2()

DLL_EXPORT PUCRESULT WINAPI ExtractSequenceNo_GBE2 ( const PUCHAR pData,
PUSHORT pSeqNo )

This extracts the sequence number from the transfer data. (GbE-2 only)

Unlike ExtractSequenceNo, the resolution is not required because the sequence number is stored in the transfer data header.
The model is identified by the model code in the transfer data header (2nd byte). For UC1 data, PUC_ERROR_NOTSUPPORT will be returned.
For data with an unknown model code, PUC_ERROR_XFER_DATA_INVALID_HEADER will be returned. This also applies to a frame whose first packet (including the header) was lost, because the missing part is filled with 0.
If failed, the output is not modified.

Parameters
[in]pDataThe transfer data
[out]pSeqNoThe storage destination for the sequence number
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
This function is thread-safe. This function can be executed in parallel.
See also
ExtractSequenceNo

◆ GetAvailableGPUProcess()

DLL_EXPORT PUCRESULT WINAPI GetAvailableGPUProcess ( )

This retrieves whether the PC is capable of GPU processing.

Returns
Returns PUC_SUCCEEDED if GPU processing is possible, otherwise returns PUC_ERROR_NOTSUPPORT.

◆ GetGPULastError()

DLL_EXPORT PUCRESULT WINAPI GetGPULastError ( int & errorCode)

This retrieves the error code from the last GPU processing.

Parameters
[out]Theerror code from GPU.
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.

◆ GetTimeCode2EPOC()

DLL_EXPORT PUCRESULT WINAPI GetTimeCode2EPOC ( PUINT8 pSrc,
time_t * time )

This converts the time code in the transfer data into epoch time. (GbE-2 only)

The model is identified by the model code in the transfer data header (2nd byte).
For a model that has no time code, PUC_ERROR_NOTSUPPORT will be returned.

Parameters
[in]pSrcThe transfer data
[out]timeThe storage destination for the epoch time (seconds)
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.

◆ IsSetupGPUDecode()

DLL_EXPORT PUCRESULT WINAPI IsSetupGPUDecode ( bool & status)

This retrieves whether GPU decode memory is allocated.

Parameters
[out]statustrue : allocated, false : not allocated.
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.

◆ SetupGPUDecode()

DLL_EXPORT PUCRESULT WINAPI SetupGPUDecode ( PUC_GPU_SETUP_PARAM param)

Allocates memory for GPU processing.

Parameters
[in]paramThis is a configuration parameter.
Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.

◆ SetWhiteBalanceGain()

DLL_EXPORT PUCRESULT WINAPI SetWhiteBalanceGain ( double nGainR,
double nGainG,
double nGainB )

Sets the per-channel white balance gain applied during GbE-2 color (bayer) decoding. 1.0 = no change. Stored process-globally and used by the next decode..

◆ TeardownGPUDecode()

DLL_EXPORT PUCRESULT WINAPI TeardownGPUDecode ( )

Releases memory used by GPU processing.

Returns
If successful, PUC_SUCCEEDED will be returned. If failed, other responses will be returned.
Note
It is safe to run after releasing the buffer used for PUC_DecodeGPU.