38 #ifdef CLAW_PNG_SUPPORT
42 #endif // CLAW_PNG_SUPPORT
44 #ifdef CLAW_JPEG_SUPPORT
46 #endif // CLAW_JPEG_SUPPORT
56 return super::begin();
75 return super::begin();
140 std::swap(m_data, that.m_data);
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
243 ( dest->components.alpha * (max_comp - src_alpha) );
246 (double)first->components.red * src_alpha
247 + (
double)dest->components.red * dest_alpha;
249 (double)first->components.green * src_alpha
250 + (
double)dest->components.green * dest_alpha;
252 (double)first->components.blue * src_alpha
253 + (
double)dest->components.blue * dest_alpha;
254 const double alpha = src_alpha + dest_alpha;
256 dest->components.red = std::min(red, max_comp);
257 dest->components.green = std::min(green, max_comp);
258 dest->components.blue = std::min(blue, max_comp);
259 dest->components.alpha = std::min(alpha, max_comp);
280 unsigned int that_y = pos.
y < 0 ? -pos.
y : 0;
281 unsigned int that_x = pos.
x < 0 ? -pos.
x : 0;
285 for (
int y=0; y!=intersection.
height; ++y)
292 std::copy( first, last, dest );
303 for (
unsigned int y=0; y!=
height()/2; ++y)
304 std::swap( m_data[y], m_data[
height()-y-1] );
321 const double max_comp
322 ( std::numeric_limits<rgba_pixel::component_type>::max() );
324 for (
int y=0; y!=intersection.height; ++y)
327 (*this)[intersection.position.y + y].begin()
328 + intersection.position.x;
331 for( ; first!=last; ++first )
336 (double)first->components.red
337 + src_alpha * (
double)c.
components.red / max_comp;
339 (double)first->components.green
340 + src_alpha * (
double)c.
components.green / max_comp;
342 (double)first->components.blue
343 + src_alpha * (
double)c.
components.blue / max_comp;
344 double alpha = (double)first->components.alpha
345 + (max_comp - src_alpha) / max_comp;
347 first->components.red = std::min(red, max_comp);
348 first->components.green = std::min(green, max_comp);
349 first->components.blue = std::min(blue, max_comp);
350 first->components.alpha = std::min(alpha, max_comp);
371 for (
unsigned int y=0; y!=
height(); ++y)
385 #ifdef CLAW_JPEG_SUPPORT
389 #endif // CLAW_JPEG_SUPPORT
391 #ifdef CLAW_PNG_SUPPORT
395 #endif // CLAW_PNG_SUPPORT