This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (CMSampleBufferRef)videoCapture:(RTCVideoCaptureIosObjC *)videoCapture modifiedSampleBufferFromSampleBuffer:(CMSampleBufferRef)sampleBuffer frameWasModified:(BOOL *)frameWasModified { | |
| [self setUsingWebRTCCapture:YES]; | |
| CVImageBufferRef imageBufferRef = CMSampleBufferGetImageBuffer(sampleBuffer); | |
| CIImage *image = [[CIImage imageWithCVImageBuffer:imageBufferRef] imageByApplyingTransform:CGAffineTransformScale(CGAffineTransformMakeRotation(M_PI_2), 1, 1)]; | |
| CMSampleBufferRef retval = sampleBuffer; | |
| if (self.selectedFilter != nil) { | |
| image = [self.selectedFilter filteredImageFromImage:image context:self.coreImageContext]; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (UIImage *)BB_imageByAdjustingSaturationOfImage:(UIImage *)image delta:(CGFloat)delta; { | |
| NSParameterAssert(image); | |
| // if user passed really small delta, it wont make any difference, just return the original image | |
| if (fabs(delta - 1.0) < __FLT_EPSILON__) { | |
| return image; | |
| } | |
| // https://dvcs.w3.org/hg/FXTF/raw-file/default/filters/index.html#grayscaleEquivalent | |
| CGFloat floatingPointSaturationMatrix[] = { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (UIImage *)BB_imageByAdjustingSaturationOfImage:(UIImage *)image delta:(CGFloat)delta; { | |
| NSParameterAssert(image); | |
| CIFilter *filter = [CIFilter filterWithName:@"CIColorControls"]; | |
| [filter setDefaults]; | |
| [filter setValue:@(delta) forKey:@"inputSaturation"]; | |
| [filter setValue:[CIImage imageWithCGImage:image.CGImage] forKey:@"inputImage"]; | |
| CIImage *output = [filter valueForKey:@"outputImage"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # Set the build number to the current git commit count. | |
| # If we're using the Dev scheme, then we'll suffix the build | |
| # number with the current branch name, to make collisions | |
| # far less likely across feature branches. | |
| # Based on: http://w3facility.info/question/how-do-i-force-xcode-to-rebuild-the-info-plist-file-in-my-project-every-time-i-build-the-project/ | |
| # | |
| git=`sh /etc/profile; which git` | |
| appBuild=`"$git" rev-list --all |wc -l` | |
| if [ $CONFIGURATION = "Debug" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| + (UIImage *)BB_imageByRenderingImage:(UIImage *)image withColor:(UIColor *)color; { | |
| NSParameterAssert(image); | |
| NSParameterAssert(color); | |
| UIGraphicsBeginImageContextWithOptions(image.size, NO, image.scale); | |
| [color setFill]; | |
| [[image imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate] drawAtPoint:CGPointZero blendMode:kCGBlendModeNormal alpha:1.0]; | |
| UIImage *retval = [UIGraphicsGetImageFromCurrentImageContext() imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
| // | |
| // The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
| // | |
| // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS |
NewerOlder