libnx v4.9.0
Loading...
Searching...
No Matches
Functions
capsdc.h File Reference

Jpeg Decoder (caps:dc) service IPC wrapper. More...

#include "../types.h"
#include "../sf/service.h"
#include "../services/caps.h"

Go to the source code of this file.

Functions

Result capsdcInitialize (void)
 Initialize caps:dc.
 
void capsdcExit (void)
 Exit caps:dc.
 
ServicecapsdcGetServiceSession (void)
 Gets the Service for caps:dc.
 
Result capsdcDecodeJpeg (u32 width, u32 height, const CapsScreenShotDecodeOption *opts, const void *jpeg, size_t jpeg_size, void *out_image, size_t out_image_size)
 Decodes a jpeg buffer into RGBX.
 
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)
 Shrinks a jpeg's dimensions by 2.
 
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)
 Shrinks a jpeg.
 

Detailed Description

Jpeg Decoder (caps:dc) service IPC wrapper.

Only available on [4.0.0+].

Note
Only holds one session that is occupied by capsrv.
Author
Behemoth

Function Documentation

◆ capsdcDecodeJpeg()

Result capsdcDecodeJpeg ( u32  width,
u32  height,
const CapsScreenShotDecodeOption opts,
const void *  jpeg,
size_t  jpeg_size,
void *  out_image,
size_t  out_image_size 
)

Decodes a jpeg buffer into RGBX.

Parameters
[in]widthImage width.
[in]heightImage height.
[in]optsCapsScreenShotDecodeOption.
[in]jpegJpeg image input buffer.
[in]jpeg_sizeInput image buffer size.
[out]out_imageRGBA8 image output buffer.
[in]out_image_sizeOutput image buffer size, should be at least large enough for RGBA8 width x height.

◆ capsdcShrinkJpeg()

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 
)

Shrinks a jpeg's dimensions by 2.

Note
Tries to compress with jpeg quality in this order: 98, 95, 90, 80, 70, 60, 50, 40, 30, 20, 10, 0.
Only available on [17.0.0+].
Parameters
[in]widthInput image width.
[in]heightInput image width.
[in]optsCapsScreenShotDecodeOption.
[in]jpegJpeg image input buffer.
[in]jpeg_sizeInput image buffer size.
[out]out_jpegJpeg image output buffer
[in]out_jpeg_sizeOutput image buffer size.
[out]out_result_sizesize of the resulting JPEG.

◆ capsdcShrinkJpegEx()

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 
)

Shrinks a jpeg.

Note
Fails if the scaled size is larger than the original or the output buffer isn't large enough.
Only available on [19.0.0+].
Parameters
[in]scaled_widthWanted image width.
[in]scaled_heightWanted image width.
[in]jpeg_qualityhas to be in range 0-100.
[in]optsCapsScreenShotDecodeOption.
[in]jpegJpeg image input buffer.
[in]jpeg_sizeInput image buffer size.
[out]out_jpegJpeg image output buffer
[in]out_jpeg_sizeOutput image buffer size.
[out]out_result_sizesize of the resulting jpeg.