70 template<
int t_ColorFormat >
92 inline Color( uint8_t
const red, uint8_t
const green, uint8_t
const blue, uint8_t
const alpha = 0 );
94 inline Color( Color
const& other );
96 template<
int t_OtherColorFormat >
97 inline Color( Color< t_OtherColorFormat >
const& other );
100 inline Color
const& operator=( Color
const& other );
102 template<
int t_OtherColorFormat >
103 inline Color
const& operator=( Color< t_OtherColorFormat >
const& other );
108 inline uint8_t Red()
const;
109 inline uint8_t Green()
const;
110 inline uint8_t Blue()
const;
111 inline uint8_t Alpha()
const;
116 inline void Set( uint8_t
const red, uint8_t
const green, uint8_t
const blue, uint8_t
const alpha );
141 inline Color( uint8_t
const red, uint8_t
const green, uint8_t
const blue );
143 inline Color( Color
const& other );
145 template<
int t_OtherColorFormat >
146 inline Color( Color< t_OtherColorFormat >
const& other );
149 inline Color
const& operator=( Color
const& other );
151 template<
int t_OtherColorFormat >
152 inline Color
const& operator=( Color< t_OtherColorFormat >
const& other );
157 inline uint8_t Red()
const;
158 inline uint8_t Green()
const;
159 inline uint8_t Blue()
const;
160 inline uint8_t Alpha()
const;
165 inline void Set( uint8_t
const red, uint8_t
const green, uint8_t
const blue );
189 Set( red, green, blue, alpha );
197 template<
int t_OtherColorFormat >
200 Set( other.Red(), other.Green(), other.Blue(), other.Alpha() );
206 m_color = other.m_color;
211 template<
int t_OtherColorFormat >
214 Set( other.Red(), other.Green(), other.Blue(), other.Alpha() );
227 return( m_color & 0xff );
233 return( ( m_color >> 8 ) & 0xff );
239 return( ( m_color >> 16 ) & 0xff );
245 return( m_color >> 24 );
249 void Color< COLOR_FORMAT_RGBA_8888 >::Set(
257 (
static_cast< uint32_t
>( alpha ) << 24 ) |
258 (
static_cast< uint32_t
>( blue ) << 16 ) |
259 (
static_cast< uint32_t
>( green ) << 8 ) |
260 (
static_cast< uint32_t
>( red ) )
282 Set( red, green, blue );
290 template<
int t_OtherColorFormat >
293 Set( other.Red(), other.Green(), other.Blue() );
299 m_color = other.m_color;
304 template<
int t_OtherColorFormat >
307 Set( other.Red(), other.Green(), other.Blue() );
320 uint8_t
const channel = ( ( m_color >> 8 ) & 0xf8 );
321 return( channel | ( channel >> 5 ) );
327 uint8_t
const channel = ( ( m_color >> 3 ) & 0xfc );
328 return( channel | ( channel >> 6 ) );
334 uint8_t
const channel = ( ( m_color << 3 ) & 0xf8 );
335 return( channel | ( channel >> 5 ) );
339 void Color< COLOR_FORMAT_RGB_565 >::Set(
346 (
static_cast< uint16_t
>( red & 0xf8 ) << 8 ) |
347 (
static_cast< uint16_t
>( green & 0xfc ) << 3 ) |
348 (
static_cast< uint16_t
>( blue & 0xf8 ) >> 3 )
360 #if ( SETTING_OPENCL != 0 )
372 template<
int t_ColorFormat >
377 static Type Convert( Color< t_ColorFormat >
const& source ) {
395 template<
int t_ColorFormat >
398 static cl_image_format
const format;
405 #endif // SETTING_OPENCL