Table of Contents

SHBlendModes

type:
extension
author:
Shilo White
description:
A category that allows blend modes via presets or custom blends.
lastupdate:
2012-03-11
compatible:
v1.X
tag:
blend, blending, mode, blend mode
homepage:
https://gist.github.com/2019733
download:
https://gist.github.com/gists/2019733/download

Properties

blendMode

An integer that specifies a preset blend mode. The initial value is SHBlendModeAuto.

@property (nonatomic, assign) SHBlendMode blendMode;

See presets for valid values.

blendModeName

A readonly string that describes what blending mode is in use. The initial value is “auto”.

@property (nonatomic, readonly) NSString *blendModeName;

blendModeSourceFactor

An integer that specifies how the red, green, blue, and alpha source blending factors are computed. The following symbolic constants are accepted: GL_ZERO, GL_ONE, GL_DST_COLOR, GL_ONE_MINUS_DST_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, GL_ONE_MINUS_DST_ALPHA, and GL_SRC_ALPHA_SATURATE. The initial value is GL_ZERO.

@property (nonatomic, assign) GLenum blendModeSourceFactor;

Changing this property will automatically set “blendMode” property to SHBlendModeCustom.

blendModeDestinationFactor

An integer that specifies how the red, green, blue, and alpha destination blending factors are computed. Eight symbolic constants are accepted: GL_ZERO, GL_ONE, GL_SRC_COLOR, GL_ONE_MINUS_SRC_COLOR, GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA, GL_DST_ALPHA, and GL_ONE_MINUS_DST_ALPHA. The initial value is GL_ZERO.

@property (nonatomic, assign) GLenum blendModeDestinationFactor;

Changing this property will automatically set “blendMode” property to SHBlendModeCustom.

Instance Methods

setBlendModeSourceFactor:destinationFactor:

Sets the blend mode source factor and destination source factor. See blendModeSourceFactor and blendModeDestinationFactor.

- (void)setBlendModeSourceFactor:(GLenum)blendModeSourceFactor destinationFactor:(GLenum)blendModeDestinationFactor;

Calling this method will automatically set “blendMode” property to SHBlendModeCustom.

Presets

Source Code