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 3751348613 for ; Mon, 11 Dec 2023 23:06:10 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3609268D20A; Tue, 12 Dec 2023 01:06:08 +0200 (EET) Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 988C968D177 for ; Tue, 12 Dec 2023 01:06:02 +0200 (EET) Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-40c29f7b068so47848745e9.0 for ; Mon, 11 Dec 2023 15:06:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702335961; x=1702940761; 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=Z3faFIwkqmwqFJFFWRuzn7PPc4rSUljLLjhTU5Fz2oU=; b=XB3u9qEdl3bCQb7n9slkZ3AxP/Iw9tb+XQLI6F7Kr86O2GiB5zULBtxwIYWGgV9jqt 1vKft/GPuoHaqDYzckMNIJ5VpNeKC4jLSXOMd2n+WaReKtX9xUWM9eAMj8I5xZafdqOd JJgzVbHJp13poTZhStIb4H0Y2ExEZYLnYh5MCZenq0WLe7scZBZsl2ree7WYr8sZwTVT 4BVQ0Hjvads1l2C7ABstBbCGjLsF/DBuvrDao/qZJFLZvDfd+ltso+8mBZpHY0dWIE/S MVy54mX7+7yUbWda4wLwmYzRmy+V07dog6whmpeTITFgGrqqGNeURpwJ32p1W15Of+WK RNag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702335961; x=1702940761; 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=Z3faFIwkqmwqFJFFWRuzn7PPc4rSUljLLjhTU5Fz2oU=; b=YHUo3OVXno56ZMzeoeU4dlWmM/1ViVZ1cvneGvnd11d3rdaG1BONcZlBvRFIueMMZR 3mDnm1ppA+niZrRQi2OS+kEB2+A2LogqxQ+FG8hXFAJuoov073VlppAfkaGyDCajwZkj e5/lA7FWGS8iuruRZQOCReIdbMFWvDKG9lXcpygMAO4tx9Tgx4hPCvSzxUx0W/Q3AI0A eZVumTAd9tbsUew+Kw1kGOKGKrQt06OuqUY3KsXAsVeZL6agEoEGa+fQwAZ2vnD61wbc ggeexsiuvwTze7CYfBLhTC3vHfHPqirKQGKMIixFSHJrOUp/OYcE1M4pJ9zi8liRq82F kp1g== X-Gm-Message-State: AOJu0YzjmYxqEio51AewWwzwhFT5bAmSZ11Tbd6QnyrkLYVqspRukggY fLBNQVTO7UDxT1MzcRq5uUATm5wKoEw= X-Google-Smtp-Source: AGHT+IE6uL9ghQPoTVFO052gaa7X0EFQuU2EbWb1ubQhcgWDGZOSTE737UQNDhgOwSpikiZecOGDoQ== X-Received: by 2002:a05:600c:1f93:b0:40c:4ef8:a9eb with SMTP id je19-20020a05600c1f9300b0040c4ef8a9ebmr190382wmb.176.1702335960623; Mon, 11 Dec 2023 15:06:00 -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 g9-20020a05600c310900b0040c3953cda5sm11262181wmo.45.2023.12.11.15.05.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 15:05:59 -0800 (PST) Received: by mariano (Postfix, from userid 1000) id E5D63BFCDA; Tue, 12 Dec 2023 00:05:57 +0100 (CET) Date: Tue, 12 Dec 2023 00:05:57 +0100 From: Stefano Sabatini To: FFmpeg development discussions and patches Message-ID: Mail-Followup-To: FFmpeg development discussions and patches , Marton Balint References: <170196572526.8914.10192984260024793492@lain.khirnov.net> <20231209192507.11262-1-cus@passwd.hu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231209192507.11262-1-cus@passwd.hu> User-Agent: Mutt/2.1.4 (2021-12-11) Subject: Re: [FFmpeg-devel] [PATCH v3 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 Saturday 2023-12-09 20:25:07 +0100, Marton Balint wrote: > v3: added flags argument. > > Signed-off-by: Marton Balint > --- > 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".