File: algo0x0d.h

package info (click to toggle)
splix 2.0.1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,608 kB
  • sloc: cpp: 4,907; makefile: 424; ansic: 42; sh: 38; xml: 34; python: 8
file content (80 lines) | stat: -rw-r--r-- 3,210 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
/*
 *         algo0x0d.h SpliX is Copyright 2006-2008 by Aurélien Croc
 *                    This file is a SpliX derivative work
 *
 *  This program is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation; version 2 of the License.
 * 
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program; if not, write to the
 *  Free Software Foundation, Inc.,
 *  51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
 *
 * $Id$
 * --
 *  This code is written by Leonardo Hamada
 */
#ifndef _ALGO0x0D_H_
#define _ALGO0x0D_H_

#include "algorithm.h"
#include <inttypes.h>


/**
  * @brief This class implements the type 0xd encoding.
  */
class Algo0x0D : public Algorithm
{
    protected:
        inline void writeTwoBytesPacket(
                    unsigned char       * output,
                    unsigned long       & outputSize, 
                    long int            accumulatedHorizontalOffsetValue,
                    long int            accumulatedVerticalOffsetValue,
                    unsigned long       accumulatedRunCount );
    
        inline void writeFourBytesPacket(
                    unsigned char       * output,
                    unsigned long       & outputSize, 
                    long int            accumulatedHorizontalOffsetValue,
                    long int            accumulatedVerticalOffsetValue,
                    unsigned long       accumulatedRunCount );
    
        inline void writeSixBytesPacket(
                    unsigned char       * output,
                    unsigned long       & outputSize,
                    long int            accumulatedCombinedOffsetValue,
                    unsigned long       accumulatedRunCount );
    
        inline void selectPacketSize(
                    unsigned char       * output,
                    unsigned long       & outputSize,
                    unsigned long       preAccumulatedHorizontalOffsetValue,
                    unsigned long       accumulatedHorizontalOffsetValue,
                    unsigned long       currentHorizontalPenPosition,
                    unsigned long       accumulatedRunCount,
                    unsigned long       consecutiveBlankScanLines,
                    unsigned long       currentVerticalPenPosition,
                    const unsigned long wrapWidth );

    public:
        Algo0x0D();
        virtual ~Algo0x0D();

    public:
        virtual BandPlane*      compress(const Request& request, 
                                    unsigned char *data, unsigned long width,
                                    unsigned long height);
        virtual bool            reverseLineColumn() {return false;}
        virtual bool            inverseByte() {return false;}
        virtual bool            splitIntoBands() {return true;}
};

#endif /* _ALGO0x0D_H_ */