com.io7m.jcanephora.core.api

## Interface JCGLBlendingType

-     public interface JCGLBlendingType

  The interface to OpenGL blending.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `blendingDisable()` Disable blending.
    `default void` | `blendingEnable(JCGLBlendFunction source_factor, JCGLBlendFunction destination_factor)` Enable blending with the given blending functions.
    `default void` | `blendingEnableSeparate(JCGLBlendFunction source_rgb_factor, JCGLBlendFunction source_alpha_factor, JCGLBlendFunction destination_rgb_factor, JCGLBlendFunction destination_alpha_factor)` Enable blending with the given blending functions.
    `void` | `blendingEnableSeparateWithEquationSeparate(JCGLBlendFunction source_rgb_factor, JCGLBlendFunction source_alpha_factor, JCGLBlendFunction destination_rgb_factor, JCGLBlendFunction destination_alpha_factor, JCGLBlendEquation equation_rgb, JCGLBlendEquation equation_alpha)` Enable blending with the blending functions `source_rgb_factor`, `source_alpha_factor`, `destination_rgb_factor`, and `destination_alphafactor`.
    `default void` | `blendingEnableWithEquation(JCGLBlendFunction source_factor, JCGLBlendFunction destination_factor, JCGLBlendEquation equation)` Enable blending with the given blending functions and equation.
    `default void` | `blendingEnableWithEquationSeparate(JCGLBlendFunction source_factor, JCGLBlendFunction destination_factor, JCGLBlendEquation equation_rgb, JCGLBlendEquation equation_alpha)` Enable blending with the given blending functions and equation.
    `boolean` | `blendingIsEnabled()`

