TwiceAsNice  2019-02-18
Public Member Functions | Private Member Functions | Private Attributes | List of all members
INDI::MJPEGEncoder Class Reference

The MJPEGEncoder class encodes frames in JPEG format before transmitting them to the client. More...

#include <mjpegencoder.h>

Inheritance diagram for INDI::MJPEGEncoder:
Inheritance graph
Collaboration diagram for INDI::MJPEGEncoder:
Collaboration graph

Public Member Functions

 MJPEGEncoder ()
 
 ~MJPEGEncoder ()
 
virtual bool upload (IBLOB *bp, const uint8_t *buffer, uint32_t nbytes, bool isCompressed=false) override
 
- Public Member Functions inherited from INDI::EncoderInterface
 EncoderInterface ()=default
 
virtual ~EncoderInterface ()=default
 
virtual void init (CCD *activeCCD)
 
virtual bool setPixelFormat (INDI_PIXEL_FORMAT pixelFormat, uint8_t pixelDepth)
 
virtual bool setSize (uint16_t width, uint16_t height)
 
const char * getName ()
 

Private Member Functions

const char * getDeviceName ()
 
int jpeg_compress_8u_gray (const uint8_t *src, uint16_t width, uint16_t height, int stride, uint8_t *dest, int *destsize, int quality)
 
int jpeg_compress_8u_rgb (const uint8_t *src, uint16_t width, uint16_t height, int stride, uint8_t *dest, int *destsize, int quality)
 

Private Attributes

uint8_tjpegBuffer = nullptr
 
uint16_t jpegBufferSize =1
 

Additional Inherited Members

- Protected Attributes inherited from INDI::EncoderInterface
const char * name
 
CCDcurrentCCD = nullptr
 
INDI_PIXEL_FORMAT pixelFormat
 
uint8_t pixelDepth = 8
 
uint16_t rawWidth
 
uint16_t rawHeight
 

Detailed Description

The MJPEGEncoder class encodes frames in JPEG format before transmitting them to the client.

The quality is now hard-coded at 70 when encoding the JPEG image. Further compression is not supported.

Constructor & Destructor Documentation

◆ MJPEGEncoder()

INDI::MJPEGEncoder::MJPEGEncoder ( )

◆ ~MJPEGEncoder()

INDI::MJPEGEncoder::~MJPEGEncoder ( )

Member Function Documentation

◆ getDeviceName()

const char * INDI::MJPEGEncoder::getDeviceName ( )
private

◆ jpeg_compress_8u_gray()

int INDI::MJPEGEncoder::jpeg_compress_8u_gray ( const uint8_t src,
uint16_t  width,
uint16_t  height,
int  stride,
uint8_t dest,
int *  destsize,
int  quality 
)
private

◆ jpeg_compress_8u_rgb()

int INDI::MJPEGEncoder::jpeg_compress_8u_rgb ( const uint8_t src,
uint16_t  width,
uint16_t  height,
int  stride,
uint8_t dest,
int *  destsize,
int  quality 
)
private

◆ upload()

bool INDI::MJPEGEncoder::upload ( IBLOB bp,
const uint8_t buffer,
uint32_t  nbytes,
bool  isCompressed = false 
)
overridevirtual

Member Data Documentation

◆ jpegBuffer

uint8_t* INDI::MJPEGEncoder::jpegBuffer = nullptr
private

◆ jpegBufferSize

uint16_t INDI::MJPEGEncoder::jpegBufferSize =1
private

The documentation for this class was generated from the following files: