Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
ffmpeg
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Stefan Westerfeld
ffmpeg
Commits
5475f665
Commit
5475f665
authored
Dec 02, 2023
by
Marton Balint
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
avutil/imgutils: add new function av_image_fill_color()
Signed-off-by:
Marton Balint
<
cus@passwd.hu
>
parent
0ae8afff
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
37 additions
and
4 deletions
+37
-4
APIchanges
doc/APIchanges
+3
-0
imgutils.c
libavutil/imgutils.c
+3
-3
imgutils.h
libavutil/imgutils.h
+30
-0
version.h
libavutil/version.h
+1
-1
No files found.
doc/APIchanges
View file @
5475f665
...
...
@@ -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.
...
...
libavutil/imgutils.c
View file @
5475f665
...
...
@@ -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
);
}
libavutil/imgutils.h
View file @
5475f665
...
...
@@ -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
* @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
);
/**
* @}
*/
...
...
libavutil/version.h
View file @
5475f665
...
...
@@ -79,7 +79,7 @@
*/
#define LIBAVUTIL_VERSION_MAJOR 58
#define LIBAVUTIL_VERSION_MINOR 3
2
#define LIBAVUTIL_VERSION_MINOR 3
3
#define LIBAVUTIL_VERSION_MICRO 100
#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment