[gs-commits] rev 11572 - in trunk/gs: . Resource/Init base contrib

henrys at ghostscript.com henrys at ghostscript.com
Fri Jul 30 17:07:00 UTC 2010


Author: henrys
Date: 2010-07-30 17:06:59 +0000 (Fri, 30 Jul 2010)
New Revision: 11572

Modified:
   trunk/gs/Resource/Init/gs_lev2.ps
   trunk/gs/Resource/Init/gs_res.ps
   trunk/gs/Resource/Init/pdf_draw.ps
   trunk/gs/autogen.sh
   trunk/gs/base/configure.ac
   trunk/gs/base/gdevbbox.c
   trunk/gs/base/gdevbit.c
   trunk/gs/base/gdevdbit.c
   trunk/gs/base/gdevpdtf.h
   trunk/gs/base/gdevrinkj.c
   trunk/gs/base/gsicc_create.c
   trunk/gs/base/gsovrc.h
   trunk/gs/base/gxi12bit.c
   trunk/gs/base/gxi16bit.c
   trunk/gs/base/gximage.h
   trunk/gs/base/gxpcolor.h
   trunk/gs/base/lib.mak
   trunk/gs/base/sjpx.c
   trunk/gs/base/strmio.h
   trunk/gs/contrib/gdevbjc_.h
Log:
rollback to revision 11564, 11565 broke the build

Modified: trunk/gs/Resource/Init/gs_lev2.ps
===================================================================
--- trunk/gs/Resource/Init/gs_lev2.ps	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/Resource/Init/gs_lev2.ps	2010-07-30 17:06:59 UTC (rev 11572)
@@ -900,16 +900,6 @@
   .dicttomark 
 ] def
 
-% Special type to install
-% sGray ICC profile color space
-/CIEsGRAYICC [ /ICCBased
-  mark
-    /N 1 
-    /DataSource (sgray)
-    /Alternate [/DeviceGray]
-    /Name (sgray) 
-  .dicttomark 
-] def
 
 % ------ Painting ------ %
 

Modified: trunk/gs/Resource/Init/gs_res.ps
===================================================================
--- trunk/gs/Resource/Init/gs_res.ps	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/Resource/Init/gs_res.ps	2010-07-30 17:06:59 UTC (rev 11572)
@@ -1074,10 +1074,6 @@
     /sRGBICC exch /ColorSpace defineresource pop
     systemdict /CIEsRGBICC undef
   } if
-  systemdict /CIEsGRAYICC .knownget {
-    /sGrayICC exch /ColorSpace defineresource pop
-    systemdict /CIEsGRAYICC undef
-  } if
 	% ColorSpaceFamily resources
   colorspacedict { pop dup /ColorSpaceFamily defineresource pop } forall
 	% Filter resources

Modified: trunk/gs/Resource/Init/pdf_draw.ps
===================================================================
--- trunk/gs/Resource/Init/pdf_draw.ps	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/Resource/Init/pdf_draw.ps	2010-07-30 17:06:59 UTC (rev 11572)
@@ -1042,9 +1042,9 @@
 
 /jp2_csp_dict <<
   12 { /DeviceCMYK } bind  % CMYK
-  14 { /Lab } bind		   % LAB
-  16 {/sRGBICC /ColorSpace findresource}   
-  17 {/sGrayICC /ColorSpace findresource} 
+% 14                       % LAB
+  16 { /DeviceRGB } bind   % sRGB {/sRGBICC /ColorSpace findresource}
+  17 { /DeviceGray } bind  % Gray {/sGray /ColorSpace findresource}
   18 3 index               % YCC is converted to RGB
 % 19                       % CIEJab not supportec by PDF 1.7
 % 20                       % e-sRGB
@@ -1064,7 +1064,7 @@
     /Components 1 index 8 getu16         % file len-14 (14) /Components NC
     def                                  % file len-14 (14)
     10 get 16#7F and 1 add
