C# Class NewTOAPIA.GL.Imaging.UnaryTextureProcessor

This class serves as a base class for all image processors that follow a particular pattern. That pattern is there is a single fragment shader that is executed across the entirety of the image. Grayscale conversion would be one example. I takes care of drawing into a Quad to ensure each texel of the source image is operated on. A subclasser need only supply the fragment shader string. This class will allocate a texture object based on the width and height specified and return that texture object to the caller during the ProcessImage() call.
Inheritance: GIObject, IUnaryTextureProcessor
Show file Open project: Wiladams/NewTOAPIA Class Usage Examples

Public Properties

Property Type Description
FixedFrag string
FixedVert string

Public Methods

Method Description
CreateRenderTarget ( ) : GLRenderTarget
ProcessTexture ( GLTexture2D baseTexture ) : GLTexture2D

Peform conversion to grayscale

UnaryTextureProcessor ( GraphicsInterface gi, int width, int height ) : System
UnaryTextureProcessor ( GraphicsInterface gi, int width, int height, string fragmentString ) : System

Protected Methods

Method Description
BindBaseTexture ( ) : void
BindRenderTarget ( ) : void
BindShaderProgram ( ) : void
CreateOutputTexture ( int width, int height ) : GLTexture2D
RenderGeometry ( ) : void
SetUniformVariables ( ) : void
UnbindBaseTexture ( ) : void
UnbindRenderTarget ( ) : void
UnbindShaderProgram ( ) : void

Method Details

BindBaseTexture() protected method

protected BindBaseTexture ( ) : void
return void

BindRenderTarget() protected method

protected BindRenderTarget ( ) : void
return void

BindShaderProgram() protected method

protected BindShaderProgram ( ) : void
return void

CreateOutputTexture() protected method

protected CreateOutputTexture ( int width, int height ) : GLTexture2D
width int
height int
return GLTexture2D

CreateRenderTarget() public method

public CreateRenderTarget ( ) : GLRenderTarget
return GLRenderTarget

ProcessTexture() public method

Peform conversion to grayscale
public ProcessTexture ( GLTexture2D baseTexture ) : GLTexture2D
baseTexture GLTexture2D
return GLTexture2D

RenderGeometry() protected method

protected RenderGeometry ( ) : void
return void

SetUniformVariables() protected method

protected SetUniformVariables ( ) : void
return void

UnaryTextureProcessor() public method

public UnaryTextureProcessor ( GraphicsInterface gi, int width, int height ) : System
gi GraphicsInterface
width int
height int
return System

UnaryTextureProcessor() public method

public UnaryTextureProcessor ( GraphicsInterface gi, int width, int height, string fragmentString ) : System
gi GraphicsInterface
width int
height int
fragmentString string
return System

UnbindBaseTexture() protected method

protected UnbindBaseTexture ( ) : void
return void

UnbindRenderTarget() protected method

protected UnbindRenderTarget ( ) : void
return void

UnbindShaderProgram() protected method

protected UnbindShaderProgram ( ) : void
return void

Property Details

FixedFrag public static property

This string represents a fragment shader that is a pass-through when you have a texture object.
public static string FixedFrag
return string

FixedVert public static property

public static string FixedVert
return string