projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
overload operator<<() for wchar_t too (if applicable/possible); this fixes the proble...
[wxWidgets.git]
/
src
/
common
/
quantize.cpp
diff --git
a/src/common/quantize.cpp
b/src/common/quantize.cpp
index 3b2f3dc9a11fcfea95a77942cf0d7d530edafd1d..7d85887189a49c2a5d27fb30ae9dc207582e1288 100644
(file)
--- a/
src/common/quantize.cpp
+++ b/
src/common/quantize.cpp
@@
-30,7
+30,7
@@
/* modified by Vaclav Slavik for use as jpeglib-independent module */
/* modified by Vaclav Slavik for use as jpeglib-independent module */
-#if
def __GNUG__
+#if
defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "quantize.h"
#endif
#pragma implementation "quantize.h"
#endif
@@
-45,11
+45,12
@@
#include "wx/palette.h"
#endif
#include "wx/palette.h"
#endif
+#if wxUSE_IMAGE
+
#include "wx/image.h"
#include "wx/quantize.h"
#ifdef __WXMSW__
#include "wx/image.h"
#include "wx/quantize.h"
#ifdef __WXMSW__
-#include <windows.h>
#include "wx/msw/private.h"
#endif
#include "wx/msw/private.h"
#endif
@@
-1301,7
+1302,6
@@
start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
- int i;
if (is_pre_scan) {
/* Set up method pointers */
if (is_pre_scan) {
/* Set up method pointers */
@@
-1313,9
+1313,6
@@
start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
cquantize->pub.color_quantize = pass2_fs_dither;
cquantize->pub.finish_pass = finish_pass2;
cquantize->pub.color_quantize = pass2_fs_dither;
cquantize->pub.finish_pass = finish_pass2;
- /* Make sure color count is acceptable */
- i = cinfo->actual_number_of_colors;
-
{
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
(3 * sizeof(FSERROR)));
{
size_t arraysize = (size_t) ((cinfo->output_width + 2) *
(3 * sizeof(FSERROR)));
@@
-1333,7
+1330,7
@@
start_pass_2_quant (j_decompress_ptr cinfo, bool is_pre_scan)
}
/* Zero the histogram or inverse color map, if necessary */
if (cquantize->needs_zeroed) {
}
/* Zero the histogram or inverse color map, if necessary */
if (cquantize->needs_zeroed) {
- for (i = 0; i < HIST_C0_ELEMS; i++) {
+ for (i
nt i
= 0; i < HIST_C0_ELEMS; i++) {
memset((void *) histogram[i], 0,
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
}
memset((void *) histogram[i], 0,
HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell));
}
@@
-1509,8
+1506,6
@@
bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
{
int i;
{
int i;
- int w = src.GetWidth();
- int h = src.GetHeight();
int windowsSystemColourCount = 20;
int windowsSystemColourCount = 20;
@@
-1528,8
+1523,9
@@
bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
#endif
// create rows info:
#endif
// create rows info:
+ int h = src.GetHeight();
+ int w = src.GetWidth();
unsigned char **rows = new unsigned char *[h];
unsigned char **rows = new unsigned char *[h];
- h = src.GetHeight(), w = src.GetWidth();
unsigned char *imgdt = src.GetData();
for (i = 0; i < h; i++)
rows[i] = imgdt + 3/*RGB*/ * w * i;
unsigned char *imgdt = src.GetData();
for (i = 0; i < h; i++)
rows[i] = imgdt + 3/*RGB*/ * w * i;
@@
-1582,7
+1578,7
@@
bool wxQuantize::Quantize(const wxImage& src, wxImage& dest,
delete[] data8bit;
#if wxUSE_PALETTE
delete[] data8bit;
#if wxUSE_PALETTE
- // Make a wxWi
ndow
s palette
+ // Make a wxWi
dget
s palette
if (pPalette)
{
unsigned char* r = new unsigned char[256];
if (pPalette)
{
unsigned char* r = new unsigned char[256];
@@
-1656,3
+1652,6
@@
bool wxQuantize::Quantize(const wxImage& src,
return TRUE;
}
return TRUE;
}
+#endif
+ // wxUSE_IMAGE
+