ArduinoDumbDisplay v0.9.9-r34
DumbDisplay Arduino Library -- https://github.com/trevorwslee/Arduino-DumbDisplay
 
Loading...
Searching...
No Matches
ImageRetrieverDDTunnel Class Reference

#include <dumbdisplay.h>

Inheritance diagram for ImageRetrieverDDTunnel:
DDBufferedTunnel DDTunnel DDObject

Public Member Functions

 ImageRetrieverDDTunnel (const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
 
void reconnectForPixelImage (const String &imageName, int width, int height, bool fit=false)
 
void reconnectForPixelImage16 (const String &imageName, int width, int height, bool fit=false, bool grayscale=false)
 
void reconnectForPixelImageGS (const String &imageName, int width, int height, bool fit=false)
 
void reconnectForJpegImage (const String &imageName, int width, int height, int quality=100, bool fit=false)
 
bool readPixelImage (DDPixelImage &pixelImage)
 get single-bit image data retrieved with reconnectForPixelImage
 
bool readPixelImage16 (DDPixelImage16 &pixelImage16)
 get 16-bit image data retrieved with reconnectForPixelImage16

 
bool readPixelImageGS (DDPixelImage &pixelImage)
 
bool readPixelImageGS16 (DDPixelImage16 &pixelImage16)
 get grayscale 16-bit image data retrieved with reconnectForPixelImageGS

 
bool readJpegImage (DDJpegImage &jpeg)
 get JPEG image data retrieved with reconnectForJpegImage
 
- Public Member Functions inherited from DDBufferedTunnel
 DDBufferedTunnel (const String &type, int8_t tunnelId, const String &params, const String &endPoint, int8_t bufferSize)
 for internal use only
 
virtual void release ()
 
virtual void reconnect ()
 
virtual void handleInput (const String &data, uint8_t *fbBytes, bool final)
 
bool pending ()
 
int count ()
 count buffer ready read
 
bool eof (long timeoutMillis=DD_DEF_TUNNEL_TIMEOUT)
 
bool timedOut ()
 check whether EOF caused by timeout or not; note that timeout is only due to check of EOF with DDBufferedTunnel::eof() with timeoutMillis set
 
String readLine ()
 read a line from buffer
 
bool readLine (String &buffer)
 read a line from buffer, in to the buffer passed in
 
void writeLine (const String &data)
 write a line
 
bool read (String &fieldId, String &fieldValue)
 read a piece of JSON data
 
- Public Member Functions inherited from DDTunnel
 DDTunnel (const String &type, int8_t tunnelId, const String &params, const String &endPoint)
 for internal use only
 
void afterConstruct (bool connectNow)
 
const String & getEndpoint ()
 
virtual void release ()
 
virtual void reconnect ()
 
void reconnectTo (const String &endPoint)
 
void reconnectToSetParams (const String &endPoint, const String &params)
 
void reconnectToEndpoint (const DDTunnelEndpoint endpoint)
 reconnect to specified endpoint. See DDTunnelEndpoint.
 
const String & getTunnelId () const
 
virtual void handleInput (const String &data, uint8_t *fbBytes, bool final)
 

Additional Inherited Members

- Public Attributes inherited from DDObject
int8_t objectType
 object type – DD_OBJECT_TYPE_LAYER or DD_OBJECT_TYPE_TUNNEL
 
String customData
 custom data
 
- Protected Member Functions inherited from DDBufferedTunnel
int _count ()
 
virtual bool _eof (long timeoutMillis)
 
bool _readLine (String &buffer, uint8_t **pFBBytes=NULL)
 
- Protected Member Functions inherited from DDTunnel
bool _pending ()
 
bool _timedOut ()
 
virtual bool _eof (long timeoutMillis)
 
void _writeLine (const String &data)
 
void _writeSound (const String &soundName)
 
void doneHandleInput (bool final)
 
- Protected Attributes inherited from DDTunnel
String type
 
String tunnelId
 
String endPoint
 
String headers
 
String attachmentId
 
String params
 
unsigned long connectMillis
 

Detailed Description

Class service "tunnel" for retrieving image data (in format like JPEG / 565RGB) saved in DumbDisplay app storage via DumbDisplay::saveCachedImageFile(), DDLayer::saveImage() etc. When "reconnect" to retrieve image data, the dimension, say the TFT screen dimension, will be passed as parameters. Note that the image will be scaled down when needed. To read the mage data retrieved, call readPixelImage(), readPixelImage16(), readJpegImage() etc; in case of detected corruption of the data, the image width and height will be zeros.

Since
v0.9.9-r3

Constructor & Destructor Documentation

◆ ImageRetrieverDDTunnel()

ImageRetrieverDDTunnel::ImageRetrieverDDTunnel ( const String &  type,
int8_t  tunnelId,
const String &  params,
const String &  endPoint,
int8_t  bufferSize 
)
inline
Attention
constructed via DumbDisplay object

Member Function Documentation

◆ reconnectForJpegImage()

void ImageRetrieverDDTunnel::reconnectForJpegImage ( const String &  imageName,
int  width,
int  height,
int  quality = 100,
bool  fit = false 
)

reconnect to retrieve JPEG image

Parameters
quality0-100

◆ reconnectForPixelImage()

void ImageRetrieverDDTunnel::reconnectForPixelImage ( const String &  imageName,
int  width,
int  height,
bool  fit = false 
)

reconnect to retrieve single-bit "pixel" image (i.e. B&W image)

Parameters
fitwhether to fit the image to the given width and height, scaling up if necessary

◆ reconnectForPixelImage16()

void ImageRetrieverDDTunnel::reconnectForPixelImage16 ( const String &  imageName,
int  width,
int  height,
bool  fit = false,
bool  grayscale = false 
)

reconnect to retrieve 16-bit "pixel" image (i.e. 565 RGB image)

Parameters
grayscalewhether to convert the image to to grayscale