-	dup 12 eq { pop 16 } if    
+    8 .min % color depth is reduced in the library
 	/BitsPerComponent exch def           % file len-14 
   } bind
   /colr {

Modified: trunk/gs/autogen.sh
===================================================================
--- trunk/gs/autogen.sh	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/autogen.sh	2010-07-30 17:06:59 UTC (rev 11572)
@@ -35,4 +35,4 @@
 	echo "running ./configure $@"
 fi
 
-$srcdir/configure $@ && echo
+$srcdir/configure "$@" && echo

Modified: trunk/gs/base/configure.ac
===================================================================
--- trunk/gs/base/configure.ac	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/configure.ac	2010-07-30 17:06:59 UTC (rev 11572)
@@ -78,7 +78,7 @@
 dnl See if it is GNU sed or else.
 dnl - need more work to tell SED features.
 SED_EXTENDED_REGEX_OPT=-nre
-sed_variant=`sed --version 2>&1`
+sed_variant=`sed --version`
 sed_variant=`echo $sed_variant|sed -e 's/ .*//'`
 if test "$sed_variant" != GNU ; then
 SED_EXTENDED_REGEX_OPT=-nEe

Modified: trunk/gs/base/gdevbbox.c
===================================================================
--- trunk/gs/base/gdevbbox.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gdevbbox.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -1172,7 +1172,7 @@
 static int
 bbox_create_compositor(gx_device * dev,
 		       gx_device ** pcdev, const gs_composite_t * pcte,
-		       gs_imager_state * pis, gs_memory_t * memory, gx_device *cindev)
+		       gs_imager_state * pis, gs_memory_t * memory, gx_device *cdev)
 {
     gx_device_bbox *const bdev = (gx_device_bbox *) dev;
     gx_device *target = bdev->target;
@@ -1191,13 +1191,13 @@
      * box in the same place.
      */
     {
-	gx_device *temp_cdev;
+	gx_device *cdev;
 	gx_device_bbox *bbcdev;
 	int code = (*dev_proc(target, create_compositor))
-	    (target, &temp_cdev, pcte, pis, memory, cindev);
+	    (target, &cdev, pcte, pis, memory, cdev);
 
 	/* If the target did not create a new compositor then we are done. */
-	if (code < 0 || target == temp_cdev) {
+	if (code < 0 || target == cdev) {
 	    *pcdev = dev;
 	    return code;
 	}
@@ -1205,11 +1205,11 @@
 					   &st_device_bbox,
 					   "bbox_create_compositor");
 	if (bbcdev == 0) {
-	    (*dev_proc(temp_cdev, close_device)) (temp_cdev);
+	    (*dev_proc(cdev, close_device)) (cdev);
 	    return_error(gs_error_VMerror);
 	}
 	gx_device_bbox_init(bbcdev, target, memory);
-	gx_device_set_target((gx_device_forward *)bbcdev, temp_cdev);
+	gx_device_set_target((gx_device_forward *)bbcdev, cdev);
 	bbcdev->box_procs = box_procs_forward;
 	bbcdev->box_proc_data = bdev;
 	*pcdev = (gx_device *) bbcdev;

Modified: trunk/gs/base/gdevbit.c
===================================================================
--- trunk/gs/base/gdevbit.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gdevbit.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -321,7 +321,7 @@
 cmyk_cs_to_rgb_cm(gx_device * dev, frac c, frac m, frac y, frac k, frac out[])
 {
     color_cmyk_to_rgb(c, m, y, k, NULL, out, dev->memory);
-}
+};
 
 static void
 private_rgb_cs_to_rgb_cm(gx_device * dev, const gs_imager_state *pis,

Modified: trunk/gs/base/gdevdbit.c
===================================================================
--- trunk/gs/base/gdevdbit.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gdevdbit.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -289,7 +289,7 @@
 		}
 		LINE_ACCUM(composite, bpp);
 	    }
-	    LINE_ACCUM_COPY(dev, lout, bpp, x, rx, out_size, ry);
+	    LINE_ACCUM_COPY(dev, lout, bpp, x, rx, raster, ry);
 	}
       out:gs_free_object(mem, lout, "copy_alpha(lout)");
 	gs_free_object(mem, lin, "copy_alpha(lin)");

Modified: trunk/gs/base/gdevpdtf.h
===================================================================
--- trunk/gs/base/gdevpdtf.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gdevpdtf.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -184,7 +184,7 @@
     GC_OBJ_ELT(pdf_base_font_t, CIDSet),\
     GC_OBJ_ELT(pdf_base_font_t, FontFile),\
     GC_STRING_ELT(pdf_base_font_t, font_name)\
-}
+};\
 
 
 typedef struct {

Modified: trunk/gs/base/gdevrinkj.c
===================================================================
--- trunk/gs/base/gdevrinkj.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gdevrinkj.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -287,7 +287,7 @@
     color_cmyk_to_rgb(c, m, y, k, NULL, out, dev->memory);
     for(; i>0; i--)			/* Clear spot colors */
         out[2 + i] = 0;
-}
+};
 
 static void
 gray_cs_to_spotcmyk_cm(gx_device * dev, frac gray, frac out[])

Modified: trunk/gs/base/gsicc_create.c
===================================================================
--- trunk/gs/base/gsicc_create.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gsicc_create.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -148,9 +148,9 @@
 #define icMultiUnicodeText 0x6d6c7563           /* 'mluc' v4 text type */
 #define icMultiFunctionAtoBType 0x6d414220      /* 'mAB ' v4 lutAtoBtype type */
 #define icSigChromaticAdaptationTag 0x63686164  /* 'chad' */
-#define D50_X 0.9642f
-#define D50_Y 1.0f
-#define D50_Z 0.8249f
+#define D50_X 0.9642
+#define D50_Y 1.0
+#define D50_Z 0.8249
 #define DEFAULT_TABLE_NSIZE 9
 #define DEFAULT_TABLE_GRAYSIZE 128
 
