@@ -33,5 +33,31 @@ Result capsdcDecodeJpeg(u32 width, u32 height, const CapsScreenShotDecodeOption
33
33
34
34
/**
35
35
* @brief Shrinks a jpeg's dimensions by 2.
36
+ * @note Tries to compress with jpeg quality in this order: 98, 95, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0.
37
+ * @note Only available on [17.0.0+].
38
+ * @param[in] width Input image width.
39
+ * @param[in] height Input image width.
40
+ * @param[in] opts \ref CapsScreenShotDecodeOption.
41
+ * @param[in] jpeg Jpeg image input buffer.
42
+ * @param[in] jpeg_size Input image buffer size.
43
+ * @param[out] out_jpeg Jpeg image output buffer
44
+ * @param[in] out_jpeg_size Output image buffer size.
45
+ * @param[out] out_result_size size of the resulting JPEG.
36
46
*/
37
47
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 );
48
+
49
+ /**
50
+ * @brief Shrinks a jpeg.
51
+ * @note Fails if the scaled size is larger than the original or the output buffer isn't large enough.
52
+ * @note Only available on [19.0.0+].
53
+ * @param[in] scaled_width Wanted image width.
54
+ * @param[in] scaled_height Wanted image width.
55
+ * @param[in] jpeg_quality has to be in range 0-100.
56
+ * @param[in] opts \ref CapsScreenShotDecodeOption.
57
+ * @param[in] jpeg Jpeg image input buffer.
58
+ * @param[in] jpeg_size Input image buffer size.
59
+ * @param[out] out_jpeg Jpeg image output buffer
60
+ * @param[in] out_jpeg_size Output image buffer size.
61
+ * @param[out] out_result_size size of the resulting jpeg.
62
+ */
63
+ Result capsdcShrinkJpegEx (u32 scaled_width , u32 scaled_height , u32 jpeg_quality , const CapsScreenShotDecodeOption * opts , const void * jpeg , size_t jpeg_size , void * out_jpeg , size_t out_jpeg_size , u64 * out_result_size );
0 commit comments