From: Stefano Sabatini <stefasab@gmail.com> To: FFmpeg development discussions and patches <ffmpeg-devel@ffmpeg.org> Cc: Marton Balint <cus@passwd.hu> Subject: Re: [FFmpeg-devel] [PATCH v3 6/7] avutil/imgutils: add new function av_image_fill_color() Date: Tue, 12 Dec 2023 00:05:57 +0100 Message-ID: <ZXeV1VoHw6X3xMz7@mariano> (raw) In-Reply-To: <20231209192507.11262-1-cus@passwd.hu> On date Saturday 2023-12-09 20:25:07 +0100, Marton Balint wrote: > v3: added flags argument. > > Signed-off-by: Marton Balint <cus@passwd.hu> > --- > doc/APIchanges | 3 +++ > libavutil/imgutils.c | 6 +++--- > libavutil/imgutils.h | 31 +++++++++++++++++++++++++++++++ > libavutil/version.h | 2 +- > 4 files changed, 38 insertions(+), 4 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 4a2dc1c44f..2b0326165e 100644 > --- a/doc/APIchanges > +++ b/doc/APIchanges > @@ -2,6 +2,9 @@ The last version increases of all libraries were on 2023-02-09 > > API changes, most recent first: > > +2023-12-xx - xxxxxxxxxxx - lavu 58.33.100 - imgutils.h > + Add av_image_fill_color(). > + > 2023-11-08 - b82957a66a7 - lavu 58.32.100 - channel_layout.h > Add AV_CH_LAYOUT_7POINT2POINT3 and AV_CHANNEL_LAYOUT_7POINT2POINT3. > Add AV_CH_LAYOUT_9POINT1POINT4_BACK and AV_CHANNEL_LAYOUT_9POINT1POINT4_BACK. > diff --git a/libavutil/imgutils.c b/libavutil/imgutils.c > index 278e30ee0f..aae40ba59a 100644 > --- a/libavutil/imgutils.c > +++ b/libavutil/imgutils.c > @@ -579,9 +579,9 @@ static void memset_bytes(uint8_t *dst, size_t dst_size, uint8_t *clear, > // if it's a subsampled packed format). > #define MAX_BLOCK_SIZE 32 > > -static int image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], > +int av_image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], > enum AVPixelFormat pix_fmt, const uint32_t color[4], > - int width, int height) > + int width, int height, int flags) > { > const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(pix_fmt); > int nb_planes = av_pix_fmt_count_planes(pix_fmt); > @@ -713,5 +713,5 @@ int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesiz > colors[c] = color; > } > > - return image_fill_color(dst_data, dst_linesize, pix_fmt, colors, width, height); > + return av_image_fill_color(dst_data, dst_linesize, pix_fmt, colors, width, height, 0); > } > diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h > index fa3bb101b1..a29ed46a39 100644 > --- a/libavutil/imgutils.h > +++ b/libavutil/imgutils.h > @@ -339,6 +339,37 @@ int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesiz > enum AVPixelFormat pix_fmt, enum AVColorRange range, > int width, int height); > > +/** > + * Overwrite the image data with a color. This is suitable for filling a > + * sub-rectangle of an image, meaning the padding between the right most pixel > + * and the left most pixel on the next line will not be overwritten. For some > + * formats, the image size might be rounded up due to inherent alignment. > + * > + * If the pixel format has alpha, it is also replaced. Color component values > + * are interpreted as native integers (or intfloats) regardless of actual pixel > + * format endianness. > + * > + * This can return an error if the pixel format is not supported. Normally, all > + * non-hwaccel pixel formats should be supported. > + * > + * Passing NULL for dst_data is allowed. Then the function returns whether the > + * operation would have succeeded. (It can return an error if the pix_fmt is > + * not supported.) > + * > + * @param dst_data data pointers to destination image > + * @param dst_linesize linesizes for the destination image > + * @param pix_fmt the pixel format of the image > + * @param color the color components to be used for the fill > + * @param width the width of the image in pixels > + * @param height the height of the image in pixels > + * @param flags currently unused > + * @return 0 if the image data was filled, a negative AVERROR code otherwise > + */ > +int av_image_fill_color(uint8_t * const dst_data[4], const ptrdiff_t dst_linesize[4], > + enum AVPixelFormat pix_fmt, const uint32_t color[4], > + int width, int height, int flags); > + > + ni+++: drop the duplicated empty line Still LGTM. _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".
next prev parent reply other threads:[~2023-12-11 23:06 UTC|newest] Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-12-03 0:27 [FFmpeg-devel] [PATCH 1/7] avutil/tests/imgutils: factorize basic tests to new function Marton Balint 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 2/7] avutil/tests/imgutils: add tests for av_image_fill_black() Marton Balint 2023-12-03 23:47 ` Stefano Sabatini 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 3/7] avutil/imgutils: fix av_image_fill_black() for some pixel formats Marton Balint 2023-12-04 0:23 ` Stefano Sabatini 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 4/7] avutil/imgutils: add support for 32bit pixel format for av_image_fill_black() Marton Balint 2023-12-04 0:52 ` Stefano Sabatini 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 5/7] avutil/imgutils: factorize a fill color function Marton Balint 2023-12-04 1:04 ` Stefano Sabatini 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 6/7] avutil/imgutils: add new function av_image_fill_color() Marton Balint 2023-12-04 1:07 ` Stefano Sabatini 2023-12-03 0:27 ` [FFmpeg-devel] [PATCH 7/7] avcodec: add AV_CODEC_FLAG_CLEAR Marton Balint 2023-12-03 21:31 ` [FFmpeg-devel] [PATCH 1/7] avutil/tests/imgutils: factorize basic tests to new function Stefano Sabatini 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 " Marton Balint 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 2/7] avutil/tests/imgutils: add tests for av_image_fill_black() Marton Balint 2023-12-06 22:46 ` Stefano Sabatini 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 3/7] avutil/imgutils: fix av_image_fill_black() for some pixel formats Marton Balint 2023-12-06 22:47 ` Stefano Sabatini 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 4/7] avutil/imgutils: add support for 32bit pixel format for av_image_fill_black() Marton Balint 2023-12-06 22:48 ` Stefano Sabatini 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 5/7] avutil/imgutils: factorize a fill color function Marton Balint 2023-12-06 22:52 ` Stefano Sabatini 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 6/7] avutil/imgutils: add new function av_image_fill_color() Marton Balint 2023-12-06 22:53 ` Stefano Sabatini 2023-12-07 16:15 ` Anton Khirnov 2023-12-09 19:25 ` [FFmpeg-devel] [PATCH v3 " Marton Balint 2023-12-11 23:05 ` Stefano Sabatini [this message] 2023-12-12 18:45 ` Marton Balint 2023-12-06 8:22 ` [FFmpeg-devel] [PATCH v2 7/7] avcodec: add AV_CODEC_FLAG_CLEAR Marton Balint 2023-12-06 22:57 ` Stefano Sabatini 2023-12-07 1:44 ` Ronald S. Bultje 2023-12-07 16:19 ` Anton Khirnov 2023-12-07 22:47 ` Marton Balint 2023-12-08 5:12 ` Rémi Denis-Courmont 2023-12-07 2:37 ` Vittorio Giovara 2023-12-07 16:30 ` Anton Khirnov 2023-12-07 23:11 ` Marton Balint 2023-12-11 20:49 ` Mark Thompson 2023-12-12 11:23 ` Anton Khirnov 2023-12-12 18:37 ` Marton Balint 2023-12-13 8:59 ` Anton Khirnov 2023-12-13 17:09 ` Marton Balint 2023-12-14 8:03 ` Anton Khirnov 2023-12-12 22:18 ` Michael Niedermayer 2023-12-06 22:43 ` [FFmpeg-devel] [PATCH v2 1/7] avutil/tests/imgutils: factorize basic tests to new function Stefano Sabatini
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=ZXeV1VoHw6X3xMz7@mariano \ --to=stefasab@gmail.com \ --cc=cus@passwd.hu \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git