Cleanup: better document parameter.
authorCarl Hetherington <cth@carlh.net>
Thu, 8 Aug 2024 22:42:46 +0000 (00:42 +0200)
committerCarl Hetherington <cth@carlh.net>
Thu, 8 Aug 2024 22:42:46 +0000 (00:42 +0200)
src/lib/image.cc
src/lib/image.h

index 2167918f8d1055c1c7fff274021797fb767b84bc..7181c4546e42b86450c94b6e8e97e9e3acb77b60 100644 (file)
@@ -1171,14 +1171,14 @@ Image::write_to_socket (shared_ptr<Socket> socket) const
 
 
 float
-Image::bytes_per_pixel (int c) const
+Image::bytes_per_pixel(int component) const
 {
        auto d = av_pix_fmt_desc_get(_pixel_format);
        if (!d) {
                throw PixelFormatError ("bytes_per_pixel()", _pixel_format);
        }
 
-       if (c >= planes()) {
+       if (component >= planes()) {
                return 0;
        }
 
@@ -1213,7 +1213,7 @@ Image::bytes_per_pixel (int c) const
                return bpp[0] + bpp[1] + bpp[2] + bpp[3];
        }
 
-       return bpp[c];
+       return bpp[component];
 }
 
 
index 0237b3d1b8fc259c793a695694e9c8a3a75ebdee..dd9f8b840f86b578bcdbfd4c42473e0c16d70fb5 100644 (file)
@@ -68,7 +68,7 @@ public:
        int vertical_factor (int) const;
        int horizontal_factor (int) const;
        dcp::Size sample_size (int) const;
-       float bytes_per_pixel (int) const;
+       float bytes_per_pixel(int component) const;
 
        std::shared_ptr<Image> convert_pixel_format (dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, Alignment alignment, bool fast) const;
        std::shared_ptr<Image> scale (dcp::Size out_size, dcp::YUVToRGB yuv_to_rgb, AVPixelFormat out_format, Alignment alignment, bool fast) const;