/* modified by Vaclav Slavik for use as jpeglib-independent module */
-#ifdef __GNUG__
+#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma implementation "quantize.h"
#endif
#endif
#ifndef WX_PRECOMP
+ #include "wx/palette.h"
#endif
+#if wxUSE_IMAGE
+
#include "wx/image.h"
#include "wx/quantize.h"
#ifdef __WXMSW__
-#include <windows.h>
+#include "wx/msw/private.h"
#endif
#include <stdlib.h>
JSAMPLE *sample_range_limit, *srl_orig;
} j_decompress;
-#ifdef __WINDOWS__
+#if defined(__WINDOWS__) && !defined(__WXMICROWIN__)
#define JMETHOD(type,methodname,arglist) type (__cdecl methodname) arglist
#else
#define JMETHOD(type,methodname,arglist) type (methodname) arglist
void
prescan_quantize (j_decompress_ptr cinfo, JSAMPARRAY input_buf,
- JSAMPARRAY output_buf, int num_rows)
+ JSAMPARRAY WXUNUSED(output_buf), int num_rows)
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
register JSAMPROW ptr;
/* Select box to split.
* Current algorithm: by population for first half, then by volume.
*/
- if (numboxes*2 <= desired_colors) {
+ if ((numboxes*2) <= desired_colors) {
b1 = find_biggest_color_pop(boxlist, numboxes);
} else {
b1 = find_biggest_volume(boxlist, numboxes);
void
-finish_pass2 (j_decompress_ptr cinfo)
+finish_pass2 (j_decompress_ptr WXUNUSED(cinfo))
{
/* no work */
}
{
my_cquantize_ptr cquantize = (my_cquantize_ptr) cinfo->cquantize;
hist3d histogram = cquantize->histogram;
- int i;
if (is_pre_scan) {
/* Set up method pointers */
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)));
}
/* 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));
}
{
int i;
- int w = src.GetWidth();
- int h = src.GetHeight();
int windowsSystemColourCount = 20;
#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;
delete[] data8bit;
#if wxUSE_PALETTE
- // Make a wxWindows palette
+ // Make a wxWidgets palette
if (pPalette)
{
unsigned char* r = new unsigned char[256];
return TRUE;
}
+#endif
+ // wxUSE_IMAGE
+