X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Flib%2Fimage.cc;h=847ad104631c32b3c181d1fe9d41c5f8a7f0084b;hb=4dbc6ef917aeceb906b1ef1caf6911033e7e2c54;hp=3c67690685d68954785fcf2a38d32faf5ea4b0fa;hpb=ab32f60c2c9f2ad01dc8d96dc375df256dba0c41;p=dcpomatic.git diff --git a/src/lib/image.cc b/src/lib/image.cc index 3c6769068..847ad1046 100644 --- a/src/lib/image.cc +++ b/src/lib/image.cc @@ -88,14 +88,14 @@ Image::components () const shared_ptr Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const { - assert (scaler); + DCPOMATIC_ASSERT (scaler); /* Empirical testing suggests that sws_scale() will crash if the input image is not aligned. */ - assert (aligned ()); + DCPOMATIC_ASSERT (aligned ()); - assert (out_size.width >= inter_size.width); - assert (out_size.height >= inter_size.height); + DCPOMATIC_ASSERT (out_size.width >= inter_size.width); + DCPOMATIC_ASSERT (out_size.height >= inter_size.height); /* Here's an image of out_size */ shared_ptr out (new Image (out_format, out_size, out_aligned)); @@ -144,11 +144,11 @@ Image::crop_scale_window (Crop crop, dcp::Size inter_size, dcp::Size out_size, S shared_ptr Image::scale (dcp::Size out_size, Scaler const * scaler, AVPixelFormat out_format, bool out_aligned) const { - assert (scaler); + DCPOMATIC_ASSERT (scaler); /* Empirical testing suggests that sws_scale() will crash if the input image is not aligned. */ - assert (aligned ()); + DCPOMATIC_ASSERT (aligned ()); shared_ptr scaled (new Image (out_format, out_size, out_aligned)); @@ -361,7 +361,7 @@ Image::make_transparent () void Image::alpha_blend (shared_ptr other, Position position) { - assert (other->pixel_format() == PIX_FMT_RGBA); + DCPOMATIC_ASSERT (other->pixel_format() == PIX_FMT_RGBA); int const other_bpp = 4; int start_tx = position.x; @@ -439,7 +439,7 @@ Image::alpha_blend (shared_ptr other, Position position) break; } default: - assert (false); + DCPOMATIC_ASSERT (false); } } @@ -447,8 +447,8 @@ void Image::copy (shared_ptr other, Position position) { /* Only implemented for RGB24 onto RGB24 so far */ - assert (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24); - assert (position.x >= 0 && position.y >= 0); + DCPOMATIC_ASSERT (_pixel_format == PIX_FMT_RGB24 && other->pixel_format() == PIX_FMT_RGB24); + DCPOMATIC_ASSERT (position.x >= 0 && position.y >= 0); int const N = min (position.x + other->size().width, size().width) - position.x; for (int ty = position.y, oy = 0; ty < size().height && oy < other->size().height; ++ty, ++oy) { @@ -609,7 +609,7 @@ Image::Image (shared_ptr other, bool aligned) allocate (); for (int i = 0; i < components(); ++i) { - assert(line_size()[i] == other->line_size()[i]); + DCPOMATIC_ASSERT (line_size()[i] == other->line_size()[i]); uint8_t* p = _data[i]; uint8_t* q = other->data()[i]; for (int j = 0; j < lines(i); ++j) {