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

« back to all changes in this revision

Viewing changes to claw/code/pixel.cpp

  • 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
35
35
{
36
36
  namespace graphic
37
37
  {
 
38
    rgba_pixel transparent_pixel( 0, 0, 0, 0 );
 
39
 
38
40
    rgba_pixel black_pixel
39
41
    ( 0, 0, 0, std::numeric_limits<rgba_pixel::component_type>::max() );
40
42
    rgba_pixel white_pixel
54
56
      std::numeric_limits<rgba_pixel::component_type>::max() );
55
57
 
56
58
    rgba_pixel yellow_pixel
57
 
    ( 0, std::numeric_limits<rgba_pixel::component_type>::max(), 
58
 
      std::numeric_limits<rgba_pixel::component_type>::max(),
 
59
    ( std::numeric_limits<rgba_pixel::component_type>::max(),
 
60
      std::numeric_limits<rgba_pixel::component_type>::max(), 0,
59
61
      std::numeric_limits<rgba_pixel::component_type>::max() );
60
62
    rgba_pixel magenta_pixel
61
63
    ( std::numeric_limits<rgba_pixel::component_type>::max(), 0,
62
64
      std::numeric_limits<rgba_pixel::component_type>::max(),
63
65
      std::numeric_limits<rgba_pixel::component_type>::max() );
64
66
    rgba_pixel cyan_pixel
65
 
    ( std::numeric_limits<rgba_pixel::component_type>::max(), 
66
 
      std::numeric_limits<rgba_pixel::component_type>::max(), 0,
 
67
    ( 0, std::numeric_limits<rgba_pixel::component_type>::max(),
 
68
      std::numeric_limits<rgba_pixel::component_type>::max(),
67
69
      std::numeric_limits<rgba_pixel::component_type>::max() );
68
70
 
69
71
  } // namespace graphic
162
164
/*----------------------------------------------------------------------------*/
163
165
/**
164
166
 * \brief Constructor.
 
167
 * \param that The other pixel.
 
168
 * \remark The alpha component of \a this is set to 255.
 
169
 */
 
170
claw::graphic::rgba_pixel::rgba_pixel( const rgb_pixel& that )
 
171
{
 
172
  components.red = that.components.red;
 
173
  components.green = that.components.green;
 
174
  components.blue = that.components.blue;
 
175
  components.alpha = 255;
 
176
} // rgba_pixel::rgba_pixel()
 
177
 
 
178
/*----------------------------------------------------------------------------*/
 
179
/**
 
180
 * \brief Constructor.
165
181
 * \param r The value of the red field.
166
182
 * \param g The value of the green field.
167
183
 * \param b The value of the blue field.
180
196
/**
181
197
 * \brief Assignement operator.
182
198
 * \param that The other pixel.
183
 
 * \remark The alpha component of the \a this is set to 255.
 
199
 * \remark The alpha component of \a this is set to 255.
184
200
 */
185
201
claw::graphic::rgba_pixel&
186
202
claw::graphic::rgba_pixel::operator=( const rgb_pixel& that )