sio2_image.h File Reference

#include "jpeglib.h"
#include "png.h"

Include dependency graph for sio2_image.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  SIO2pvrheader
 PVRTC file header. More...
struct  SIO2image

Enumerations

enum  SIO2_IMAGE_FLAG { SIO2_IMAGE_MIPMAP = ( 1 << 0 ), SIO2_IMAGE_CLAMP = ( 1 << 1 ) }
enum  SIO2_IMAGE_FILTER_TYPE { SIO2_IMAGE_FILTER_1X = 0, SIO2_IMAGE_FILTER_2X, SIO2_IMAGE_FILTER_3X, SIO2_IMAGE_FILTER_4X }
enum  SIO2_IMAGE_ANISOTROPIC_TYPE { SIO2_IMAGE_ISOTROPIC = 0, SIO2_IMAGE_ANISOTROPIC_1X, SIO2_IMAGE_ANISOTROPIC_2X }
enum  SIO2_PVRTC_FLAGS { SIO2_PVRTC_FLAG_PVRTC2 = 24, SIO2_PVRTC_FLAG_PVRTC4 = 25, SIO2_PVRTC_FLAG_MASK = 0xFF }
 PVRTC flags. More...

Functions

SIO2imagesio2ImageInit (char *)
SIO2imagesio2ImageFree (SIO2image *)
void sio2ImageLoad (SIO2image *, SIO2stream *)
void sio2ImageLoadJPEG (SIO2image *, SIO2stream *)
void sio2ImageLoadTGA (SIO2image *, SIO2stream *)
void sio2ImageLoadPNG (SIO2image *, SIO2stream *)
void sio2ImageLoadPVR (SIO2image *, SIO2stream *)
void sio2ImageGenId (SIO2image *, unsigned int, float)
void sio2ImageScale (SIO2image *, unsigned int, unsigned int)
void sio2ImageFlip (SIO2image *)
void sio2ImageSetAlpha (SIO2image *, SIO2image *)
void sio2ImageRGBAtoBGRA (SIO2image *)
void sio2ImageBlur (SIO2image *)
void sio2ImageRender (SIO2image *)


Enumeration Type Documentation

Enumerator:
SIO2_IMAGE_ISOTROPIC  Disable the use of anisotropic filtering.
SIO2_IMAGE_ANISOTROPIC_1X  Enable anistotropic filtering (1 pass).
SIO2_IMAGE_ANISOTROPIC_2X  Enable anisotropic filtering (2 pass).

Enumerator:
SIO2_IMAGE_FILTER_1X 
SIO2_IMAGE_FILTER_2X 
SIO2_IMAGE_FILTER_3X 
SIO2_IMAGE_FILTER_4X 

Enumerator:
SIO2_IMAGE_MIPMAP  Enable mipmapping for the SIO2image.
SIO2_IMAGE_CLAMP  Enable image clamping on the UV, 0 to 1 only no texture repeat.

PVRTC flags.

Enumerator:
SIO2_PVRTC_FLAG_PVRTC2 
SIO2_PVRTC_FLAG_PVRTC4 
SIO2_PVRTC_FLAG_MASK 


Function Documentation

void sio2ImageBlur ( SIO2image _SIO2image  ) 

Effectuate a standard gaussian blur on an SIO2image.

_SIO2image: A valid SIO2image pointer with texels loaded.

References SIO2image::bits, SIO2image::height, SIO2image::tex, and SIO2image::width.

void sio2ImageFlip ( SIO2image _SIO2image  ) 

Flip an image on the Y axis. Since format such as TGA can have an inverted origin, this function will flip the image in a way that OpenGL is expecting it.

_SIO2image: A valid SIO2image pointer with texels loaded.

References SIO2image::bits, SIO2image::height, SIO2image::tex, and SIO2image::width.

Referenced by sio2ImageLoadPNG(), and sio2ImageLoadTGA().

SIO2image* sio2ImageFree ( SIO2image _SIO2image  ) 

Free a valid SIO2image pointer, and remove its handle from the global sio2 SIO2resource handle.

_SIO2image: A valid SIO2image pointer.

return a NULL SIO2image structure pointer.

References SIO2::_SIO2resource, sio2, SIO2_IMAGE, sio2ResourceDel(), SIO2image::tex, and SIO2image::tid.

Referenced by sio2ResourceUnload().

Here is the call graph for this function:

void sio2ImageGenId ( SIO2image _SIO2image,
unsigned int  _flags,
float  _filter 
)

Generate an OpenGL texture ID based on the

_SIO2image: A valid SIO2image pointer.
_flags: The bit mask that have to be used with the image. For more info check: SIO2_IMAGE_FLAG.
_filter: The filter controlled by the GL_TEXTURE_LOD_BIAS_EXT (available for SIO2_IMAGE_MIPMAP only).

For more info on GL_TEXTURE_LOD_BIAS_EXT: http://www.opengl.org/sdk/docs/man/xhtml/glGetTexEnv.xml

References SIO2::afilter, SIO2image::bits, SIO2image::compression, SIO2image::filter, SIO2image::flags, SIO2image::height, sio2, SIO2_IMAGE_CLAMP, SIO2_IMAGE_ISOTROPIC, SIO2_IMAGE_MIPMAP, sio2GetMipmap(), sio2IsStateEnabled(), SIO2image::tex, SIO2image::tid, and SIO2image::width.

Referenced by sio2ResourceGenId(), and sio2VideoGetImage().

Here is the call graph for this function:

SIO2image* sio2ImageInit ( char _name  ) 

Create a new SIO2image, this new SIO2image pointer will be added to the global sio2 SIO2resource handle.

