38 #ifdef CLAW_PNG_SUPPORT
42 #endif // CLAW_PNG_SUPPORT
44 #ifdef CLAW_JPEG_SUPPORT
46 #endif // CLAW_JPEG_SUPPORT
149 if ( m_data.empty() )
152 return m_data[0].size();
161 return m_data.size();
225 unsigned int that_y = pos.
y < 0 ? -pos.
y : 0;
226 unsigned int that_x = pos.
x < 0 ? -pos.
x : 0;
227 const double max_comp
228 ( std::numeric_limits<rgba_pixel::component_type>::max() );
232 for (
int y=0; y!=intersection.
height; ++y)
239 for( ; first!=last; ++first, ++dest )
241 const double src_alpha(first->components.alpha);
242 const double dest_alpha(dest->components.alpha);
245 (double)first->components.red
246 + dest_alpha * (
double)dest->components.red / max_comp;
248 (double)first->components.green
249 + dest_alpha * (
double)dest->components.green / max_comp;
251 (double)first->components.blue
252 + dest_alpha * (
double)dest->components.blue / max_comp;
253 double alpha = src_alpha + (max_comp - dest_alpha) / max_comp;
255 dest->components.red = std::min(red, max_comp);
256 dest->components.green = std::min(green, max_comp);
257 dest->components.blue = std::min(blue, max_comp);
258 dest->components.alpha = std::min(alpha, max_comp);
279 unsigned int that_y = pos.
y < 0 ? -pos.
y : 0;
280 unsigned int that_x = pos.
x < 0 ? -pos.
x : 0;
284 for (
int y=0; y!=intersection.
height; ++y)
291 std::copy( first, last, dest );
302 for (
unsigned int y=0; y!=
height()/2; ++y)
303 std::swap( m_data[y], m_data[
height()-y-1] );
320 const double max_comp
321 ( std::numeric_limits<rgba_pixel::component_type>::max() );
323 for (
int y=0; y!=intersection.height; ++y)
326 (*this)[intersection.position.y + y].begin()
327 + intersection.position.x;
330 for( ; first!=last; ++first )
335 (double)first->components.red
336 + src_alpha * (
double)c.
components.red / max_comp;
338 (double)first->components.green
339 + src_alpha * (
double)c.
components.green / max_comp;
341 (double)first->components.blue
342 + src_alpha * (
double)c.
components.blue / max_comp;
343 double alpha = (double)first->components.alpha
344 + (max_comp - src_alpha) / max_comp;
346 first->components.red = std::min(red, max_comp);
347 first->components.green = std::min(green, max_comp);
348 first->components.blue = std::min(blue, max_comp);
349 first->components.alpha = std::min(alpha, max_comp);
370 for (
unsigned int y=0; y!=
height(); ++y)
384 #ifdef CLAW_JPEG_SUPPORT
388 #endif // CLAW_JPEG_SUPPORT
390 #ifdef CLAW_PNG_SUPPORT
394 #endif // CLAW_PNG_SUPPORT