osgEarth 2.1.1
Public Types | Public Member Functions | Public Attributes

agg::rgba8 Struct Reference

#include <AGG.h>

List of all members.

Public Types

enum  order { rgb, bgr }

Public Member Functions

 rgba8 ()
 rgba8 (unsigned r_, unsigned g_, unsigned b_, unsigned a_=255)
 rgba8 (unsigned packed, order o)
void opacity (double a_)
double opacity () const
rgba8 gradient (rgba8 c, double k) const
rgba8 pre () const

Public Attributes

int8u r
int8u g
int8u b
int8u a

Detailed Description

Definition at line 37 of file AGG.h.


Member Enumeration Documentation

Enumerator:
rgb 
bgr 

Definition at line 39 of file AGG.h.

{ rgb, bgr };

Constructor & Destructor Documentation

agg::rgba8::rgba8 ( ) [inline]

Definition at line 47 of file AGG.h.

{}

Here is the caller graph for this function:

agg::rgba8::rgba8 ( unsigned  r_,
unsigned  g_,
unsigned  b_,
unsigned  a_ = 255 
) [inline]

Definition at line 50 of file AGG.h.

                                                                      :
            r(int8u(r_)), g(int8u(g_)), b(int8u(b_)), a(int8u(a_)) {}
agg::rgba8::rgba8 ( unsigned  packed,
order  o 
) [inline]

Definition at line 54 of file AGG.h.

                                        : 
            r((o == rgb) ? ((packed >> 16) & 0xFF) : (packed & 0xFF)),
            g((packed >> 8)  & 0xFF),
            b((o == rgb) ? (packed & 0xFF) : ((packed >> 16) & 0xFF)),
            a(255) {}

Member Function Documentation

rgba8 agg::rgba8::gradient ( rgba8  c,
double  k 
) const [inline]

Definition at line 75 of file AGG.h.

        {
            rgba8 ret;
            int ik = int(k * 256);
            ret.r = int8u(int(r) + (((int(c.r) - int(r)) * ik) >> 8));
            ret.g = int8u(int(g) + (((int(c.g) - int(g)) * ik) >> 8));
            ret.b = int8u(int(b) + (((int(c.b) - int(b)) * ik) >> 8));
            ret.a = int8u(int(a) + (((int(c.a) - int(a)) * ik) >> 8));
            return ret;
        }
double agg::rgba8::opacity ( ) const [inline]

Definition at line 69 of file AGG.h.

        {
            return double(a) / 255.0;
        }
void agg::rgba8::opacity ( double  a_) [inline]

Definition at line 61 of file AGG.h.

        {
            if(a_ < 0.0) a_ = 0.0;
            if(a_ > 1.0) a_ = 1.0;
            a = int8u(a_ * 255.0);
        }
rgba8 agg::rgba8::pre ( ) const [inline]

Definition at line 86 of file AGG.h.

        {
            return rgba8((r*a) >> 8, (g*a) >> 8, (b*a) >> 8, a);
        }

Here is the call graph for this function:


Member Data Documentation

Definition at line 44 of file AGG.h.

Definition at line 43 of file AGG.h.

Definition at line 42 of file AGG.h.

Definition at line 41 of file AGG.h.


The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines