Skip to content

Commit

Permalink
Added backlight compensation to windows
Browse files Browse the repository at this point in the history
  • Loading branch information
trcwm committed Jan 7, 2018
1 parent f5d21c0 commit d041db5
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 6 deletions.
3 changes: 1 addition & 2 deletions include/openpnp-capture.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,7 @@ typedef uint32_t CapFormatID; ///< format identifier 0 .. numFormats
#define CAPPROPID_HUE 10
#define CAPPROPID_SHARPNESS 11
#define CAPPROPID_BACKLIGHTCOMP 12
#define CAPPROPID_COLORENABLE 13
#define CAPPROPID_LAST 14
#define CAPPROPID_LAST 13

typedef uint32_t CapPropertyID; ///< property ID (exposure, zoom, focus etc.)

Expand Down
2 changes: 0 additions & 2 deletions linux/platformstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,8 +652,6 @@ bool PlatformStream::setProperty(uint32_t propID, int32_t value)
case CAPPROPID_BACKLIGHTCOMP:
ctrl.id = V4L2_CID_BACKLIGHT_COMPENSATION;
break;
// CAPPROPID_COLORENABLE is probably the same as V4L2_CID_COLOR_KILLER
// but that is a boolean -- do we need special handling of this?
default:
return false;
}
Expand Down
20 changes: 19 additions & 1 deletion mac/uvcctrl.mm
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,11 @@ of this software and associated documentation files (the "Software"), to deal
#define CT_ZOOM_RELATIVE_CONTROL 0x0C

// Processing unit control selectors
#define PU_BACKLIGHT_COMPENSATION_CONTROL 0x01
#define PU_BRIGHTNESS_CONTROL 0x02
#define PU_CONTRAST_CONTROL 0x03
#define PU_GAIN_CONTROL 0x04
#define PU_POWER_LINE_FREQUENCY_CONTROL 0x05
#define PU_HUE_CONTROL 0x06
#define PU_SATURATION_CONTROL 0x07
#define PU_SHARPNESS_CONTROL 0x08
Expand Down Expand Up @@ -98,6 +100,9 @@ of this software and associated documentation files (the "Software"), to deal
uint32_t length; // length (bytes)
};

/** The order of the propertyInfo structure must
be the same as the PROPID numbers in the
openpnp-capture.h header */
const propertyInfo_t propertyInfo[] =
{
{0,0,0},
Expand All @@ -109,9 +114,22 @@ of this software and associated documentation files (the "Software"), to deal
{PU_BRIGHTNESS_CONTROL , 1, 2},
{PU_CONTRAST_CONTROL , 1, 2},
{PU_SATURATION_CONTROL , 1, 2},
{PU_GAMMA_CONTROL , 1, 2}
{PU_GAMMA_CONTROL , 1, 2},
{PU_HUE_CONTROL , 1, 2},
{PU_SHARPNESS_CONTROL , 1, 2},
{PU_BACKLIGHT_COMPENSATION_CONTROL , 1, 2},

{PU_POWER_LINE_FREQUENCY_CONTROL , 1, 2}
};

#define CAPPROPID_SATURATION 8
#define CAPPROPID_GAMMA 9
#define CAPPROPID_HUE 10
#define CAPPROPID_SHARPNESS 11
#define CAPPROPID_BACKLIGHTCOMP 12
#define CAPPROPID_COLORENABLE 13


UVCCtrl::UVCCtrl(IOUSBInterfaceInterface190 **controller, uint32_t processingUnitID)
: m_pud(processingUnitID),
m_controller(controller)
Expand Down
4 changes: 3 additions & 1 deletion win/platformstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,11 @@ static const property_t gs_properties[] =
{VideoProcAmp_Saturation, false},
{VideoProcAmp_Gamma, false},
{VideoProcAmp_Hue, false},
{VideoProcAmp_Sharpness, false}
{VideoProcAmp_Sharpness, false},
{VideoProcAmp_BacklightCompensation, false}
};


// **********************************************************************
// StreamCallbackHandler
// **********************************************************************
Expand Down

0 comments on commit d041db5

Please sign in to comment.