Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added the monochrome filter to the showcase.

  • Loading branch information...
commit 6619cd27f1fb658e44f003962093e80be3ef5f63 1 parent 75743cb
@BradLarson authored
View
4 README.md
@@ -82,6 +82,10 @@ Documentation is generated from header comments using appledoc. To build the doc
- **GPUImageGrayscaleFilter**: Converts an image to grayscale (a slightly faster implementation of the saturation filter, without the ability to vary the color contribution)
+- **GPUImageMonochromeFilter**: Converts the image to a single-color version, based on the luminance of each pixel
+ - *intensity*: The degree to which the specific color replaces the normal image color (0.0 - 1.0, with 1.0 as the default)
+ - *color*: The color to use as the basis for the effect, with (0.6, 0.45, 0.3, 1.0) as the default.
+
- **GPUImageSepiaFilter**: Simple sepia tone filter
- *intensity*: The degree to which the sepia tone replaces the normal image color (0.0 - 1.0, with 1.0 as the default)
View
1  examples/FilterShowcase/FilterShowcase/ShowcaseFilterListController.m
@@ -66,6 +66,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
case GPUIMAGE_BRIGHTNESS: cell.textLabel.text = @"Brightness"; break;
case GPUIMAGE_EXPOSURE: cell.textLabel.text = @"Exposure"; break;
case GPUIMAGE_RGB: cell.textLabel.text = @"RGB"; break;
+ case GPUIMAGE_MONOCHROME: cell.textLabel.text = @"Monochrome"; break;
case GPUIMAGE_SHARPEN: cell.textLabel.text = @"Sharpen"; break;
case GPUIMAGE_UNSHARPMASK: cell.textLabel.text = @"Unsharp mask"; break;
case GPUIMAGE_GAMMA: cell.textLabel.text = @"Gamma"; break;
View
1  examples/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.h
@@ -7,6 +7,7 @@ typedef enum {
GPUIMAGE_BRIGHTNESS,
GPUIMAGE_EXPOSURE,
GPUIMAGE_RGB,
+ GPUIMAGE_MONOCHROME,
GPUIMAGE_SHARPEN,
GPUIMAGE_UNSHARPMASK,
GPUIMAGE_TRANSFORM,
View
13 examples/FilterShowcase/FilterShowcase/ShowcaseFilterViewController.m
@@ -116,6 +116,18 @@ - (void)setupFilter;
filter = [[GPUImageGrayscaleFilter alloc] init];
}; break;
+ case GPUIMAGE_MONOCHROME:
+ {
+ self.title = @"Monochrome";
+ self.filterSettingsSlider.hidden = NO;
+
+ [self.filterSettingsSlider setValue:1.0];
+ [self.filterSettingsSlider setMinimumValue:0.0];
+ [self.filterSettingsSlider setMaximumValue:1.0];
+
+ filter = [[GPUImageMonochromeFilter alloc] init];
+ [(GPUImageMonochromeFilter *)filter setColor:(GPUVector4){0.0f, 0.0f, 1.0f, 1.f}];
+ }; break;
case GPUIMAGE_SATURATION:
{
self.title = @"Saturation";
@@ -994,6 +1006,7 @@ - (IBAction)updateFilterFromSlider:(id)sender;
case GPUIMAGE_CONTRAST: [(GPUImageContrastFilter *)filter setContrast:[(UISlider *)sender value]]; break;
case GPUIMAGE_BRIGHTNESS: [(GPUImageBrightnessFilter *)filter setBrightness:[(UISlider *)sender value]]; break;
case GPUIMAGE_EXPOSURE: [(GPUImageExposureFilter *)filter setExposure:[(UISlider *)sender value]]; break;
+ case GPUIMAGE_MONOCHROME: [(GPUImageMonochromeFilter *)filter setIntensity:[(UISlider *)sender value]]; break;
case GPUIMAGE_RGB: [(GPUImageRGBFilter *)filter setGreen:[(UISlider *)sender value]]; break;
case GPUIMAGE_SHARPEN: [(GPUImageSharpenFilter *)filter setSharpness:[(UISlider *)sender value]]; break;
case GPUIMAGE_HISTOGRAM: [(GPUImageHistogramFilter *)filter setDownsamplingFactor:round([(UISlider *)sender value])]; break;
View
3  framework/Source/GPUImage.h
@@ -101,4 +101,5 @@
#import "GPUImageClosingFilter.h"
#import "GPUImageRGBClosingFilter.h"
#import "GPUImageColorPackingFilter.h"
-#import "GPUImageSphereRefractionFilter.h"
+#import "GPUImageSphereRefractionFilter.h"
+#import "GPUImageMonochromeFilter.h"

0 comments on commit 6619cd2

Please sign in to comment.
Something went wrong with that request. Please try again.