|
8 | 8 |
|
9 | 9 | #import "CCEffect.h"
|
10 | 10 |
|
| 11 | +/** |
| 12 | + * CCEffectBloom simulates bloooming of bright light when viewed against a darker |
| 13 | + * background. A threshold value allows for the selection of pixels above a certain |
| 14 | + * brightness level while radius and intensity parameters how large the bloom is and |
| 15 | + * how much it contributes to the resulting image. |
| 16 | + */ |
| 17 | + |
11 | 18 | @interface CCEffectBloom : CCEffect
|
12 | 19 |
|
13 |
| -// ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). |
| 20 | +/// ----------------------------------------------------------------------- |
| 21 | +/// @name Accessing Effect Attributes |
| 22 | +/// ----------------------------------------------------------------------- |
| 23 | + |
| 24 | +/** The luminance threshold at which pixels will contribute to the bloom. |
| 25 | + * This value is in the range [0..1]. Lower values mean that more pixels will |
| 26 | + * contribute to the blurry bloom image. |
| 27 | + */ |
14 | 28 | @property (nonatomic) float luminanceThreshold;
|
15 | 29 |
|
16 |
| -// intensity ranges between 0.0-1.0 - defines the contrast of the glowing image. A higher value will make the glow more prevelant. |
| 30 | +/** The intensity of the blurred out bloom image when added to the original |
| 31 | + * unmodified image. This value is in the range [0..1]. 0 results in no bloom |
| 32 | + * while higher values result in more bloom. |
| 33 | + */ |
17 | 34 | @property (nonatomic) float intensity;
|
18 | 35 |
|
19 |
| -// blurRadius number of pixels blur will extend to (6 is the maximum, because we are limited by the number |
20 |
| -// of varying variables that can be passed to a glsl program). TODO: create a slower bloom shader, that does not have this restriction. |
| 36 | +/** The size of the blur of the bloom image. This value is in the range [0..6]. |
| 37 | + */ |
21 | 38 | @property (nonatomic) NSUInteger blurRadius;
|
22 | 39 |
|
| 40 | + |
| 41 | +/// ----------------------------------------------------------------------- |
| 42 | +/// @name Initializing a CCEffectBloom object |
| 43 | +/// ----------------------------------------------------------------------- |
| 44 | + |
23 | 45 | /**
|
| 46 | + * Initializes a CCEffectBloom object with the following default parameters: |
| 47 | + * blurRadius : 2 |
| 48 | + * intensity : 1 |
| 49 | + * luminanceThreshold : 0 |
| 50 | + * |
| 51 | + * @return The CCEffectBloom object. |
| 52 | + */ |
| 53 | +-(id)init; |
| 54 | + |
| 55 | +/** |
| 56 | + * Initializes a CCEffectBloom object with the following default parameters: |
| 57 | + * |
24 | 58 | * @param blurRadius number of pixels blur will extend to (6 is the maximum, because we are limited by the number
|
25 |
| - * of varying variables that can be passed to a glsl program). TODO: create a slower bloom shader, that does not have this restriction. |
| 59 | + * of varying variables that can be passed to a glsl program). |
| 60 | + * |
26 | 61 | * @param intensity ranges between 0.0-1.0 - defines the contrast of the glowing image. A higher value will make the glow more prevelant.
|
27 |
| - * @param luminanceThreshold ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). |
| 62 | + * |
| 63 | + * @param luminanceThreshold ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). |
28 | 64 | * A value of 0.0 will apply bloom to the whole image, a value of 1.0 will only apply bloom to the brightest part of the image.
|
| 65 | + * |
| 66 | + * @return The CCEffectBloom object. |
| 67 | + * |
29 | 68 | */
|
30 |
| --(id)init; |
31 | 69 | -(id)initWithPixelBlurRadius:(NSUInteger)blurRadius intensity:(float)intensity luminanceThreshold:(float)luminanceThreshold;
|
| 70 | + |
| 71 | + |
| 72 | +/// ----------------------------------------------------------------------- |
| 73 | +/// @name Creating a CCEffectBloom object |
| 74 | +/// ----------------------------------------------------------------------- |
| 75 | + |
| 76 | +/** |
| 77 | + * Creates a CCEffectBloom object with the following default parameters: |
| 78 | + * |
| 79 | + * @param blurRadius number of pixels blur will extend to (6 is the maximum, because we are limited by the number |
| 80 | + * of varying variables that can be passed to a glsl program). |
| 81 | + * |
| 82 | + * @param intensity ranges between 0.0-1.0 - defines the contrast of the glowing image. A higher value will make the glow more prevelant. |
| 83 | + * |
| 84 | + * @param luminanceThreshold ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). |
| 85 | + * A value of 0.0 will apply bloom to the whole image, a value of 1.0 will only apply bloom to the brightest part of the image. |
| 86 | + * |
| 87 | + * @return The CCEffectBloom object. |
| 88 | + * |
| 89 | + */ |
32 | 90 | +(id)effectWithPixelBlurRadius:(NSUInteger)blurRadius intensity:(float)intensity luminanceThreshold:(float)luminanceThreshold;
|
33 | 91 |
|
34 | 92 | @end
|
0 commit comments