@@ -1039,12 +1039,12 @@
 gsicc_create_compute_cam( gs_vector3 *white_src, gs_vector3 *white_des, 
                                 float *cam)
 {
-    float cat02matrix[] = {0.7328f, 0.4296f, -0.1624f,
-                            -0.7036f, 1.6975f, 0.0061f,
-                             0.003f, 0.0136f, 0.9834f};
-    float cat02matrixinv[] = {1.0961f, -0.2789f, 0.1827f,
-                              0.4544f, 0.4735f, 0.0721f,
-                             -0.0096f, -0.0057f, 1.0153f};
+    float cat02matrix[] = {0.7328, 0.4296, -0.1624,
+                            -0.7036, 1.6975, 0.0061,
+                             0.003, 0.0136, 0.9834};
+    float cat02matrixinv[] = {1.0961, -0.2789, 0.1827,
+                              0.4544, 0.4735, 0.0721,
+                             -0.0096, -0.0057, 1.0153};
     float vonkries_diag[9];
     float temp_matrix[9];
     float lms_wp_src[3], lms_wp_des[3];

Modified: trunk/gs/base/gsovrc.h
===================================================================
--- trunk/gs/base/gsovrc.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gsovrc.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -294,7 +294,7 @@
  * entire gs_overprint_s structure.
  */
 #define private_st_gs_overprint_t()	/* In gsovrc.c */\
-  gs_private_st_simple(st_overprint, gs_overprint_t, "gs_overprint_t")
+  gs_private_st_simple(st_overprint, gs_overprint_t, "gs_overprint_t");
 
 
 

Modified: trunk/gs/base/gxi12bit.c
===================================================================
--- trunk/gs/base/gxi12bit.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gxi12bit.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -31,16 +31,7 @@
 #include "gxcpath.h"
 #include "gximage.h"
 #include "vdtrace.h"
-#include "gsicc.h"
-#include "gsicc_cache.h"
-#include "gsicc_littlecms.h"
-#include "gxcie.h"
-#include "gscie.h"
 
-extern void cmap_transfer_halftone(gx_color_value *pconc, gx_device_color * pdc,
-     const gs_imager_state * pis, gx_device * dev, bool has_transfer,
-     bool has_halftone, gs_color_select_t select);
-
 /* ---------------- Unpacking procedures ---------------- */
 
 static const byte *
@@ -108,8 +99,6 @@
 
 /* Use special (slow) logic for 12-bit source values. */
 static irender_proc(image_render_frac);
-static irender_proc(image_render_icc16); /* icc 16bit case */
-
 irender_proc_t
 gs_image_class_2_fracs(gx_image_enum * penum)
 {
@@ -122,54 +111,9 @@
 		penum->mask_color.values[i] =
 		    bits2frac(penum->mask_color.values[i], 12);
 	}
-        if ( (gs_color_space_get_index(penum->pcs) == gs_color_space_index_DeviceN &&
-            penum->pcs->cmm_icc_profile_data == NULL) || penum->use_mask_color || 
-            penum->bps != 16 || 
-            gs_color_space_get_index(penum->pcs) == gs_color_space_index_DevicePixel) { 
-            /* DevicePixel color space used in mask from 3x type.  Basically
-               a simple color space that just is scaled to the device bit 
-               depth when remapped. No CM needed */
             if_debug0('b', "[b]render=frac\n");
             return &image_render_frac;
-        } else {
-            /* Set up the link now */
-            const gs_color_space *pcs;
-            gsicc_rendering_param_t rendering_params;
-            int k;
-            int src_num_comp = cs_num_components(penum->pcs);
-
-             penum->icc_setup.need_decode = false;
-            /* Check if we need to do any decoding.  If yes, then that will slow us down */
-            for (k = 0; k < src_num_comp; k++) {
-                if ( penum->map[k].decoding != sd_none ) {
-                    penum->icc_setup.need_decode = true;
-                    break;
                 }
-            }
-            /* Define the rendering intents */
-            rendering_params.black_point_comp = BP_ON;
-            rendering_params.object_type = GS_IMAGE_TAG;
-            rendering_params.rendering_intent = penum->pis->renderingintent;
-            if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
-                pcs = penum->pcs->icc_equivalent;
-            } else {
-                pcs = penum->pcs;
-            }
-            penum->icc_setup.is_lab = pcs->cmm_icc_profile_data->islab;
-            penum->icc_setup.must_halftone = gx_device_must_halftone(penum->dev);
-            penum->icc_setup.has_transfer = gx_has_transfer(penum->pis,
-                                    penum->pis->icc_manager->device_profile->num_comps);
-            if (penum->icc_setup.is_lab) penum->icc_setup.need_decode = false;
-            if (penum->icc_link == NULL) {
-                penum->icc_link = gsicc_get_link(penum->pis, pcs, NULL, 
-                    &rendering_params, penum->memory, false);
-            }
-            /* Use the direct unpacking proc */
-            penum->unpack = sample_unpackicc_16_proc;
-            if_debug0('b', "[b]render=icc16\n");
-            return &image_render_icc16;
-        }
-    }
     return 0;
 }
 
@@ -457,319 +401,3 @@
     penum->used.y = 0;
     return code;
 }
