mirror of
https://github.com/switchbrew/libnx.git
synced 2025-06-21 12:32:40 +02:00
add capsdcShrinkJpeg
This commit is contained in:
parent
e322bdf82d
commit
6f9bc920c9
@ -30,3 +30,8 @@ Service* capsdcGetServiceSession(void);
|
||||
* @param[in] out_image_size Output image buffer size, should be at least large enough for RGBA8 width x height.
|
||||
*/
|
||||
Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_image, size_t out_image_size);
|
||||
|
||||
/**
|
||||
* @brief Shrinks a jpeg's dimensions by 2.
|
||||
*/
|
||||
Result capsdcShrinkJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_jpeg, size_t out_jpeg_size, u64 *out_result_size);
|
||||
|
@ -39,3 +39,21 @@ Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
Result capsdcShrinkJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void* jpeg, size_t jpeg_size, void* out_jpeg, size_t out_jpeg_size, u64 *out_result_size) {
|
||||
const struct {
|
||||
u32 width;
|
||||
u32 height;
|
||||
CapsScreenShotDecodeOption opts;
|
||||
} in = { width, height, *opts };
|
||||
return serviceDispatchInOut(&g_capsdcSrv, 4001, in, *out_result_size,
|
||||
.buffer_attrs = {
|
||||
SfBufferAttr_In | SfBufferAttr_HipcMapAlias,
|
||||
SfBufferAttr_Out | SfBufferAttr_HipcMapAlias | SfBufferAttr_HipcMapTransferAllowsNonSecure,
|
||||
},
|
||||
.buffers = {
|
||||
{ jpeg, jpeg_size },
|
||||
{ out_jpeg, out_jpeg_size },
|
||||
}
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user