LibreOffice Module vcl (master)  1
Macros | Variables
bitmap3.cxx File Reference
#include <math.h>
#include <vcl/bitmapaccess.hxx>
#include <vcl/bitmapex.hxx>
#include <vcl/bitmap.hxx>
#include <config_features.h>
#include <sal/log.hxx>
#include <osl/diagnose.h>
#include <tools/helpers.hxx>
#include <vcl/BitmapMonochromeFilter.hxx>
#include <BitmapScaleSuperFilter.hxx>
#include <BitmapScaleConvolutionFilter.hxx>
#include <BitmapFastScaleFilter.hxx>
#include <BitmapInterpolateScaleFilter.hxx>
#include <bitmapwriteaccess.hxx>
#include <bitmap/impoctree.hxx>
#include <bitmap/Octree.hxx>
#include <svdata.hxx>
#include <salinst.hxx>
#include <salbmp.hxx>
#include "impvect.hxx"
#include <memory>
Include dependency graph for bitmap3.cxx:

Go to the source code of this file.

Macros

#define GAMMA(_def_cVal, _def_InvGamma)    (static_cast<sal_uInt8>(MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0,255)))
 
#define CALC_ERRORS
 
#define CALC_TABLES3
 
#define CALC_TABLES5
 
#define CALC_TABLES7
 

Variables

const sal_uLong nVCLRLut [6] = { 16, 17, 18, 19, 20, 21 }
 
const sal_uLong nVCLGLut [6] = { 0, 6, 12, 18, 24, 30 }
 
const sal_uLong nVCLBLut [6] = { 0, 36, 72, 108, 144, 180 }
 
const sal_uLong nVCLDitherLut [256]
 
const sal_uLong nVCLLut [256]
 
const long FloydMap [256]
 
const long FloydError1 [61]
 
const long FloydError3 [61]
 
const long FloydError5 [61]
 
const long FloydError7 [61]
 
const long FloydIndexMap [6]
 

Macro Definition Documentation

#define CALC_ERRORS
Value:
nTemp = p1T[nX++] >> 12; \
nBErr = MinMax( nTemp, 0, 255 ); \
nBErr = nBErr - FloydIndexMap[ nBC = FloydMap[nBErr] ]; \
nTemp = p1T[nX++] >> 12; \
nGErr = MinMax( nTemp, 0, 255 ); \
nGErr = nGErr - FloydIndexMap[ nGC = FloydMap[nGErr] ]; \
nTemp = p1T[nX] >> 12; \
nRErr = MinMax( nTemp, 0, 255 ); \
nRErr = nRErr - FloydIndexMap[ nRC = FloydMap[nRErr] ];
const long FloydMap[256]
Definition: bitmap3.cxx:148
const long FloydIndexMap[6]
Definition: bitmap3.cxx:221
std::enable_if< std::is_signed< T >::value||std::is_floating_point< T >::value, long >::type MinMax(T nVal, long nMin, long nMax)

Definition at line 51 of file bitmap3.cxx.

Referenced by Bitmap::Dither().

#define CALC_TABLES3
Value:
p2T[nX++] += FloydError3[nBErr]; \
p2T[nX++] += FloydError3[nGErr]; \
p2T[nX++] += FloydError3[nRErr];
const long FloydError3[61]
Definition: bitmap3.cxx:180

Definition at line 62 of file bitmap3.cxx.

Referenced by Bitmap::Dither().

#define CALC_TABLES5
Value:
p2T[nX++] += FloydError5[nBErr]; \
p2T[nX++] += FloydError5[nGErr]; \
p2T[nX++] += FloydError5[nRErr];
const long FloydError5[61]
Definition: bitmap3.cxx:193

Definition at line 67 of file bitmap3.cxx.

Referenced by Bitmap::Dither().

#define CALC_TABLES7
Value:
p1T[++nX] += FloydError7[nBErr]; \
p2T[nX++] += FloydError1[nBErr]; \
p1T[nX] += FloydError7[nGErr]; \
p2T[nX++] += FloydError1[nGErr]; \
p1T[nX] += FloydError7[nRErr]; \
p2T[nX] += FloydError1[nRErr];
const long FloydError7[61]
Definition: bitmap3.cxx:207
const long FloydError1[61]
Definition: bitmap3.cxx:168

Definition at line 72 of file bitmap3.cxx.

Referenced by Bitmap::Dither().

#define GAMMA (   _def_cVal,
  _def_InvGamma 
)    (static_cast<sal_uInt8>(MinMax(FRound(pow( _def_cVal/255.0,_def_InvGamma)*255.0),0,255)))

Definition at line 49 of file bitmap3.cxx.

Referenced by Bitmap::Adjust().

Variable Documentation

const long FloydError1[61]
Initial value:
=
{
-7680, -7424, -7168, -6912, -6656, -6400, -6144,
-5888, -5632, -5376, -5120, -4864, -4608, -4352,
-4096, -3840, -3584, -3328, -3072, -2816, -2560,
-2304, -2048, -1792, -1536, -1280, -1024, -768,
-512, -256, 0, 256, 512, 768, 1024, 1280, 1536,
1792, 2048, 2304, 2560, 2816, 3072, 3328, 3584,
3840, 4096, 4352, 4608, 4864, 5120, 5376, 5632,
5888, 6144, 6400, 6656, 6912, 7168, 7424, 7680
}

Definition at line 168 of file bitmap3.cxx.