-
-static inline float
-rescale_input_color(gs_range range, float input)
-{
-    return((input-range.rmin)/(range.rmax-range.rmin));
-}
-
-
-/* This one includes an extra adjustment for the CIE PS color space 
-   non standard range */
-static void 
-decode_row_cie16(const gx_image_enum *penum, const unsigned short *psrc, 
-                 int spp, unsigned short *pdes, 
-                  const unsigned short *bufend, gs_range range_array[])
-{
-    unsigned short *curr_pos = pdes;
-    int k;
-    float temp;
-
-    while ( curr_pos < bufend ) {
-        for ( k = 0; k < spp; k ++ ) {
-            switch ( penum->map[k].decoding ) {
-                case sd_none:
-                    *curr_pos = *psrc;
-                    break;
-                case sd_lookup:	
-                    temp = penum->map[k].decode_lookup[(*psrc) >> 4]*65535.0;
-                    temp = rescale_input_color(range_array[k], temp);
-                    temp = temp*65535;
-                    if (temp > 65535.0) temp = 65535.0;
-                    if (temp < 0 ) temp = 0;
-                    *curr_pos = (unsigned short) temp;
-                    break;
-                case sd_compute:
-                    temp = penum->map[k].decode_base + 
-                        (*psrc) * penum->map[k].decode_factor;
-                    temp = rescale_input_color(range_array[k], temp);
-                    temp = temp*65535;
-                    if (temp > 65535) temp = 65535;
-                    if (temp < 0 ) temp = 0;
-                    *curr_pos = (unsigned short) temp;
-                default:
-                    break;
-            }
-            curr_pos++;
-            psrc++;
-        }
-    }
-}
-
-static void 
-decode_row16(const gx_image_enum *penum, const unsigned short *psrc, int spp,
-             unsigned short *pdes,const unsigned short *bufend)
-{
-    unsigned short *curr_pos = pdes;
-    int k;
-    float temp;
-
-    while ( curr_pos < bufend ) {
-        for ( k = 0; k < spp; k ++ ) {
-            switch ( penum->map[k].decoding ) {
-                case sd_none:
-                    *curr_pos = *psrc;
-                    break;
-                case sd_lookup:	
-                    temp = penum->map[k].decode_lookup[(*psrc) >> 4]*65535;
-                    if (temp > 65535) temp = 65535;
-                    if (temp < 0 ) temp = 0;
-                    *curr_pos = (unsigned short) temp;
-                    break;
-                case sd_compute:
-                    temp = penum->map[k].decode_base + 
-                        (*psrc) * penum->map[k].decode_factor;
-                    temp *= 65535;
-                    if (temp > 65535) temp = 65535;
-                    if (temp < 0 ) temp = 0;
-                    *curr_pos = (unsigned short) temp;
-                default:
-                    break;
-            }
-            curr_pos++;
-            psrc++;
-        }
-    }
-}
-
-/* Render an image with more than 8 bits per sample where we keep the data 
-   in 16 bit form and hand directly to the CMM */
-static int
-image_render_icc16(gx_image_enum * penum, const byte * buffer, int data_x,
-		  uint w, int h, gx_device * dev)
-{
-    const gs_imager_state *pis = penum->pis;
-    gs_logical_operation_t lop = penum->log_op;
-    gx_dda_fixed_point pnext;
-    image_posture posture = penum->posture;
-    fixed xprev, yprev;
-    fixed pdyx, pdyy;		/* edge of parallelogram */
-    int vci, vdi;
-    const gs_color_space *pcs;
-    gx_device_color devc1;
-    gx_device_color devc2;
-    gx_device_color *pdevc;
-    gx_device_color *pdevc_next;
-    gx_device_color *ptemp;
-    int spp = penum->spp;
-    const unsigned short *psrc_initial = (const unsigned short *)buffer + data_x * spp;
-    const unsigned short *psrc = psrc_initial;
-    const unsigned short *rsrc = psrc + spp; /* psrc + spp at start of run */
-    fixed xrun;			/* x at start of run */
-    int irun;			/* int xrun */
-    fixed yrun;			/* y ditto */
-    color_fracs run;		/* run value */
-    color_fracs next;		/* next sample value */
-    const unsigned short *bufend = psrc + w;
-    int code = 0, mcode = 0;
-    gsicc_bufferdesc_t input_buff_desc;
-    gsicc_bufferdesc_t output_buff_desc;
-    unsigned short *psrc_cm, *psrc_cm_start, *psrc_decode;
-    int k;
-    gx_color_value conc[GX_DEVICE_COLOR_MAX_COMPONENTS];
-    int spp_cm, num_pixels;
-    gx_color_index color;
-    bool need_decode = penum->icc_setup.need_decode;
-    bool must_halftone = penum->icc_setup.must_halftone;
-    bool has_transfer = penum->icc_setup.has_transfer;
-
-    if (h == 0)
-	return 0;
-
-    if (penum->icc_link == NULL) {
-        return gs_rethrow(-1, "ICC Link not created during image render icc16");
-    }
-    /* Needed for device N */
-    memset(&(conc[0]), 0, sizeof(gx_color_value[GX_DEVICE_COLOR_MAX_COMPONENTS]));
-    if (gs_color_space_is_PSCIE(penum->pcs) && penum->pcs->icc_equivalent != NULL) {
-        pcs = penum->pcs->icc_equivalent;
-    } else {
-        pcs = penum->pcs;
-    }
-    pdevc = &devc1;
-    pdevc_next = &devc2;
-    /* These used to be set by init clues */
-    pdevc->type = gx_dc_type_none;
-    pdevc_next->type = gx_dc_type_none;
-    if (h == 0)
-	return 0;
-    /* If the link is the identity, then we don't need to do any color 
-       conversions except for potentially a decode. */
-    if (penum->icc_link->is_identity && !need_decode) {
-        /* Fastest case.  No decode or CM needed */
-        psrc_cm = (unsigned short *) psrc;
-        spp_cm = spp;
-        bufend = psrc_cm +  w;
-        psrc_cm_start = NULL;
-    } else {
-        spp_cm = pis->icc_manager->device_profile->num_comps;
-        psrc_cm = (unsigned short*) gs_alloc_bytes(pis->memory,  
-                        sizeof(unsigned short)  * w * spp_cm/spp, 
-                        "image_render_icc16");
-        psrc_cm_start = psrc_cm;
-        bufend = psrc_cm +  w * spp_cm/spp;
-        if (penum->icc_link->is_identity) {
-            /* decode only. no CM.  This is slow but does not happen that often */
-            decode_row16(penum, psrc, spp, psrc_cm, bufend);    
-        } else {
-            /* Set up the buffer descriptors. */
-            num_pixels = w/spp;
-            gsicc_init_buffer(&input_buff_desc, spp, 2,
-                          false, false, false, 0, w * 2,
-                          1, num_pixels);
-            gsicc_init_buffer(&output_buff_desc, spp_cm, 2,
-                          false, false, false, 0, num_pixels * spp_cm * 2,
-                          1, num_pixels);
-            /* For now, just blast it all through the link. If we had a significant reduction 
-               we will want to repack the data first and then do this.  That will be 
-               an optimization shortly.  For now just allocate a new output
-               buffer.  We can reuse the old one if the number of channels in the output is
-               less than or equal to the new one.  */
-            if (need_decode) {
-                /* Need decode and CM.  This is slow but does not happen that often */
-                psrc_decode = (unsigned short*) gs_alloc_bytes(pis->memory,  
-                                sizeof(unsigned short) * w * spp_cm/spp, 
-                                "image_render_icc16");
-                if (penum->cie_range == NULL) {
-                    decode_row16(penum, psrc, spp, psrc_decode, 
-                                    (const unsigned short*) (psrc_decode+w));
-                } else {
-                    /* Decode needs to include adjustment for CIE range */
-                    decode_row_cie16(penum, psrc, spp, psrc_decode, 
-                                        (const unsigned short*) (psrc_decode+w), 
-                                         penum->cie_range);
-                }
-                gscms_transform_color_buffer(penum->icc_link, &input_buff_desc, 
-                                        &output_buff_desc, (void*) psrc_decode, 
-                                        (void*) psrc_cm);
-                gs_free_object(pis->memory, (byte *)psrc_decode, "image_render_color_icc");
-            } else {
-                /* CM only. No decode */
-                gscms_transform_color_buffer(penum->icc_link, &input_buff_desc, 
-                                            &output_buff_desc, (void*) psrc, 
-                                            (void*) psrc_cm);
-            }
-        }
-    }
-
-    pnext = penum->dda.pixel0;
-    xrun = xprev = dda_current(pnext.x);
-    yrun = yprev = dda_current(pnext.y);
-    pdyx = dda_current(penum->dda.row.x) - penum->cur.x;
-    pdyy = dda_current(penum->dda.row.y) - penum->cur.y;
-    switch (posture) {
-	case image_portrait:
-	    vci = penum->yci, vdi = penum->hci;
-	    irun = fixed2int_var_rounded(xrun);
-	    break;
-	case image_landscape:
-	default:    /* we don't handle skew -- treat as landscape */
-	    vci = penum->xci, vdi = penum->wci;
-	    irun = fixed2int_var_rounded(yrun);
-	    break;
-    }
-    if_debug5('b', "[b]y=%d data_x=%d w=%d xt=%f yt=%f\n",
-	      penum->y, data_x, w, fixed2float(xprev), fixed2float(yprev));
-    memset(&run, 0, sizeof(run));
-    memset(&next, 0, sizeof(next));
-    run.v[0] = ~psrc_cm[0];	/* Force intial setting */
-    while (psrc_cm < bufend) {
-	dda_next(pnext.x);
-	dda_next(pnext.y);
-        if ( penum->alpha ) {
-            /* If the pixels are different, then take care of the alpha now */
-            /* will need to adjust spp below.... */
-        } else {
-            memcpy(&(next.v[0]),psrc_cm, spp_cm * 2);
-            psrc_cm += spp_cm;
-        }
-        /* Compare to previous.  If same then move on */
-        if (posture != image_skewed && next.all[0] == run.all[0])
-		goto inc;
-        /* This needs to be sped up */
-        for ( k = 0; k < spp_cm; k++ ) {
-            conc[k] = next.v[k];
-        } 
-        /* Now we can do an encoding directly or we have to apply transfer
-           and or halftoning */
-        if (must_halftone || has_transfer) {
-            /* We need to do the tranfer function and/or the halftoning */
-            cmap_transfer_halftone(&(conc[0]), pdevc_next, pis, dev, 
-                has_transfer, must_halftone, gs_color_select_source);
-        } else {
-            /* encode as a color index. avoid all the cv to frac to cv
-               conversions */
-            color = dev_proc(dev, encode_color)(dev, &(conc[0]));
-            /* check if the encoding was successful; we presume failure is rare */
-            if (color != gx_no_color_index)
-                color_set_pure(pdevc_next, color);
-        }
-        /* Fill the region between */
-	/* xrun/irun and xprev */
-        if (posture != image_portrait) {	/* Parallelogram */
-	    code = (*dev_proc(dev, fill_parallelogram))
-	        (dev, xrun, yrun, xprev - xrun, yprev - yrun, pdyx, pdyy,
-	         pdevc, lop);
-	    xrun = xprev;
-	    yrun = yprev;
-        } else {		/* Rectangle */
-	    int xi = irun;
-	    int wi = (irun = fixed2int_var_rounded(xprev)) - xi;
-
-	    if (wi < 0)
-	        xi += wi, wi = -wi;
-	    if (wi > 0)
-	        code = gx_fill_rectangle_device_rop(xi, vci, wi, vdi,
-						    pdevc, dev, lop);
-        }
-        if (code < 0)
-	    goto err;
-	rsrc = psrc;
-	if ((code = mcode) < 0) goto err;
-        /* Swap around the colors due to a change */
-        ptemp = pdevc;
-        pdevc = pdevc_next;
-        pdevc_next = ptemp;
- 	run = next;
-inc:	xprev = dda_current(pnext.x);
-	yprev = dda_current(pnext.y);	/* harmless if no skew */
-    }
-    /* Fill the final run. */
-    if (posture != image_portrait) {
-	code = (*dev_proc(dev, fill_parallelogram))
-	    (dev, xrun, yrun, xprev - xrun, yprev - yrun, pdyx, pdyy,
-	     pdevc, lop);
-    } else {
-	int xi = irun;
-	int wi = (irun = fixed2int_var_rounded(xprev)) - xi;
-
-	if (wi < 0)
-	    xi += wi, wi = -wi;
-	if (wi > 0)
-	    code = gx_fill_rectangle_device_rop(xi, vci, wi, vdi,
-						pdevc, dev, lop);
-    }
-    /* Free cm buffer, if it was used */
-    if (psrc_cm_start != NULL) {
-        gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
-    }
-    return (code < 0 ? code : 1);
-
-    /* Save position if error, in case we resume. */
-err:
-    gs_free_object(pis->memory, (byte *)psrc_cm_start, "image_render_icc16");
-    penum->used.x = (rsrc - spp - psrc_initial) / spp;
-    penum->used.y = 0;
-    return code;
-}

