Ogre::GLESPixelUtil Class Reference

Class to do pixel format mapping between GL and OGRE. More...

`#include <OgreGLESPixelFormat.h>`

List of all members.

## Static Public Member Functions

static GLenum | getGLOriginFormat (PixelFormat mFormat)
| Takes the OGRE pixel format and returns the appropriate GL one.
static GLenum | getGLOriginDataType (PixelFormat mFormat)
| Takes the OGRE pixel format and returns type that must be provided to GL as data type for reading it into the GPU.
static GLenum | getGLInternalFormat (PixelFormat mFormat, bool hwGamma=false)
| Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.
static GLenum | getClosestGLInternalFormat (PixelFormat mFormat, bool hwGamma=false)
| Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.
static PixelFormat | getClosestOGREFormat (GLenum fmt, GLenum dataType)
| Function to get the closest matching OGRE format to an internal GL format.
static size_t | getMaxMipmaps (size_t width, size_t height, size_t depth, PixelFormat format)
| Returns the maximum number of Mipmaps that can be generated until we reach the mininum format possible.
static size_t | optionalPO2 (size_t value)
| Returns next power-of-two size if required by render system, in case RSC_NON_POWER_OF_2_TEXTURES is supported it returns value as-is.
static void | convertToGLformat (const PixelBox &src, const PixelBox &dst)

## Detailed Description

Class to do pixel format mapping between GL and OGRE.

Definition at line 40 of file OgreGLESPixelFormat.h.

## Member Function Documentation

static void Ogre::GLESPixelUtil::convertToGLformat | ( | const PixelBox & | src,
|  | const PixelBox & | dst
| ) |  | `[static]`

static GLenum Ogre::GLESPixelUtil::getClosestGLInternalFormat | ( | PixelFormat | mFormat,
|  | bool | hwGamma = `false`
| ) |  | `[static]`

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.

If no match exists, returns the closest match.

Parameters:

  mFormat | The pixel format
  hwGamma | Whether a hardware gamma-corrected version is requested

static PixelFormat Ogre::GLESPixelUtil::getClosestOGREFormat | ( | GLenum | fmt,
|  | GLenum | dataType
| ) |  | `[static]`

Function to get the closest matching OGRE format to an internal GL format.

To be precise, the format will be chosen that is most efficient to transfer to the card without losing precision.

Remarks:
  It is valid for this function to always return PF_A8R8G8B8.

static GLenum Ogre::GLESPixelUtil::getGLInternalFormat | ( | PixelFormat | mFormat,
|  | bool | hwGamma = `false`
| ) |  | `[static]`

Takes the OGRE pixel format and returns the type that must be provided to GL as internal format.

GL_NONE if no match exists.

Parameters:

  mFormat | The pixel format
  hwGamma | Whether a hardware gamma-corrected version is requested

static GLenum Ogre::GLESPixelUtil::getGLOriginDataType | ( | PixelFormat | mFormat | ) | `[static]`

Takes the OGRE pixel format and returns type that must be provided to GL as data type for reading it into the GPU.

Returns:
  a GLenum describing the data type, or 0 if there is no exactly matching one (and conversion is needed)

static GLenum Ogre::GLESPixelUtil::getGLOriginFormat | ( | PixelFormat | mFormat | ) | `[static]`

Takes the OGRE pixel format and returns the appropriate GL one.

Returns:
  a GLenum describing the format, or 0 if there is no exactly matching one (and conversion is needed)

static size_t Ogre::GLESPixelUtil::getMaxMipmaps | ( | size_t | width,
|  | size_t | height,
|  | size_t | depth,
|  | PixelFormat | format
| ) |  | `[static]`

Returns the maximum number of Mipmaps that can be generated until we reach the mininum format possible.

This does not count the base level.

Parameters:

  width | The width of the area
  height | The height of the area
  depth | The depth of the area
  format | The format of the area

Remarks:
  In case that the format is non-compressed, this simply returns how many times we can divide this texture in 2 until we reach 1x1. For compressed formats, constraints apply on minimum size and alignment so this might differ.

static size_t Ogre::GLESPixelUtil::optionalPO2 | ( | size_t | value | ) | `[static]`

Returns next power-of-two size if required by render system, in case RSC_NON_POWER_OF_2_TEXTURES is supported it returns value as-is.

The documentation for this class was generated from the following file:

- OgreGLESPixelFormat.h

Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Sun Sep 2 2012 07:27:58