# CCEffectBloom Class Reference

Inherits from | CCEffect : NSObject
Declared in | CCEffectBloom.h

## Overview

CCEffectBloom simulates bloooming of bright light when viewed against a darker background. A threshold value allows for the selection of pixels above a certain brightness level while radius and intensity parameters how large the bloom is and how much it contributes to the resulting image.

## Tasks

### Accessing Effect Attributes

- `luminanceThreshold` property
- `intensity` property
- `blurRadius` property

### Initializing a CCEffectBloom object

- `– init`
- `– initWithPixelBlurRadius:intensity:luminanceThreshold:`

### Creating a CCEffectBloom object

- `+ effectWithBlurRadius:intensity:luminanceThreshold:`

## Properties

### blurRadius

The size of the blur of the bloom image. This value is in the range [0..6].

`@property (nonatomic) NSUInteger blurRadius`

#### Declared In

`CCEffectBloom.h`

### intensity

The intensity of the blurred out bloom image when added to the original unmodified image. This value is in the range [0..1]. 0 results in no bloom while higher values result in more bloom.

`@property (nonatomic) float intensity`

#### Declared In

`CCEffectBloom.h`

### luminanceThreshold

The luminance threshold at which pixels will contribute to the bloom. This value is in the range [0..1]. Lower values mean that more pixels will contribute to the blurry bloom image.

`@property (nonatomic) float luminanceThreshold`

#### Declared In

`CCEffectBloom.h`

## Class Methods

### effectWithBlurRadius:intensity:luminanceThreshold:

Creates a CCEffectBloom object with the specified parameters.

`+ (id)effectWithBlurRadius:(NSUInteger)blurRadius intensity:(float)intensity luminanceThreshold:(float)luminanceThreshold`

#### Parameters

blurRadius

  number of pixels blur will extend to (6 is the maximum, because we are limited by the number of varying variables that can be passed to a glsl program).

intensity

  ranges between 0.0-1.0 - defines the contrast of the glowing image. A higher value will make the glow more prevelant.

luminanceThreshold

  ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). 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.

#### Return Value

The CCEffectBloom object.

#### Declared In

`CCEffectBloom.h`

## Instance Methods

### init

Initializes a CCEffectBloom object with the following default values: blurRadius = 2, intensity = 1, luminanceThreshold = 0

`- (id)init`

#### Return Value

The CCEffectBloom object.

#### Declared In

`CCEffectBloom.h`

### initWithPixelBlurRadius:intensity:luminanceThreshold:

Initializes a CCEffectBloom object with the following default parameters:

`- (id)initWithPixelBlurRadius:(NSUInteger)blurRadius intensity:(float)intensity luminanceThreshold:(float)luminanceThreshold`

#### Parameters

blurRadius

  number of pixels blur will extend to (6 is the maximum, because we are limited by the number of varying variables that can be passed to a glsl program).

intensity

  ranges between 0.0-1.0 - defines the contrast of the glowing image. A higher value will make the glow more prevelant.

luminanceThreshold

  ranges between 0.0-1.0 - defines which part of the image should be glown via a luminance factor (brightness). 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.

#### Return Value

The CCEffectBloom object.

#### Declared In

`CCEffectBloom.h`