Modified: trunk/gs/base/gxi16bit.c
===================================================================
--- trunk/gs/base/gxi16bit.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gxi16bit.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -57,31 +57,7 @@
     return bptr;
 }
 
-static const byte *
-sample_unpackicc_16(byte * bptr, int *pdata_x, const byte * data,
-		 int data_x, uint dsize, const sample_map *ignore_smap, int spread,
-		 int ignore_num_components_per_plane)
-{
-    /* Assuming an identity map for all components. */
-    register unsigned short *bufp = (unsigned short *) bptr;
-    uint dskip = data_x << 1;
-    const byte *psrc = data + dskip;
-#define inc_bufp16(bp, n) bp = ( unsigned short *)((byte *)(bp) + (n))
-    uint sample;
-    int left = dsize - dskip;
-
-    while (left > 2) {
-	sample = ((uint) psrc[0] << 8) + psrc[1];
-	*bufp = (unsigned short)(sample);
-	inc_bufp16(bufp, spread);
-	psrc += 2;
-	left -= 2;
-    }
-    *pdata_x = 0;
-    return bptr;
-}
 const sample_unpack_proc_t sample_unpack_16_proc = sample_unpack_16;
-const sample_unpack_proc_t sample_unpackicc_16_proc = sample_unpackicc_16;
 
 /* ---------------- Rendering procedures ---------------- */
 

