Ion
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ion::gfx::FramebufferObject::Attachment Class Reference

An attachment represents a data store attached to one of the framebuffer's targets. More...

#include "framebufferobject.h"

Public Member Functions

 Attachment ()
 Creates an unbound Attachment. More...
 
 Attachment (Image::Format format, size_t samples)
 Creates a render buffer attachment for multisampling. More...
 
 Attachment (Image::Format format_in)
 Creates a renderbuffer Attachment of the specified format. More...
 
 Attachment (const ImagePtr &image_in)
 Creates a renderbuffer Attachment from the passed image, which must be of type Image::kEgl or Image::kExternalEgl with format Image::kEglImage, otherwise the Attachment will be set to an unbound binding. More...
 
 Attachment (const TexturePtr &texture_in)
 Creates a texture Attachment using the passed TexturePtr. More...
 
 Attachment (const TexturePtr &texture_in, size_t mip_level)
 As above, but with specified mipmap level of the texture. More...
 
 Attachment (const CubeMapTexturePtr &texture_in, CubeMapTexture::CubeFace face)
 Similar to the constructor for a Texture, but uses the passed face of the cubemap as the backing store of the attachment. More...
 
 Attachment (const CubeMapTexturePtr &texture_in, CubeMapTexture::CubeFace face, size_t mip_level)
 As above, but with specified mipmap level of the cubemap texture. More...
 
Image::Format GetFormat () const
 Gets the format of the attachment, which is the texture format if it is a texture attachment. More...
 
AttachmentBinding GetBinding () const
 Gets the binding of the attachment. More...
 
const ImagePtrGetImage () const
 Gets the image of the attachment, if any. More...
 
const TexturePtrGetTexture () const
 Gets the texture of the attachment, if any. More...
 
const CubeMapTexturePtrGetCubeMapTexture () const
 Gets the cubemap of the attachment, if any. More...
 
CubeMapTexture::CubeFace GetCubeMapFace () const
 Gets the cubemap face of the attachment. More...
 
size_t GetMipLevel () const
 Returns the mipmap level of a Texture or CubeMapTexture attachment. More...
 
size_t GetSamples () const
 Returns the number of samples for multisampling. More...
 
bool operator!= (const Attachment &other) const
 Needed for Field::Set(). More...
 

Detailed Description

An attachment represents a data store attached to one of the framebuffer's targets.

The AttachmentBinding of the attachment indicates its type, unbound, renderbuffer, or texture. See the class comment for a description of these different states.

Definition at line 77 of file framebufferobject.h.

Constructor & Destructor Documentation

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( )

Creates an unbound Attachment.

Definition at line 73 of file framebufferobject.cc.

References ion::gfx::FramebufferObject::kUnbound.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( Image::Format  format,
size_t  samples 
)

Creates a render buffer attachment for multisampling.

Definition at line 77 of file framebufferobject.cc.

References ion::gfx::FramebufferObject::kRenderbuffer.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( Image::Format  format_in)
explicit

Creates a renderbuffer Attachment of the specified format.

The format must be a supported format, or the Attachment will be set to an unbound binding.

Definition at line 84 of file framebufferobject.cc.

References ion::gfx::FramebufferObject::kRenderbuffer.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( const ImagePtr image_in)
explicit

Creates a renderbuffer Attachment from the passed image, which must be of type Image::kEgl or Image::kExternalEgl with format Image::kEglImage, otherwise the Attachment will be set to an unbound binding.

Definition at line 89 of file framebufferobject.cc.

References ion::base::SharedPtr< T >::Get(), ion::gfx::Image::kEgl, ion::gfx::Image::kEglImage, ion::gfx::Image::kExternalEgl, ion::gfx::FramebufferObject::kRenderbuffer, and ion::gfx::FramebufferObject::kUnbound.

ion::gfx::FramebufferObject::Attachment::Attachment ( const TexturePtr texture_in)
explicit

Creates a texture Attachment using the passed TexturePtr.

Note that the Texture will be resized to match the FramebufferObject's dimensions, but must contain an Image to specify the format to use. The format must be a supported type for the current platform, or the Attachment will be set to an unbound binding.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( const TexturePtr texture_in,
size_t  mip_level 
)

As above, but with specified mipmap level of the texture.

Definition at line 104 of file framebufferobject.cc.

References ion::base::SharedPtr< T >::Get(), ion::gfx::FramebufferObject::kTexture, and ion::gfx::FramebufferObject::kUnbound.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( const CubeMapTexturePtr texture_in,
CubeMapTexture::CubeFace  face 
)

Similar to the constructor for a Texture, but uses the passed face of the cubemap as the backing store of the attachment.

Definition at line 110 of file framebufferobject.cc.

References ion::base::SharedPtr< T >::Get(), ion::gfx::FramebufferObject::kCubeMapTexture, and ion::gfx::FramebufferObject::kUnbound.

ION_API ion::gfx::FramebufferObject::Attachment::Attachment ( const CubeMapTexturePtr texture_in,
CubeMapTexture::CubeFace  face,
size_t  mip_level 
)

As above, but with specified mipmap level of the cubemap texture.

Definition at line 116 of file framebufferobject.cc.

References ion::base::SharedPtr< T >::Get(), ion::gfx::FramebufferObject::kCubeMapTexture, and ion::gfx::FramebufferObject::kUnbound.

Member Function Documentation

AttachmentBinding ion::gfx::FramebufferObject::Attachment::GetBinding ( ) const
inline

Gets the binding of the attachment.

Definition at line 112 of file framebufferobject.h.

CubeMapTexture::CubeFace ion::gfx::FramebufferObject::Attachment::GetCubeMapFace ( ) const
inline

Gets the cubemap face of the attachment.

Definition at line 120 of file framebufferobject.h.

const CubeMapTexturePtr& ion::gfx::FramebufferObject::Attachment::GetCubeMapTexture ( ) const
inline

Gets the cubemap of the attachment, if any.

Definition at line 118 of file framebufferobject.h.

ION_API Image::Format ion::gfx::FramebufferObject::Attachment::GetFormat ( ) const

Gets the format of the attachment, which is the texture format if it is a texture attachment.

Definition at line 134 of file framebufferobject.cc.

References ion::gfx::Image::kRgba8888.

const ImagePtr& ion::gfx::FramebufferObject::Attachment::GetImage ( ) const
inline

Gets the image of the attachment, if any.

Definition at line 114 of file framebufferobject.h.

size_t ion::gfx::FramebufferObject::Attachment::GetMipLevel ( ) const
inline

Returns the mipmap level of a Texture or CubeMapTexture attachment.

Definition at line 122 of file framebufferobject.h.

size_t ion::gfx::FramebufferObject::Attachment::GetSamples ( ) const
inline

Returns the number of samples for multisampling.

Definition at line 124 of file framebufferobject.h.

const TexturePtr& ion::gfx::FramebufferObject::Attachment::GetTexture ( ) const
inline

Gets the texture of the attachment, if any.

Definition at line 116 of file framebufferobject.h.

bool ion::gfx::FramebufferObject::Attachment::operator!= ( const Attachment other) const
inline

Needed for Field::Set().

Definition at line 127 of file framebufferobject.h.

References ion::base::SharedPtr< T >::Get().


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