X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ed0d735d588f42485461ea526596436c4c6ad4b..8334c5b95809cae275ece6678c62f5715e7990cb:/src/common/quantize.cpp diff --git a/src/common/quantize.cpp b/src/common/quantize.cpp index 17231b4b71..7d85887189 100644 --- a/src/common/quantize.cpp +++ b/src/common/quantize.cpp @@ -30,7 +30,7 @@ /* modified by Vaclav Slavik for use as jpeglib-independent module */ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) #pragma implementation "quantize.h" #endif @@ -45,6 +45,8 @@ #include "wx/palette.h" #endif +#if wxUSE_IMAGE + #include "wx/image.h" #include "wx/quantize.h" @@ -1300,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; - int i; if (is_pre_scan) { /* Set up method pointers */ @@ -1312,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; - /* Make sure color count is acceptable */ - i = cinfo->actual_number_of_colors; - { size_t arraysize = (size_t) ((cinfo->output_width + 2) * (3 * sizeof(FSERROR))); @@ -1332,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) { - for (i = 0; i < HIST_C0_ELEMS; i++) { + for (int i = 0; i < HIST_C0_ELEMS; i++) { memset((void *) histogram[i], 0, HIST_C1_ELEMS*HIST_C2_ELEMS * sizeof(histcell)); } @@ -1508,8 +1506,6 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, { int i; - int w = src.GetWidth(); - int h = src.GetHeight(); int windowsSystemColourCount = 20; @@ -1527,8 +1523,9 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, #endif // create rows info: + int h = src.GetHeight(); + int w = src.GetWidth(); 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; @@ -1581,7 +1578,7 @@ bool wxQuantize::Quantize(const wxImage& src, wxImage& dest, delete[] data8bit; #if wxUSE_PALETTE - // Make a wxWindows palette + // Make a wxWidgets palette if (pPalette) { unsigned char* r = new unsigned char[256]; @@ -1655,3 +1652,6 @@ bool wxQuantize::Quantize(const wxImage& src, return TRUE; } +#endif + // wxUSE_IMAGE +