From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 497AE4841B for ; Mon, 4 Dec 2023 01:07:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 5393A68CCB4; Mon, 4 Dec 2023 03:07:50 +0200 (EET) Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 7308B68C454 for ; Mon, 4 Dec 2023 03:07:43 +0200 (EET) Received: by mail-lj1-f174.google.com with SMTP id 38308e7fff4ca-2c9c18e7990so52467541fa.2 for ; Sun, 03 Dec 2023 17:07:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701652062; x=1702256862; darn=ffmpeg.org; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date:from:to:cc :subject:date:message-id:reply-to; bh=IWttoReAEFlCepA13qyMpyTb3acq4VLI8AAV/3rTUHM=; b=V27+rO0bfZo+y49fuCgcb5B9eE4ixLLQnyz04lRUNffY+j2qWtAzA9lqlBHV9JCd1P YZztA5vr0HFT3bfiqrro9gJ26ZK+VSqCTXFpbu3degucMKkkvdUp+yE9hioTo8Y+CsNC lk3cj7fg89d7v5OpiUE6upljjmmMwIgSqaboeoUwnu6kmXsCGF+8f3XtA9tLRT6xjS4K cPg1Wt4TPV6XMQoqUv2CwWPXf43UurUEtRFGHHlgjjFHTZbRiI8qxrrhzAmV1X1jv1s4 qE72KBB75SlMDaoUddNB3XeMyuF7s9svafK/e3SP7TUKaKc92XvCrs/Sfs630ExINoVM 0SKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701652062; x=1702256862; h=user-agent:in-reply-to:content-disposition:mime-version:references :mail-followup-to:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=IWttoReAEFlCepA13qyMpyTb3acq4VLI8AAV/3rTUHM=; b=FIFhF53S+O8OhiZH7OLDXGwaQn9Tz5zygZ6ToVFNJE/0TocoC5hb4c+tEI6nhXFFjX trQN6KDtGd2hKuwiGFuCFZ3dPJPnWp7PIWlk2EFzuevQ1ISyJt/ntzCLTlFkl+bv9vvJ Q11bcKd9g1hqcLFjBj8u5pA61fHJoiuMRMN256QWvjrwVJQKkH+2BKB+AFcjVUcfQBDi Ti+rTvM81AICP6cOj9YYGd/hAgh1CErvvMIuYyYp4d0cZ9W27TXaKyu7GLw9wcQ/0Sbh QIwGiIhTqhKfvJmgnAMBMeZuizmVAQqy2rzjGe3/95ZL/Ud02av/xnVLl7c+yiYFRQns KkOw== X-Gm-Message-State: AOJu0Ywcglhvftga1grnAmncOTNlGiszCd8RSeSAi2Ad0g2YJ9W56tdv GV6J0n5cw237ltnlrQk81+d7urAhK5Y= X-Google-Smtp-Source: AGHT+IFUPFYJFfOnGsEEqpyxHyjGhuNBkTSdSRmKSJ763VyKJnRdJo1KCl5ACVb/a3YG/F2+ML5jdw== X-Received: by 2002:a2e:8341:0:b0:2ca:3cd:d0e8 with SMTP id l1-20020a2e8341000000b002ca03cdd0e8mr234569ljh.20.1701652062020; Sun, 03 Dec 2023 17:07:42 -0800 (PST) Received: from mariano (dynamic-adsl-84-220-189-10.clienti.tiscali.it. [84.220.189.10]) by smtp.gmail.com with ESMTPSA id g26-20020a170906199a00b009fdd2c6d042sm4722614ejd.148.2023.12.03.17.07.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 03 Dec 2023 17:07:41 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id 73FFBBFCDA; Mon, 4 Dec 2023 02:07:40 +0100 (CET) Date: Mon, 4 Dec 2023 02:07:40 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Marton Balint References: <20231203002726.29683-1-cus@passwd.hu> <20231203002726.29683-6-cus@passwd.hu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231203002726.29683-6-cus@passwd.hu> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH 6/7] avutil/imgutils: add new function av_image_fill_color() X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Marton Balint Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: On date Sunday 2023-12-03 01:27:25 +0100, Marton Balint wrote: > Signed-off-by: Marton Balint > --- > doc/APIchanges | 3 +++ > libavutil/imgutils.c | 4 ++-- > libavutil/imgutils.h | 30 ++++++++++++++++++++++++++++++ > libavutil/version.h | 2 +- > 4 files changed, 36 insertions(+), 3 deletions(-) > > diff --git a/doc/APIchanges b/doc/APIchanges > index 4a2dc1c44f..b6ac8e08e2 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 - imguils.h imguils typo > + 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 959e6850ac..c09848a317 100644 > --- a/libavutil/imgutils.c > +++ b/libavutil/imgutils.c > @@ -579,7 +579,7 @@ 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) > { > @@ -712,5 +712,5 @@ int av_image_fill_black(uint8_t * const dst_data[4], const ptrdiff_t dst_linesiz > color[c] = src; > } > > - return image_fill_color(dst_data, dst_linesize, pix_fmt, color, width, height); > + return av_image_fill_color(dst_data, dst_linesize, pix_fmt, color, width, height); > } > diff --git a/libavutil/imgutils.h b/libavutil/imgutils.h > index fa3bb101b1..e047b3a693 100644 > --- a/libavutil/imgutils.h > +++ b/libavutil/imgutils.h > @@ -339,6 +339,36 @@ 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 > + * @return 0 if the image data was cleared, a negative AVERROR code otherwise was filled > + */ > +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); LGTM otherwise. _______________________________________________ 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".