Modified: trunk/gs/base/gximage.h
===================================================================
--- trunk/gs/base/gximage.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gximage.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -133,7 +133,6 @@
  * if 16-bit samples are supported, 0 otherwise.
  */
 extern const sample_unpack_proc_t sample_unpack_16_proc;
-extern const sample_unpack_proc_t sample_unpackicc_16_proc;
 
 /* Define the distinct postures of an image. */
 /* Each posture includes its reflected variant. */

Modified: trunk/gs/base/gxpcolor.h
===================================================================
--- trunk/gs/base/gxpcolor.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/gxpcolor.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -178,7 +178,7 @@
 #define private_st_pattern_trans() /* in gxpcmap.c */\
 gs_private_st_ptrs2(st_pattern_trans, gx_pattern_trans_t, "gx_pattern_trans",\
 		    pattern_trans_enum_ptrs, pattern_trans_reloc_ptrs,\
-		    pdev14, transbytes)
+		    pdev14, transbytes);
 
 
 

Modified: trunk/gs/base/lib.mak
===================================================================
--- trunk/gs/base/lib.mak	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/lib.mak	2010-07-30 17:06:59 UTC (rev 11572)
@@ -460,7 +460,7 @@
 gxcie_h=$(GLSRC)gxcie.h $(gscie_h)
 gxpcolor_h=$(GLSRC)gxpcolor.h\
  $(gspcolor_h) $(gxcspace_h) $(gxdevice_h) $(gxdevmem_h) $(gxpcache_h) $(gxblend_h)\
