lms-video/src/Gem/extra/pix2jpg/pix2jpg.h
Santi Noreña bbe8a169f2 - Moved DMX reading and file selection from Pure Data to the GUI.
- Added udserver external. All the communication between pure data
process and GUI now is done through Unix Domain Sockets.
- Only video files are working at the moment.
- Creating thumbnails now is done in the start routine.
- CITP/MSEx and DMX reading is started automatically in the start
routine.
- The dmx settings are reading from an xml file. Support for edit
through the GUI and save and open files in next commits. Also it should
integrates the window configuration.
- Audio has been cutted. It will be supported in a separate application.
2013-07-02 18:36:25 +02:00

99 lines
2.2 KiB
C++

/*-----------------------------------------------------------------
pix2jpg v0.02
External for Gem and Pure Data to convert an image to jpg and send it
via Unix Domain Sockets
(c) 2012-2013 Santi Noreña libremediaserver@gmail.com
GPL License.
-----------------------------------------------------------------*/
#ifndef _INCLUDE__GEM_PIXES_pix2jpg_H_
#define _INCLUDE__GEM_PIXES_pix2jpg_H_
#include "Base/GemPixObj.h"
#include "Base/GemBase.h"
#include "Gem/Manager.h"
#include "Gem/ImageIO.h"
#include "Gem/Image.h"
#include <stdio.h>
#include <Magick++.h>
#include <sys/socket.h>
#include <sys/un.h>
#include <unistd.h>
#include <string.h>
#include <m_pd.h>
using namespace Magick;
/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
pix2jpg
Convert a image to jpg and outputs in a Unix Domain Socket
KEYWORDS
pix
DESCRIPTION
"bang" - Process next image
outlet :
-----------------------------------------------------------------*/
class GEM_EXPORT pix2jpg : public GemPixObj
{
CPPEXTERN_HEADER(pix2jpg, GemPixObj);
public:
//////////
// Constructor
pix2jpg(t_symbol *s);
protected:
//////////
// Destructor
virtual ~pix2jpg();
//////////
// Do the rendering
virtual void processImage(imageStruct&image);
//////////
// Set the filename and filetype
// virtual void fileMess(int argc, t_atom *argv);
//////////
// The original pix_writer
imageStruct *m_originalImage;
//////////
// Manual writing
bool m_banged;
//////////
// Automatic writing
bool m_automatic;
//////////
// Layer to write
int m_layer;
// t_outlet *outlet1; // outlet pointer
struct sockaddr_un address;
int socket_fd, nbytes;
private:
//////////
// static member functions
static void startMessCallback(void *data);
static void stopMessCallback(void *data);
static void bangMessCallback(void *data);
static void layerimageMessCallback(void *data, t_float f);
};
#endif // for header file