fixstars / ion-kit

Modernized graph-based data processing framework
MIT License
7 stars 6 forks source link

Use API to get PixelFormat PFNC values #173

Closed Fixstars-momoko closed 6 months ago

Fixstars-momoko commented 9 months ago

Currently we have limited GenICam pixelformat to write down to device info config as follows:

src/bb/image-io/rt_common.h

// PFNC
// https://www.emva.org/wp-content/uploads/GenICamPixelFormatValues.pdf
#define PFNC_Mono8      0x01080001
#define PFNC_Mono10     0x01100003
#define PFNC_Mono12     0x01100005
#define PFNC_RGB8       0x02180014
#define PFNC_BGR8       0x02180015

src/bb/image-io/rt_u3v.h

int32_t px =
    pixel_format_ == "RGB8" ? PFNC_RGB8 :
    pixel_format_ == "GBR8" ? PFNC_BGR8 :
    pixel_format_ == "Mono8" ? PFNC_Mono8 :
    pixel_format_ == "Mono10" ? PFNC_Mono10 :
    pixel_format_ == "Mono12" ? PFNC_Mono12 : 0;

Instead, we should obtain those hex value with Aravis API dup_available_enumeration_feature_values.

Fixstars-momoko commented 9 months ago

API availability : https://aravis-project.discourse.group/t/is-there-api-to-get-the-value-of-enumentry-from-displayname/694

xinyuli1204 commented 6 months ago

done by https://github.com/fixstars/ion-kit/pull/257