Skip to content

Commit

Permalink
ofPixels.h: CLAMP -> ofClamp and include ofMath
Browse files Browse the repository at this point in the history
  • Loading branch information
arturoc committed Aug 6, 2018
1 parent cec70b0 commit 5b6dc65
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion libs/openFrameworks/graphics/ofPixels.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "ofUtils.h"
#include "ofColor.h"
#include "ofLog.h"
#include "ofMath.h"
#include <limits>


Expand Down Expand Up @@ -706,7 +707,7 @@ void ofPixels_<PixelType>::copyFrom(const ofPixels_<SrcType> & mom){
if(sizeof(SrcType) == sizeof(float)) {
// coming from float we need a special case to clamp the values
for(size_t i = 0; i < mom.size(); i++){
pixels[i] = CLAMP(mom[i], 0, 1) * factor;
pixels[i] = ofClamp(mom[i], 0, 1) * factor;
}
} else{
// everything else is a straight scaling
Expand Down

0 comments on commit 5b6dc65

Please sign in to comment.