~ubuntu-branches/ubuntu/oneiric/libclaw/oneiric

« back to all changes in this revision

Viewing changes to claw/pixel.hpp

  • Committer: Bazaar Package Importer
  • Author(s): Julien Jorge
  • Date: 2010-12-23 20:55:14 UTC
  • mfrom: (4.2.1 sid)
  • Revision ID: james.westby@ubuntu.com-20101223205514-s10m6ywla7s4ttqf
Tags: 1.6.1-3
UploadĀ inĀ sid

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
  CLAW is a free library without any particular aim but being useful to 
5
5
  anyone.
6
6
 
7
 
  Copyright (C) 2005-2008 Julien Jorge
 
7
  Copyright (C) 2005-2010 Julien Jorge
8
8
 
9
9
  This library is free software; you can redistribute it and/or
10
10
  modify it under the terms of the GNU Lesser General Public
34
34
{
35
35
  namespace graphic
36
36
  {
37
 
    union rgba_pixel;
 
37
    struct rgba_pixel;
38
38
 
39
39
    /**
40
40
     * \brief RGB pixel.
72
72
    /**
73
73
     * \brief RGBA pixel.
74
74
     */
75
 
    union rgba_pixel
 
75
    struct rgba_pixel
76
76
    {
77
77
      typedef unsigned char component_type;
78
78
 
79
 
      /** \brief Compressed representation. */
80
 
      unsigned int pixel;
81
 
 
82
 
      /** \brief Component by component representation. */
83
 
      struct
 
79
      union
84
80
      {
85
 
        /** \brief Red component. */
86
 
        component_type red;
87
 
 
88
 
        /** \brief Green component. */
89
 
        component_type green;
90
 
 
91
 
        /** \brief Blue component. */
92
 
        component_type blue;
93
 
 
94
 
        /** \brief Translucy. */
95
 
        component_type alpha;
96
 
 
97
 
      } components; 
 
81
        /** \brief Compressed representation. */
 
82
        unsigned int pixel;
 
83
 
 
84
        /** \brief Component by component representation. */
 
85
        struct
 
86
        {
 
87
          /** \brief Red component. */
 
88
          component_type red;
 
89
 
 
90
          /** \brief Green component. */
 
91
          component_type green;
 
92
 
 
93
          /** \brief Blue component. */
 
94
          component_type blue;
 
95
 
 
96
          /** \brief Translucy. */
 
97
          component_type alpha;
 
98
 
 
99
        } components;
 
100
      };
98
101
 
99
102
    public:
100
103
      rgba_pixel();
 
104
      rgba_pixel( const rgb_pixel& that );
101
105
      rgba_pixel( component_type r, component_type g, component_type b,
102
106
                  component_type a );
103
107
 
112
116
    typedef rgb_pixel rgb_pixel_8;
113
117
    typedef rgba_pixel rgba_pixel_8;
114
118
 
 
119
    extern rgba_pixel transparent_pixel;
 
120
 
115
121
    extern rgba_pixel black_pixel;
116
122
    extern rgba_pixel white_pixel;
117
123