Open Image

There are different ways to open an image in the ImageSDK. The ImageSDK accepts images in the IIQ format (Phase One proprietary file format for raw/Bayer images). Opening an image from disk can be done as follows:

P1::ImageSdk::RawImage image("test_input.iiq");
RawImage image1 = new RawImage("test_input.iiq");

Alternatively, opening an image from buffer can be done as follows:

P1::ImageSdk::RawImage image(imageFile->Data(), imageFile->DataSizeBytes());
RawImage image = new RawImage(imageFile.Data.Pointer, imageFile.Data.Size);

Basic Image Info

Once the image has been opened, basic image info such as the width and height of the image can be extracted, as follows:

int width = image.Width();
int height = image.Height();
int width = image.Width;
int height = image.Height;

The “width” and “height” in this example refers to the width and height of the exposed area on the sensor. See Sensor-size / Exposed Area, for more information on this topic.