buffer: add buffer_resize()

This commit is contained in:
tokyo4j 2025-05-30 20:55:31 +09:00 committed by Hiroaki Yamamoto
parent 0657a1d767
commit 82b0235aca
3 changed files with 44 additions and 40 deletions

View file

@ -70,4 +70,11 @@ struct lab_data_buffer *buffer_create_cairo(uint32_t logical_width,
struct lab_data_buffer *buffer_create_from_data(void *pixel_data, uint32_t width,
uint32_t height, uint32_t stride);
/*
* Resize a buffer to the given size. The source buffer is rendered at the
* center of the output buffer and shrunk if it overflows from the output buffer.
*/
struct lab_data_buffer *buffer_resize(struct lab_data_buffer *src_buffer,
int width, int height, double scale);
#endif /* LABWC_BUFFER_H */