- - ### Method Detail

    - #### blendingDisable

          void blendingDisable()
                        throws JCGLException

      Disable blending.
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### blendingIsEnabled

          boolean blendingIsEnabled()
                             throws JCGLException

      Returns:
        `true` iff blending is enabled
      Throws:
        `JCGLException` - Iff an OpenGL error occurs

    - #### blendingEnable

          default void blendingEnable(JCGLBlendFunction source_factor,
                                      JCGLBlendFunction destination_factor)
                               throws JCGLException,
                                      JCGLExceptionBlendingMisconfigured

      Enable blending with the given blending functions. The function is equivalent to: `{@link JCGLBlendingType#blendingEnableSeparateWithEquationSeparate}( source_factor, source_factor, destination_factor, destination_factor, JCGLBlendEquation.BLEND_EQUATION_ADD, JCGLBlendEquation .BLEND_EQUATION_ADD);`
      Parameters:
        `source_factor` - The source factor
        `destination_factor` - The destination factor
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionBlendingMisconfigured` - Iff the combination of blending parameters is invalid

    - #### blendingEnableSeparate

          default void blendingEnableSeparate(JCGLBlendFunction source_rgb_factor,
                                              JCGLBlendFunction source_alpha_factor,
                                              JCGLBlendFunction destination_rgb_factor,
                                              JCGLBlendFunction destination_alpha_factor)
                                       throws JCGLException,
                                              JCGLExceptionBlendingMisconfigured

      Enable blending with the given blending functions. The function is equivalent to: `{@link JCGLBlendingType#blendingEnableSeparateWithEquationSeparate}( source_rgb_factor, source_alpha_factor, destination_rgb_factor, destination_alpha_factor, JCGLBlendEquation.BLEND_EQUATION_ADD, JCGLBlendEquation.BLEND_EQUATION_ADD);`
      Parameters:
        `source_rgb_factor` - The function used to blend the RGB components of incoming (source) color values
        `source_alpha_factor` - The function used to blend the alpha components of incoming (source) color values
        `destination_rgb_factor` - The function used to blend the RGB components of the existing (destination) color values
        `destination_alpha_factor` - The function used to blend the alpha components of the existing (destination) color values
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionBlendingMisconfigured` - Iff the combination of blending parameters is invalid

    - #### blendingEnableSeparateWithEquationSeparate

          void blendingEnableSeparateWithEquationSeparate(JCGLBlendFunction source_rgb_factor,
                                                          JCGLBlendFunction source_alpha_factor,
                                                          JCGLBlendFunction destination_rgb_factor,
                                                          JCGLBlendFunction destination_alpha_factor,
                                                          JCGLBlendEquation equation_rgb,
                                                          JCGLBlendEquation equation_alpha)
                                                   throws JCGLException,
                                                          JCGLExceptionBlendingMisconfigured

      Enable blending with the blending functions `source_rgb_factor`, `source_alpha_factor`, `destination_rgb_factor`, and `destination_alphafactor`. The OpenGL defaults are `BLEND_ONE` for `source_rgb_factor` and `source_alpha_factor`, and `BLEND_ZERO`, for and `destination_rgb_factor` and `destination_alpha_factor`, respectively.

      The given blend functions are applied to the RGB and alpha elements of the colors in question separately (as opposed to `blendingEnable(com.io7m.jcanephora.core.JCGLBlendFunction, com.io7m.jcanephora.core.JCGLBlendFunction)`, which applies the given functions to the RGB and alpha components simultaneously).

      The given blend equations `equation_rgb` and `equation_alpha` determine how an incoming pixel is blended with the corresponding pixel in the framebuffer. The OpenGL default is `BLEND_EQUATION_ADD` for both equations.

      This is the most general form of blending specification, and the other methods in the interface are defined in terms of this one.

      Parameters:
        `source_rgb_factor` - The function used to blend the RGB components of incoming (source) color values
        `source_alpha_factor` - The function used to blend the alpha components of incoming (source) color values
        `destination_rgb_factor` - The function used to blend the RGB components of the existing (destination) color values
        `destination_alpha_factor` - The function used to blend the alpha components of the existing (destination) color values
        `equation_rgb` - The equation used to blend the RGB components
        `equation_alpha` - The equation used to blend the alpha components
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionBlendingMisconfigured` - Iff the combination of blending parameters is invalid

    - #### blendingEnableWithEquation

          default void blendingEnableWithEquation(JCGLBlendFunction source_factor,
                                                  JCGLBlendFunction destination_factor,
                                                  JCGLBlendEquation equation)
                                           throws JCGLException,
                                                  JCGLExceptionBlendingMisconfigured

      Enable blending with the given blending functions and equation. The function is equivalent to: `{@link JCGLBlendingType#blendingEnableSeparateWithEquationSeparate}( source_factor, source_factor, destination_factor, destination_factor, equation, equation);`
      Parameters:
        `source_factor` - The source factor
        `destination_factor` - The destination factor
        `equation` - The blend equation
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionBlendingMisconfigured` - Iff the combination of blending parameters is invalid

    - #### blendingEnableWithEquationSeparate

          default void blendingEnableWithEquationSeparate(JCGLBlendFunction source_factor,
                                                          JCGLBlendFunction destination_factor,
                                                          JCGLBlendEquation equation_rgb,
                                                          JCGLBlendEquation equation_alpha)
                                                   throws JCGLException,
                                                          JCGLExceptionBlendingMisconfigured

      Enable blending with the given blending functions and equation. The function is equivalent to: `{@link JCGLBlendingType#blendingEnableSeparateWithEquationSeparate}( source_factor, source_factor, destination_factor, destination_factor, equation_rgb, equation_alpha);`
      Parameters:
        `source_factor` - The source factor
        `destination_factor` - The destination factor
        `equation_rgb` - The blend equation for the RGB components
        `equation_alpha` - The blend equation for the alpha components
      Throws:
        `JCGLException` - Iff an OpenGL error occurs
        `JCGLExceptionBlendingMisconfigured` - Iff the combination of blending parameters is invalid

Copyright © 2016 <code@io7m.com> http://io7m.com