3#include "roo_backport.h"
4#include "roo_backport/byte.h"
14#define TJPGD_WORKSPACE_SIZE 3100
15#elif JD_FASTDECODE == 1
16#define TJPGD_WORKSPACE_SIZE 3500
17#elif JD_FASTDECODE == 2
18#define TJPGD_WORKSPACE_SIZE (3500 + 6144)
30 return decoder->input_->read((roo::byte*)
buf, size);
53bool JpegDecoder::getDimensions(
const roo_io::MultipassResource& resource,
55 if (!open(resource, width, height)) {
64bool JpegDecoder::open(
const roo_io::MultipassResource& resource,
65 int16_t& width, int16_t& height) {
66 input_ = resource.open();
77void JpegDecoder::draw(
const roo_io::MultipassResource& resource,
78 const Surface& s, uint8_t scale, int16_t& width,
80 PauseOutput pause(s.out());
81 if (!open(resource, width, height)) {
Axis-aligned integer rectangle.
int16_t yMax() const
Maximum y (inclusive).
JPEG decoder (stateful, reusable).
friend int jpeg_draw_rect(JDEC *jdec, void *data, JRECT *rect)
friend size_t jpeg_read(JDEC *, uint8_t *, size_t)
JpegDecoder()
Construct a JPEG decoder instance.
Resumes a paused output transaction.
Low-level handle used to draw to an underlying device.
int16_t dy() const
Return the y offset to apply to drawn objects.
const Box & clip_box() const
Return the clip box in device coordinates (independent of offsets).
void drawObject(const Drawable &object) const
Draw a drawable object to this surface.
DisplayOutput & out() const
Return the device output.
#define TJPGD_WORKSPACE_SIZE
Defines 140 opaque HTML named colors.
int jpeg_draw_rect(JDEC *jdec, void *data, JRECT *rect)
size_t jpeg_read(JDEC *jdec, uint8_t *buf, size_t size)
Public API surface for roo_display display, touch, and drawing utilities.
JRESULT jd_prepare(JDEC *jd, size_t(*infunc)(JDEC *, uint8_t *, size_t), void *pool, size_t sz_pool, void *dev)
JRESULT jd_decomp(JDEC *jd, int(*outfunc)(JDEC *, void *, JRECT *), uint8_t scale)