An idea for those wanting to fetch and view large images on the 3DS off the internet #66
LexiBigCheese
started this conversation in
Ideas
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
The 3DS does not have much RAM, a large image might end up filling the whole RAM if downloaded, swizzled, then uploaded to a texture.
Instead, you may want a custom image loader, in which you use chunked transfering, in
ehttp
terms, this isstreaming
, inminreq
terms, this is.send_lazy
.For PNG, if i remember correctly, you only need to know the pixel above and the pixel to the left to decode a pixel, so you will be storing at most two rows of pixels, the width of the image, to decode.
You may want to do some form of either sampling a pixel every so often to be loaded into the texture, or storing rolling sums that, when filled, are divided by however many pixels that rolling sum stores, and you generate what could be thought of as an "on the fly mipmap".
For JPEG, you may be able to make use of the properties of
sin
andcos
(and the way their integrals work) to convert the blocks into "average color", and then store and convert those blocks into pixels.Note that the 3DS seems to bork out if using a texture with a side length greater than 1024, so unless the server you're connecting to has some sort of
https://somecdn/image/keysmash?format=FORMAT&width=WIDTH&height=HEIGHT
, you're going to have to either create a proxy server that can more easily transcode images, likely using imagemagick, which the 3DS then loads trivially, at least underegui
withegui_extras
, or you're going to have to implement these custom loading routines.If you do implement these custom loading routines, let the rust3ds team know, so others may use your hard work.
Beta Was this translation helpful? Give feedback.
All reactions