blob: 3d8fa8c16a3c3597522551bf5162faed715d1359 [file] [log] [blame]
Pierre Ossmanc0397262014-03-14 15:59:46 +01001/* Copyright (C) 2000-2003 Constantin Kaplinsky. All Rights Reserved.
2 * Copyright (C) 2011 D. R. Commander
3 * Copyright 2014 Pierre Ossman for Cendio AB
4 *
5 * This is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This software is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this software; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
18 * USA.
19 */
20#ifndef __RFB_TIGHTJPEGENCODER_H__
21#define __RFB_TIGHTJPEGENCODER_H__
22
23#include <rfb/Encoder.h>
24#include <rfb/JpegCompressor.h>
25
26namespace rfb {
27
28 class TightJPEGEncoder : public Encoder {
29 public:
30 TightJPEGEncoder(SConnection* conn);
31 virtual ~TightJPEGEncoder();
32
33 virtual bool isSupported();
34
35 virtual void setQualityLevel(int level);
36 virtual void setFineQualityLevel(int quality, int subsampling);
37
Pierre Ossmanab9fd6b2018-09-20 10:51:00 +020038 virtual int getQualityLevel();
39
Pierre Ossmanc0397262014-03-14 15:59:46 +010040 virtual void writeRect(const PixelBuffer* pb, const Palette& palette);
41 virtual void writeSolidRect(int width, int height,
42 const PixelFormat& pf,
43 const rdr::U8* colour);
44
45 protected:
46 void writeCompact(rdr::U32 value, rdr::OutStream* os);
47
48 protected:
49 JpegCompressor jc;
50
51 int qualityLevel;
52 int fineQuality;
53 int fineSubsampling;
54 };
55}
56#endif