mirror of
https://repo.dec05eba.com/gpu-screen-recorder
synced 2026-03-31 09:07:13 +09:00
screenshot: improve jpeg very high quality to 91 (enables yuv444 instead of yuv420)
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
/* TODO: Support hdr/10-bit */
|
||||
bool gsr_image_writer_init_opengl(gsr_image_writer *self, gsr_egl *egl, int width, int height) {
|
||||
memset(self, 0, sizeof(*self));
|
||||
self->source = GSR_IMAGE_WRITER_SOURCE_OPENGL;
|
||||
self->egl = egl;
|
||||
self->width = width;
|
||||
self->height = height;
|
||||
@@ -25,15 +24,6 @@ bool gsr_image_writer_init_opengl(gsr_image_writer *self, gsr_egl *egl, int widt
|
||||
return true;
|
||||
}
|
||||
|
||||
bool gsr_image_writer_init_memory(gsr_image_writer *self, const void *memory, int width, int height) {
|
||||
memset(self, 0, sizeof(*self));
|
||||
self->source = GSR_IMAGE_WRITER_SOURCE_OPENGL;
|
||||
self->width = width;
|
||||
self->height = height;
|
||||
self->memory = memory;
|
||||
return true;
|
||||
}
|
||||
|
||||
void gsr_image_writer_deinit(gsr_image_writer *self) {
|
||||
if(self->texture) {
|
||||
self->egl->glDeleteTextures(1, &self->texture);
|
||||
@@ -64,7 +54,6 @@ static bool gsr_image_writer_write_memory_to_file(gsr_image_writer *self, const
|
||||
}
|
||||
|
||||
static bool gsr_image_writer_write_opengl_texture_to_file(gsr_image_writer *self, const char *filepath, gsr_image_format image_format, int quality) {
|
||||
assert(self->source == GSR_IMAGE_WRITER_SOURCE_OPENGL);
|
||||
uint8_t *frame_data = malloc(self->width * self->height * 4);
|
||||
if(!frame_data) {
|
||||
fprintf(stderr, "gsr error: gsr_image_writer_write_to_file: failed to allocate memory for image frame\n");
|
||||
@@ -90,11 +79,5 @@ static bool gsr_image_writer_write_opengl_texture_to_file(gsr_image_writer *self
|
||||
}
|
||||
|
||||
bool gsr_image_writer_write_to_file(gsr_image_writer *self, const char *filepath, gsr_image_format image_format, int quality) {
|
||||
switch(self->source) {
|
||||
case GSR_IMAGE_WRITER_SOURCE_OPENGL:
|
||||
return gsr_image_writer_write_opengl_texture_to_file(self, filepath, image_format, quality);
|
||||
case GSR_IMAGE_WRITER_SOURCE_MEMORY:
|
||||
return gsr_image_writer_write_memory_to_file(self, filepath, image_format, quality, self->memory);
|
||||
}
|
||||
return false;
|
||||
return gsr_image_writer_write_opengl_texture_to_file(self, filepath, image_format, quality);
|
||||
}
|
||||
|
||||
@@ -2310,7 +2310,7 @@ static int video_quality_to_image_quality_value(gsr_video_quality video_quality)
|
||||
case GSR_VIDEO_QUALITY_HIGH:
|
||||
return 85;
|
||||
case GSR_VIDEO_QUALITY_VERY_HIGH:
|
||||
return 90;
|
||||
return 91;
|
||||
case GSR_VIDEO_QUALITY_ULTRA:
|
||||
return 97;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user