- $(gxcpath_h) $(gxdcolor_h) $(gxiclass_h) 
+ $(gxcpath_h) $(gxdcolor_h)
 gscolor_h=$(GLSRC)gscolor.h $(gxtmap_h)
 gsstate_h=$(GLSRC)gsstate.h\
  $(gscolor_h) $(gscpm_h) $(gscsel_h) $(gsdevice_h) $(gsht_h) $(gsline_h)
@@ -705,8 +705,7 @@
  $(gsccolor_h) $(gspaint_h)\
  $(gxarith_h) $(gxcmap_h) $(gxcpath_h) $(gxdcolor_h) $(gxdevice_h)\
  $(gxdevmem_h) $(gxfixed_h) $(gxfrac_h) $(gximage_h) $(gxistate_h)\
- $(gxmatrix_h)  $(vdtrace_h) $(gsicc_h) $(gsicc_cache_h) $(gsicc_littlecms_h)\
- $(gxcie_h) $(gscie_h)
+ $(gxmatrix_h)  $(vdtrace_h)
 	$(GLCC) $(GLO_)gxi12bit.$(OBJ) $(C_) $(GLSRC)gxi12bit.c
 
 $(GLOBJ)gxi16bit.$(OBJ) : $(GLSRC)gxi16bit.c $(GXERR)\
@@ -2687,7 +2686,7 @@
  $(gsrect_h) $(gzstate_h) $(gdevdevn_h) $(gdevp14_h) $(gsovrc_h) $(gxcmap_h) $(gscolor1_h)\
  $(gstrans_h) $(gsutil_h) $(gxcldev_h) $(gxclpath_h) $(gxdcconv_h) $(vdtrace_h)\
  $(gscolorbuffer_h) $(gsptype2_h) $(gxpcolor_h) $(gsptype1_h) $(gzcpath_h)\
- $(gxpaint_h) $(gsicc_manage_h) $(gxclist_h) $(gxiclass_h) $(gximage_h)
+ $(gxpaint_h) $(gsicc_manage_h) $(gxclist_h)
 	$(GLCC) $(GLO_)gdevp14.$(OBJ) $(C_) $(GLSRC)gdevp14.c
 
 translib_=$(GLOBJ)gstrans.$(OBJ) $(GLOBJ)gximag3x.$(OBJ)\

Modified: trunk/gs/base/sjpx.c
===================================================================
--- trunk/gs/base/sjpx.c	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/sjpx.c	2010-07-30 17:06:59 UTC (rev 11572)
@@ -165,7 +165,7 @@
 #endif /* DEBUG */
 
 static int
