Jpegdec services: Difference between revisions

No edit summary
Behemoth (talk | contribs)
No edit summary
 
(6 intermediate revisions by 3 users not shown)
Line 2: Line 2:


= caps:dc =
= caps:dc =
This is "nn::capsrv::sf::IDecoderControlService".


{| class="wikitable" border="1"
{| class="wikitable" border="1"
|-
|-
! Cmd || Name || Notes
! Cmd || Name
|-
|-
| 3001 || || Takes a total of 0x28-bytes of input, type-0x46 and type-0x5 buffers, and no output.
| 3001 || [[#DecodeJpeg]]
|-
| 4001 || [17.0.0+] [[#ShrinkJpeg]]
|-
| 4002 || [18.0.0+] [[#ShrinkJpegEx]]
|}
|}
== DecodeJpeg ==
Takes an input u32 '''width''', an input u32 '''height''', an input [[Capture_services#ScreenShotDecodeOption|ScreenShotDecodeOption]], a type-0x46 output buffer, a type-0x5 input buffer, and no output.
The type-0x46 buffer contains the RGBA8 image data. The type-0x5 buffer contains the input JPEG data.
== ShrinkJpeg ==
Takes an input u32 '''width''', an input u32 '''height''', an input [[Capture_services#ScreenShotDecodeOption|ScreenShotDecodeOption]], a type-0x46 output buffer, a type-0x5 input buffer, and an output u64 size.
Iterates the JPEG quality levels in order 98, 95, 90, 80, 70, 60, 50, 40, 30, 20, 10 to 0, tries to compress the input JPEG in the type-0x5, into the output buffer as a JPEG with the current quality and scaled_width = width/2 and scaled_height = height/2.
If it succeeds, or the failure isn't because the supplied buffer isn't large enough, returns, else retries with the next lower quality preset until 0.
== ShrinkJpegEx ==
Takes an input u32 '''width''', an input u32 '''height''', an input u32 '''quality''', an input [[Capture_services#ScreenShotDecodeOption|ScreenShotDecodeOption]], a type-0x46 output buffer, a type-0x5 input buffer, and an output u64 size.
Tries to compress the JPEG in the type-0x5 buffer into the type-0x46 buffer with the supplied width, height and quality as output settings.


[[Category:Services]]
[[Category:Services]]