Skip to content

Commit 3a4b322

Browse files
author
Thayer J Andrews
committed
CCEffectBloom - API documentation
1 parent 7aa86fd commit 3a4b322

File tree

1 file changed

+65
-7
lines changed

1 file changed

+65
-7
lines changed

cocos2d/CCEffectBloom.h

Lines changed: 65 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,85 @@
88

99
#import "CCEffect.h"
1010

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+
1118
@interface CCEffectBloom : CCEffect
1219

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+
*/
1428
@property (nonatomic) float luminanceThreshold;
1529

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+
*/
1734
@property (nonatomic) float intensity;
1835

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+
*/
2138
@property (nonatomic) NSUInteger blurRadius;
2239

40+
41+
/// -----------------------------------------------------------------------
42+
/// @name Initializing a CCEffectBloom object
43+
/// -----------------------------------------------------------------------
44+
2345
/**
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+
*
2458
* @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+
*
2661
* @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).
2864
* 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+
*
2968
*/
30-
-(id)init;
3169
-(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+
*/
3290
+(id)effectWithPixelBlurRadius:(NSUInteger)blurRadius intensity:(float)intensity luminanceThreshold:(float)luminanceThreshold;
3391

3492
@end

0 commit comments

Comments
 (0)