-copy_row_gray(byte *dest, jas_image_t *image,
+copy_row_gray(unsigned char *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i, p;
@@ -200,7 +200,7 @@
 }
 
 static int
-copy_row_rgb(byte *dest, jas_image_t *image,
+copy_row_rgb(unsigned char *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i, p;
@@ -227,7 +227,7 @@
 }
 
 static int
-copy_row_yuv(byte *dest, jas_image_t *image,
+copy_row_yuv(unsigned char *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i,j;
@@ -287,7 +287,7 @@
 }
 
 static int
-copy_row_default(byte *dest, jas_image_t *image,
+copy_row_default(unsigned char *dest, jas_image_t *image,
         int x, int y, int bytes)
 {
     int i, c,n;
@@ -304,67 +304,6 @@
     return count;
 }
 
-/* This is really inefficient and needs some work but at least
-   now we will get 16 bit data out correctly when it is in a non standard
-   color space. Note that indexing into dest (stream buffer) starts at +1. */
-static int
-copy_row_default16(byte *dest, jas_image_t *image,
-        int x, int y, int bytes)
-{
-    int c,n;
-    int count;
-    int pixel_width;
-    byte *curr_ptr = dest+1;  /* The offset */
-    int value;
-
-    n = jas_image_numcmpts(image);
-    count = bytes;
-    pixel_width = n*sizeof(unsigned short);
-
-    while (count >= pixel_width) {
-        for (c = 0; c < n; c++) {
-            value = jas_image_readcmptsample(image, c, x, y);
-            /* endian issues here? */
-            *curr_ptr++ = ((value >> 8) & 0xff);
-            *curr_ptr++ = (value & 0xff);
-        }
-        x++;
-        count =  count - pixel_width;
-    }
-    return bytes-count;
-}
-
-static int
-copy_row_gray16(byte *dest, jas_image_t *image,
-        int x, int y, int bytes, int bits)
-{
-    int count;
-    int pixel_width;
-    byte *curr_ptr = dest+1; /* The offset */
-    int shift;
-    int p, v;
-    unsigned short value;
-
-    v = jas_image_getcmptbytype(image, JAS_IMAGE_CT_GRAY_Y);
-    if (v < 0) return 0; /* no matching component */
-
-    count = bytes;
-    pixel_width = 2;
-    shift = max(16 - bits, 0);
-
-    while (count >= pixel_width) {
-        p = jas_image_readcmptsample(image, v, x, y);
-        value = p << shift;
-        /* endian issues here? */
-        *curr_ptr++ = ((value >> 8) & 0xff);
-        *curr_ptr++ = (value & 0xff);
-        x++;
-        count =  count - pixel_width;
-    }
-    return bytes-count;
-}
-
-
 /* buffer the input stream into our state */
 static int
 s_jpxd_buffer_input(stream_jpxd_state *const state, stream_cursor_read *pr,
@@ -373,10 +312,10 @@
     /* grow internal buffer if necessary */
     if (bytes > state->bufsize - state->buffill) {
         int newsize = state->bufsize;
-        byte *newbuf = NULL;
+        unsigned char *newbuf = NULL;
         while (newsize - state->buffill < bytes)
             newsize <<= 1;
-        newbuf = (byte *)gs_malloc(state->jpx_memory, newsize, 1,
+        newbuf = (unsigned char *)gs_malloc(state->jpx_memory, newsize, 1,
                                             "JPXDecode temp buffer");
         /* TODO: check for allocation failure */
         memcpy(newbuf, state->buffer, state->buffill);
@@ -479,28 +418,21 @@
         jas_image_t *image = state->image;
         int numcmpts = jas_image_numcmpts(image);
         int bits = jas_image_cmptprec(image, 0);
-        int stride, image_size;
+        int stride = numcmpts*jas_image_width(image);
+        long image_size = stride*jas_image_height(image);
         int clrspc = jas_image_clrspc(image);
         int x, y;
         long usable, done;
 
-        stride = numcmpts*jas_image_width(image);
-
-        if (bits > 8)  stride = 2*numcmpts*jas_image_width(image);
         if (bits == 4) stride = (stride + 1)/2;
 
-        image_size = stride*jas_image_height(image);
         /* copy data out of the decoded image data */
         /* be lazy and only write the rest of the current row */
         y = state->offset / stride;
         x = state->offset - y*stride; /* bytes, not samples */
         usable = min(out_size, stride - x);
-        /* now samples */
-        if (bits > 8) {
-            x = x/(numcmpts*2);               
-        } else {
-            x = x/numcmpts;     
-        }
+        x = x/numcmpts;               /* now samples */
+
         /* Make sure we can return a full pixel.
            This can fail if we get the colorspace wrong. */
         if (usable < numcmpts) return ERRC;
@@ -526,20 +458,10 @@
         else /* use the stream's colorspace */
           switch (jas_clrspc_fam(clrspc)) {
                 case JAS_CLRSPC_FAM_GRAY:
-                    if (bits > 8) {
-                        done = copy_row_gray16(pw->ptr, image, x, y, usable, bits);
-                    } else {
                         done = copy_row_gray(pw->ptr, image, x, y, usable);
-                    }
                     break;
                 case JAS_CLRSPC_FAM_RGB:
-                    if (bits == 16) {
-                        /* This will have issues if we have mixed compononents
-                           with different bps. Unlikely, but it could happen */
-                        done = copy_row_default16(pw->ptr, image, x, y, usable);
-                    } else {
                         done = copy_row_rgb(pw->ptr, image, x, y, usable);
-                    }
                     break;
                 case JAS_CLRSPC_FAM_YCBCR:
                     done = copy_row_yuv(pw->ptr, image, x, y, usable);
@@ -548,13 +470,7 @@
                 case JAS_CLRSPC_FAM_LAB:
                 case JAS_CLRSPC_FAM_UNKNOWN:
                 default:
-                    if (bits == 16) {
-                        /* This will have issues if we have mixed compononents
-                           with different bps. Unlikely, but it could happen */
-                        done = copy_row_default16(pw->ptr, image, x, y, usable);
-                    } else {
                         done = copy_row_default(pw->ptr, image, x, y, usable);
-                    }
                     break;
          }
         /* advance pointers for returned data */

Modified: trunk/gs/base/strmio.h
===================================================================
--- trunk/gs/base/strmio.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/base/strmio.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -55,7 +55,7 @@
 /*
  * Seek to beginning of the file
  */
-int srewind(stream *s);
+int srewind(stream *s);;
 
 /*
  * Return the current position in the stream or -1 if error.

Modified: trunk/gs/contrib/gdevbjc_.h
===================================================================
--- trunk/gs/contrib/gdevbjc_.h	2010-07-30 14:27:07 UTC (rev 11571)
+++ trunk/gs/contrib/gdevbjc_.h	2010-07-30 17:06:59 UTC (rev 11572)
@@ -140,7 +140,7 @@
     {  (int) 255,           /* White  paper  */        \
        (int) 255,           /*               */        \
        (int) 255 }          /*               */        \
-}
+};
 
 
 #define bjc_device(procs, dname, w10, h10, xdpi, ydpi, lm, bm, rm, tm, ncomp, depth, mg, mc, dg, dc, print_page, def_ink)\



More information about the gs-commits mailing list