IPSDK  4_1_0_2
IPSDK : Image Processing Software Development Kit
Functions

Read and write a Raw image using IPSDK. More...

Functions

IPSDKIMAGEFILE_API DiskImagePtr ipsdk::image::file::openRawImageFile (const boost::filesystem::path &rawFilePath, const BaseImageGeometry &imageGeometry, const ipUInt64 dataStartOffset=0)
 function allowing to open a raw file as a disk image More...
 
IPSDKIMAGEFILE_API void ipsdk::image::file::saveRawImageFile (const boost::filesystem::path &rawFilePath, const ImageConstPtr &pImage, const std::string &headerData=std::string())
 function allowing to save a raw image file More...
 
IPSDKIMAGEFILE_API ImagePtr ipsdk::image::file::loadRawImageFile (const boost::filesystem::path &rawFilePath, const BaseImageGeometry &imageGeometry, const ipUInt64 dataStartOffset=0)
 function allowing to load a raw image file More...
 
IPSDKIMAGEFILE_API void ipsdk::image::file::loadRawImageFile (const boost::filesystem::path &rawFilePath, const BaseImageGeometry &imageGeometry, const ImagePtr &pOutImg, const ipUInt64 dataStartOffset=0)
 function allowing to load a raw image file More...
 

Detailed Description

Read and write a Raw image using IPSDK.

This page briefly presents how to load an image from a RAW file using IPSDK.

Read and write an image from a RAW file in C++

First, the header to include to load and save an image from a RAW file is :

To save an image in a RAW file, only the following instruction is needed :

saveRawImageFile(imageFilePath, pImg);

Since a RAW file stores the data without any header, it is necessary to specify its geometry while loading an image from a RAW file. These following instructions allow to load a two dimensional grey-level image from a RAW file :

ImageGeometryPtr pImageGeometry = geometry2d(inType, sizeX, sizeY);
ImagePtr pImg = loadRawImageFile(imageFilePath, *pImageGeometry);

See Image geometry concepts in IPSDK for more details about image geometry.

Read and write an image from a RAW file in Python

In Python, the following command lines show how to write and read an image from a RAW file :

# Save an image
PyIPSDK.saveRawImageFile(inputImgPath, img)
# Load an image
geometry = PyIPSDK.geometryRgb2d(PyIPSDK.eImageBufferType.eIBT_Int8, sizeX, sizeY)
img = PyIPSDK.loadRawImageFile(inputImgPath, geometry)

Function Documentation

◆ loadRawImageFile() [1/2]

IPSDKIMAGEFILE_API ImagePtr ipsdk::image::file::loadRawImageFile ( const boost::filesystem::path &  rawFilePath,
const BaseImageGeometry imageGeometry,
const ipUInt64  dataStartOffset = 0 
)

function allowing to load a raw image file

Note
input image geometry must be compatible with image file
Exceptions
ipsdk::image::file::IPSDKImageFileExceptionon failure

◆ openRawImageFile()

IPSDKIMAGEFILE_API DiskImagePtr ipsdk::image::file::openRawImageFile ( const boost::filesystem::path &  rawFilePath,
const BaseImageGeometry imageGeometry,
const ipUInt64  dataStartOffset = 0 
)

function allowing to open a raw file as a disk image

Exceptions
ipsdk::image::file::IPSDKImageFileExceptionon failure

◆ saveRawImageFile()

IPSDKIMAGEFILE_API void ipsdk::image::file::saveRawImageFile ( const boost::filesystem::path &  rawFilePath,
const ImageConstPtr pImage,
const std::string &  headerData = std::string() 
)

function allowing to save a raw image file

Exceptions
ipsdk::image::file::IPSDKImageFileExceptionon failure

◆ loadRawImageFile() [2/2]

IPSDKIMAGEFILE_API void ipsdk::image::file::loadRawImageFile ( const boost::filesystem::path &  rawFilePath,
const BaseImageGeometry imageGeometry,
const ImagePtr pOutImg,
const ipUInt64  dataStartOffset = 0 
)

function allowing to load a raw image file

Note
input image geometry must be compatible with image file
Exceptions
ipsdk::image::file::IPSDKImageFileExceptionon failure