const long FloydError3[61]
Initial value:
=
{
-23040, -22272, -21504, -20736, -19968, -19200,
-18432, -17664, -16896, -16128, -15360, -14592,
-13824, -13056, -12288, -11520, -10752, -9984,
-9216, -8448, -7680, -6912, -6144, -5376, -4608,
-3840, -3072, -2304, -1536, -768, 0, 768, 1536,
2304, 3072, 3840, 4608, 5376, 6144, 6912, 7680,
8448, 9216, 9984, 10752, 11520, 12288, 13056,
13824, 14592, 15360, 16128, 16896, 17664, 18432,
19200, 19968, 20736, 21504, 22272, 23040
}

Definition at line 180 of file bitmap3.cxx.

const long FloydError5[61]
Initial value:
=
{
-38400, -37120, -35840, -34560, -33280, -32000,
-30720, -29440, -28160, -26880, -25600, -24320,
-23040, -21760, -20480, -19200, -17920, -16640,
-15360, -14080, -12800, -11520, -10240, -8960,
-7680, -6400, -5120, -3840, -2560, -1280, 0,
1280, 2560, 3840, 5120, 6400, 7680, 8960, 10240,
11520, 12800, 14080, 15360, 16640, 17920, 19200,
20480, 21760, 23040, 24320, 25600, 26880, 28160,
29440, 30720, 32000, 33280, 34560, 35840, 37120,
38400
}

Definition at line 193 of file bitmap3.cxx.

const long FloydError7[61]
Initial value:
=
{
-53760, -51968, -50176, -48384, -46592, -44800,
-43008, -41216, -39424, -37632, -35840, -34048,
-32256, -30464, -28672, -26880, -25088, -23296,
-21504, -19712, -17920, -16128, -14336, -12544,
-10752, -8960, -7168, -5376, -3584, -1792, 0,
1792, 3584, 5376, 7168, 8960, 10752, 12544, 14336,
16128, 17920, 19712, 21504, 23296, 25088, 26880,
28672, 30464, 32256, 34048, 35840, 37632, 39424,
41216, 43008, 44800, 46592, 48384, 50176, 51968,
53760
}

Definition at line 207 of file bitmap3.cxx.

const long FloydIndexMap[6]
Initial value:
=
{
-30, 21, 72, 123, 174, 225
}

Definition at line 221 of file bitmap3.cxx.

const long FloydMap[256]
Initial value:
=
{
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
}

Definition at line 148 of file bitmap3.cxx.

const sal_uLong nVCLBLut[6] = { 0, 36, 72, 108, 144, 180 }
const sal_uLong nVCLDitherLut[256]
Initial value:
=
{
0, 49152, 12288, 61440, 3072, 52224, 15360, 64512, 768, 49920, 13056,
62208, 3840, 52992, 16128, 65280, 32768, 16384, 45056, 28672, 35840, 19456,
48128, 31744, 33536, 17152, 45824, 29440, 36608, 20224, 48896, 32512, 8192,
57344, 4096, 53248, 11264, 60416, 7168, 56320, 8960, 58112, 4864, 54016,
12032, 61184, 7936, 57088, 40960, 24576, 36864, 20480, 44032, 27648, 39936,
23552, 41728, 25344, 37632, 21248, 44800, 28416, 40704, 24320, 2048, 51200,
14336, 63488, 1024, 50176, 13312, 62464, 2816, 51968, 15104, 64256, 1792,
50944, 14080, 63232, 34816, 18432, 47104, 30720, 33792, 17408, 46080, 29696,
35584, 19200, 47872, 31488, 34560, 18176, 46848, 30464, 10240, 59392, 6144,
55296, 9216, 58368, 5120, 54272, 11008, 60160, 6912, 56064, 9984, 59136,
5888, 55040, 43008, 26624, 38912, 22528, 41984, 25600, 37888, 21504, 43776,
27392, 39680, 23296, 42752, 26368, 38656, 22272, 512, 49664, 12800, 61952,
3584, 52736, 15872, 65024, 256, 49408, 12544, 61696, 3328, 52480, 15616,
64768, 33280, 16896, 45568, 29184, 36352, 19968, 48640, 32256, 33024, 16640,
45312, 28928, 36096, 19712, 48384, 32000, 8704, 57856, 4608, 53760, 11776,
60928, 7680, 56832, 8448, 57600, 4352, 53504, 11520, 60672, 7424, 56576,
41472, 25088, 37376, 20992, 44544, 28160, 40448, 24064, 41216, 24832, 37120,
20736, 44288, 27904, 40192, 23808, 2560, 51712, 14848, 64000, 1536, 50688,
13824, 62976, 2304, 51456, 14592, 63744, 1280, 50432, 13568, 62720, 35328,
18944, 47616, 31232, 34304, 17920, 46592, 30208, 35072, 18688, 47360, 30976,
34048, 17664, 46336, 29952, 10752, 59904, 6656, 55808, 9728, 58880, 5632,
54784, 10496, 59648, 6400, 55552, 9472, 58624, 5376, 54528, 43520, 27136,
39424, 23040, 42496, 26112, 38400, 22016, 43264, 26880, 39168, 22784, 42240,
25856, 38144, 21760
}

Referenced by OutputDevice::BlendBitmap(), and OutputDevice::BlendBitmapWithAlpha().

const sal_uLong nVCLGLut[6] = { 0, 6, 12, 18, 24, 30 }
const sal_uLong nVCLLut[256]
const sal_uLong nVCLRLut[6] = { 16, 17, 18, 19, 20, 21 }