_name: The name to use to associate the SIO2image within the SIO2resource.

return a new SIO2image structure pointer.

References SIO2::_SIO2resource, SIO2image::name, sio2, SIO2_IMAGE, sio2ResourceAdd(), and sio2StringCpy().

Referenced by sio2ResourceDispatchStream().

Here is the call graph for this function:

void sio2ImageLoad ( SIO2image _SIO2image,
SIO2stream _SIO2stream 
)

This function is used to dispatch the content of an SIO2stream to the appropriate loading function. The filename of the SIO2stream structure will be tested agains the appropriate loader file extension and then dispatched if found.

_SIO2image: A valid SIO2image pointer.
_SIO2stream: A valid SIO2stream pointer that contain loaded image data in its buffer.

References SIO2stream::fname, SIO2_MAX_PATH, sio2ImageLoadJPEG(), sio2ImageLoadPNG(), sio2ImageLoadPVR(), sio2ImageLoadTGA(), sio2StringCpy(), sio2StringTok(), and sio2StringToUpper().

Referenced by sio2ResourceDispatchStream().

Here is the call graph for this function:

void sio2ImageLoadJPEG ( SIO2image _SIO2image,
SIO2stream _SIO2stream 
)

Load .JPEG data from an SIO2stream buffer and assign the necessary data back to a valid SIO2image pointer.

_SIO2image: A valid SIO2image pointer.
_SIO2stream: A valid SIO2stream pointer that contain loaded image data in its buffer.

References SIO2image::bits, SIO2stream::buf, SIO2image::height, SIO2stream::size, SIO2image::tex, and SIO2image::width.

Referenced by sio2ImageLoad().

void sio2ImageLoadPNG ( SIO2image _SIO2image,
SIO2stream _SIO2stream 
)

Load .PNG data from an SIO2stream buffer and assign the necessary data back to a valid SIO2image pointer.

_SIO2image: A valid SIO2image pointer.
_SIO2stream: A valid SIO2stream pointer that contain loaded image data in its buffer.

References SIO2image::bits, SIO2stream::fname, SIO2image::height, sio2ImageFlip(), sio2ImageRGBAtoBGRA(), sio2PngRead(), SIO2image::tex, and SIO2image::width.

Referenced by sio2ImageLoad().

Here is the call graph for this function:

void sio2ImageLoadPVR ( SIO2image _SIO2image,
SIO2stream _SIO2stream 
)

Load .PVR data from an SIO2stream buffer and assign the necessary data back to a valid SIO2image pointer.

_SIO2image: A valid SIO2image pointer.
_SIO2stream: A valid SIO2stream pointer that contain loaded image data in its buffer.

For more information about the PVR format and its restriction(s) please check:

http://developer.apple.com/iphone/library/qa/qa2008/qa1611.html

References SIO2pvrheader::bitalpha, SIO2image::bits, SIO2pvrheader::bpp, SIO2stream::buf, SIO2image::compression, SIO2pvrheader::datasize, SIO2pvrheader::flags, SIO2pvrheader::height, SIO2image::height, SIO2_PVRTC_FLAG_MASK, SIO2_PVRTC_FLAG_PVRTC2, SIO2_PVRTC_FLAG_PVRTC4, SIO2pvrheader::tag, SIO2image::tex, SIO2pvrheader::width, and SIO2image::width.

Referenced by sio2ImageLoad().

void sio2ImageLoadTGA ( SIO2image _SIO2image,
SIO2stream _SIO2stream 
)

Load .TGA data from an SIO2stream buffer and assign the necessary data back to a valid SIO2image pointer.

_SIO2image: A valid SIO2image pointer.
_SIO2stream: A valid SIO2stream pointer that contain loaded image data in its buffer.

References SIO2image::bits, SIO2image::height, sio2ImageFlip(), sio2StreamRead(), sio2StreamReadPtr(), SIO2image::tex, and SIO2image::width.

Referenced by sio2ImageLoad().

Here is the call graph for this function:

void sio2ImageRender ( SIO2image _SIO2image  ) 

Bind a valid SIO2image that have already get a texture id (sio2ImageGenId).

_SIO2image: A valid SIO2image pointer.

References SIO2image::tid.

Referenced by sio2MaterialRender().

void sio2ImageRGBAtoBGRA ( SIO2image _SIO2image  ) 

Convert RGBA texels data to BGRA the default texture format for texture that have alpha in SIO2.

_SIO2image: A valid SIO2image pointer with texels loaded. (32 bits)

References SIO2image::bits, SIO2image::height, SIO2image::tex, and SIO2image::width.

Referenced by sio2ImageLoadPNG().

void sio2ImageScale ( SIO2image _SIO2image,
unsigned int  _width,
unsigned int  _height 
)

Quickly rescale an SIO2image to a new width and height.

_SIO2image: A valid SIO2image pointer. Please make sure that the SIO2image texels are properly loaded.
_width: The new width for the texture.
_height: The new height of the texture.

References SIO2image::bits, SIO2image::height, SIO2image::tex, and SIO2image::width.

void sio2ImageSetAlpha ( SIO2image _SIO2image0,
SIO2image _SIO2image1 
)

Add an alpha channel to an SIO2image.

_SIO2image0: A valid SIO2image pointer with texels loaded. (24 bits)
_SIO2image1: A valid SIO2image pointer with texels loaded. (8 bits)

References SIO2image::bits, SIO2image::height, SIO2image::tex, and SIO2image::width.


Generated on Thu Mar 4 15:41:43 2010 for SIO2 Engine by  doxygen 1.5.6