openpnp / openpnp-capture

A cross platform video capture library with a focus on machine vision.
MIT License
129 stars 56 forks source link

Transition to property-based interface for focus/exposure/zoom etc. #5

Closed trcwm closed 7 years ago

trcwm commented 7 years ago

Instead of having separate get/set functions for each property (zoom, exposure, focus etc), the library has just three functions:

/** get the min/max limits of a camera/stream property (e.g. zoom, exposure etc) */
Cap_getPropertyLimits(CapContext ctx, CapStream stream, CapPropertyID propID, int32_t *min, int32_t *max);

/** set the value of a camera/stream property (e.g. zoom, exposure etc) */
Cap_setProperty(CapContext ctx, CapStream stream, CapPropertyID propID, int32_t value);

/** set the automatic flag of a camera/stream property (e.g. zoom, focus etc) */
Cap_setAutoProperty(CapContext ctx, CapStream stream, CapPropertyID propID, uint32_t bOnOff);

This simplifies the API and makes sure we can add properties in the future.

vonnieda commented 7 years ago

Hey @trcwm, I haven't done a full review of this, but the API changes make sense to me and I think it's a good way to go. I'd say go ahead and merge it as long as you are happy with it.

trcwm commented 7 years ago

Ok, will merge!