blob: 14fa1045bc86249e9b52350522b31b7ca707d61c [file] [log] [blame]
Constantin Kaplinsky0b263232007-08-02 13:51:09 +00001/* Copyright (C) 2007 Constantin Kaplinsky. All Rights Reserved.
2 *
3 * This is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation; either version 2 of the License, or
6 * (at your option) any later version.
7 *
8 * This software is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this software; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
16 * USA.
17 */
18#ifndef __RFB_JPEGENCODER_H__
19#define __RFB_JPEGENCODER_H__
20
21#include <rfb/SMsgWriter.h>
22#include <rfb/PixelBuffer.h>
23#include <rfb/JpegCompressor.h>
24
25//
26// JPEG Encoder.
27// NOTE: JpegEncoder class is NOT derived from Encoder, because we need
28// access to the original server's framebuffer, without extra pixel
29// copying and with no pixel format translation.
30//
31
32namespace rfb {
33
34 class JpegEncoder {
35 public:
36 JpegEncoder(SMsgWriter* writer);
37 virtual ~JpegEncoder();
38
39 virtual void setQualityLevel(int level);
40 virtual bool writeRect(PixelBuffer* pb, const Rect& r);
41
42 private:
43 SMsgWriter* writer;
44 JpegCompressor* jcomp;
45
46 static const int qualityMap[10];
47 };
48
49}
50
51#endif