Back to index

nux  3.0.0
Public Types | Public Member Functions | Protected Attributes | Private Attributes
nux::ColorLayer Class Reference

#include <PaintLayer.h>

Inheritance diagram for nux::ColorLayer:
Inheritance graph
[legend]
Collaboration diagram for nux::ColorLayer:
Collaboration graph
[legend]

List of all members.

Public Types

enum  PaintLayerType {
  PaintLayer_Color, PaintLayer_Shape, PaintLayer_ShapeROP, PaintLayer_Texture,
  PaintLayer_DeviceTexture, PaintLayer_ImageStyle
}

Public Member Functions

 ColorLayer (const Color &color, bool WriteAlpha=false, const ROPConfig &ROP=ROPConfig::Default)
void SetColor (const Color &color)
Color GetColor () const
virtual void Renderlayer (GraphicsEngine &graphics_engine)
virtual AbstractPaintLayerClone () const
virtual void SetGeometry (const Geometry &geo)
void SetModelViewMatrix (const Matrix4 &mat)
 Preserve the model view matrix at the moment layer is pushed on the paint layer stack. See Painter class.
Matrix4 GetModelViewMatrix ()
Geometry const & GetGeometry () const

Protected Attributes

Geometry geometry_
Matrix4 model_view_matrix_

Private Attributes

Color _color
bool m_write_alpha
ROPConfig m_rop

Detailed Description

Definition at line 34 of file PaintLayer.h.


Member Enumeration Documentation

Enumerator:
PaintLayer_Color 
PaintLayer_Shape 
PaintLayer_ShapeROP 
PaintLayer_Texture 
PaintLayer_DeviceTexture 
PaintLayer_ImageStyle 

Definition at line 33 of file AbstractPaintLayer.h.


Constructor & Destructor Documentation

nux::ColorLayer::ColorLayer ( const Color &  color,
bool  WriteAlpha = false,
const ROPConfig ROP = ROPConfig::Default 
)

Definition at line 32 of file PaintLayer.cpp.

  {
    _color = color;
    m_write_alpha = write_alpha;
    m_rop = ROP;
  }

Here is the caller graph for this function:


Member Function Documentation

Implements nux::AbstractPaintLayer.

Definition at line 64 of file PaintLayer.cpp.

  {
    return new ColorLayer(*this);
  }

Here is the call graph for this function:

Color nux::ColorLayer::GetColor ( ) const

Definition at line 74 of file PaintLayer.cpp.

  {
    return _color;
  }
Geometry const & nux::AbstractPaintLayer::GetGeometry ( ) const [inherited]

Definition at line 22 of file AbstractPaintLayer.cpp.

  {
    return geometry_;
  }

Here is the caller graph for this function:

Definition at line 32 of file AbstractPaintLayer.cpp.

  {
    return model_view_matrix_;
  }

Here is the caller graph for this function:

void nux::ColorLayer::Renderlayer ( GraphicsEngine graphics_engine) [virtual]

Implements nux::AbstractPaintLayer.

Definition at line 39 of file PaintLayer.cpp.

  {
    unsigned int current_red_mask;
    unsigned int current_green_mask;
    unsigned int current_blue_mask;
    unsigned int current_alpha_mask;
    unsigned int current_alpha_blend;
    unsigned int current_src_blend_factor;
    unsigned int current_dest_blend_factor;

    // Get the current color mask and blend states. They will be restored later.
    graphics_engine.GetRenderStates().GetColorMask(current_red_mask, current_green_mask, current_blue_mask, current_alpha_mask);
    // Get the current blend states. They will be restored later.
    graphics_engine.GetRenderStates().GetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
    
    graphics_engine.GetRenderStates().SetColorMask(GL_TRUE, GL_TRUE, GL_TRUE, m_write_alpha ? GL_TRUE : GL_FALSE);
    graphics_engine.GetRenderStates().SetBlend(m_rop.Blend, m_rop.SrcBlend, m_rop.DstBlend);
    graphics_engine.QRP_Color(geometry_.x, geometry_.y, geometry_.GetWidth(), geometry_.GetHeight(), _color);

    // Restore Color mask and blend states.
    graphics_engine.GetRenderStates().SetColorMask(current_red_mask, current_green_mask, current_blue_mask, current_alpha_mask);
    // Restore the blend state
    graphics_engine.GetRenderStates().SetBlend(current_alpha_blend, current_src_blend_factor, current_dest_blend_factor);
  }

Here is the call graph for this function:

void nux::ColorLayer::SetColor ( const Color &  color)

Definition at line 69 of file PaintLayer.cpp.

  {
    _color = color;
  }
void nux::AbstractPaintLayer::SetGeometry ( const Geometry geo) [virtual, inherited]

Definition at line 17 of file AbstractPaintLayer.cpp.

  {
    geometry_ = geo;
  }

Here is the caller graph for this function:

void nux::AbstractPaintLayer::SetModelViewMatrix ( const Matrix4 mat) [inherited]

Preserve the model view matrix at the moment layer is pushed on the paint layer stack. See Painter class.

Definition at line 27 of file AbstractPaintLayer.cpp.

  {
    model_view_matrix_ = mat;
  }

Here is the caller graph for this function:


Member Data Documentation

Color nux::ColorLayer::_color [private]

Definition at line 45 of file PaintLayer.h.

Definition at line 59 of file AbstractPaintLayer.h.

Definition at line 47 of file PaintLayer.h.

Definition at line 46 of file PaintLayer.h.

Definition at line 60 of file AbstractPaintLayer.h.


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