summaryrefslogtreecommitdiff
path: root/devices/gdevpbm.c
Commit message (Collapse)AuthorAgeFilesLines
* Update postal address in file headersChris Liddell2023-04-041-2/+2
|
* Fix compiler warnings in devices/Chris Liddell2023-01-041-2/+2
| | | | Mismatched function prototype warnings, and one uninitialised variable.
* Rename some encode/decode color functions to be clearer.Robin Watts2021-06-231-2/+2
|
* Fix pamcmyk4 breakage.Robin Watts2021-06-221-6/+17
| | | | | Turns out that both the 32 and 4 bit pam devices use the same init function. Split them out to separate functions for simplicity.
* Move pXm devices to use encode/decode_color.Robin Watts2021-06-211-26/+28
| | | | This seems to fix pbmraw, pamcmyk32 and pnmcmyk.
* Remove needless makework in pgm_map_rgb_color.Robin Watts2021-06-181-12/+0
| | | | This might cause some tiny rounding changes, but for the better.
* Split initialize device proc into two.Robin Watts2021-04-261-75/+40
| | | | | | | | | | | | | | | | | The device initialize function currently performs 2 jobs. Firstly, it fills out the device_procs. Secondly, it performs any minimal initialization required by the device (typically none). At various points in the code we want to be able to copy procs from one 'prototype' device to another, so we call initialize for that. This populates the device procs, but does other work that typically requires a 'derived device' structure rather than a vanilla gx_device to work in. Accordingly, we split the job into two; initialize_device_procs (the first part) and initialize_device (the second part). The initialize_device_procs function will set up the initialize_device function pointer along with the rest if required.
* Further rationalisation of device init.Robin Watts2021-04-201-34/+25
| | | | | | | | | | Move the initialize procedure out of the device procs table, and into a bare function pointer at the start of the device proc. Devices just initialise this, and the rest should fall into place. This means changes to the device instantion macros (and all the uses thereof), but makes the code nicer overall. In particular, this removes the vestigial 'static_procs' structure.
* Move devices away from static init of procs.Robin Watts2021-04-201-20/+106
|
* Fix magic number used in pam device.Robin Watts2021-03-291-1/+1
| | | | This produces lots of tiny rounding diffs.
* Update copyright to 2021Chris Liddell2021-03-151-1/+1
|
* Update copyright to 2020Chris Liddell2020-04-101-1/+1
|
* Fix devices that ignore return codes from gdev_prn get_bits & copy_scan_linesRay Johnston2019-11-131-0/+2
| | | | | | | | | | | | | | | | Discovered these when working on bug 701845 'devicen' device. Checking uncovered a plethora of other places that used one of these functions assuming success. Also the gdev_prn_copy_scan_lines had places that assumed the return code was a valid line_count, so if negative, could memset many lines in front of an allocated buffer. The code in a few of these usages is strange, and we don't have a way to check them, so this may not match the original intent. Also, while perusing all of these files, check devices for alloc's that assume success and fix them (usually return gs_error_VMerror).
* Move FILE * operations behind new gp_file * API.Robin Watts2019-05-291-72/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (squash of commits from filesec branch) Most of this commit is donkeywork conversions of calls from FILE * -> gp_file *, fwrite -> gp_fwrite etc. Pretty much every device is touched, along with the clist and parsing code. The more interesting changes are within gp.h (where the actual new API is defined), gpmisc.c (where the basic implementations live), and the platform specific levels (gp_mswin.c, gp_unifs.c etc where the platform specific implementations have been tweaked/renamed). File opening path validation All file opening routines now call a central routine for path validation. This then consults new entries in gs_lib_ctx to see if validation is enabled or not. If so, it validates the paths by seeing if they match. Simple C level functions for adding/removing/clearing paths, exposed through the gsapi level. Add 2 postscript operators for path control. <name> <string> .addcontrolpath - Add the given <string> (path) to the list of paths for controlset <name>, where <name> can be: /PermitFileReading /PermitFileWriting /PermitFileControl (Anything else -> rangecheck) - .activatepathcontrol - Enable path control. At this point PS cannot make any more changes, and all file access is checked.
* Update source/header file copyright notice to 2019Chris Liddell2019-01-161-1/+1
|
* Update copyright notice with new head office address.Ken Sharp2018-01-301-3/+3
| | | | | | | | | Also update copyright dates. Remove gs_cmdl.ps as we no longer use it, and remove its entry from psfiles.htm. Remove xfonts.htm as this feature (xfont support) is long, long gone.
* Coverity IDs 121444, 121445, 121449Ken Sharp2017-09-041-3/+3
| | | | | More problems with intermediate promotion to int, probably caused when gx_color_index went from 32 to 64 bits.
* Make gs_imager_state == gs_state.Chris Liddell2016-06-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change how gstate initialisation is done: Previously we relied on the imager state being a subset of the gstate (thus assigning an imager state to a graphics state over wrote to the entries common to both, and didn't overwrite any already set graphics state specific entries). Making the imager and graphics states the same means that approach doesn't work, so this changes it to initialise the entries individually. Renames gsistate.c->gsgstate.c and gxistate.h->gxgstate.h Cleanup and fix the gs_state gc stuff. Uses different check for pre/post clist pdf14 device Previously, the code used "is_gstate" in the imager/graphics state object to determine if the code was being called pre or post clist (post clist would only ever have had an imager_state so is_gstate = false). With no imager state any more, that test would no longer work (and I am dubious about whether it was really safe, anyway). Other places check for the presence of a clist reader device in the pdf14 device structure - so use that here too. Adds initial (NULL) value for show_gstate pointer in gs_state. Removes the now pointless macro for the contents of the graphics state Changes function names that had "imager" to use "gstate" Removes the redundant 'is_state' flag Cleans up gs_(g)state_putdeviceparams(): Previously we had to similar routines: one took a graphics state, and used the device from the graphics state, the other took an imager state and the device as an explicit parameter. With the removal of the imager state, "merge" those two functions Replaces gs_state with gs_gstate It makes for less confusion as it really is a g(raphics)state
* Change max_components and num_components in dev.color_info to ucharMichael Vrhel2016-05-091-1/+1
| | | | | | | | | There are locations in the code where Coverity has complained about code logic that resulted in passing of unintialized values that could only occur if num_components < 0 . Since this should never be the case, we will make it clear by setting num_components and max_components to uchar. This will limit our support to 256 colors by a device.
* Fix potential valgrind warning.Robin Watts2016-02-231-0/+5
| | | | | | | | | | We don't have an example file for this, but this was spotted during investigations into Bug 693784. We can overrun by 1 pixel for odd length rows. When we overrun we read the lower 4 bits of a byte, and those may be undefined. Simply make PACIFY_VALGRIND blank these bits before we start.
* Commit of build_consolidation branchChris Liddell2015-07-201-0/+1401
Squashed into one commit (see branch for details of the evolution of the branch). This brings gpcl6 and gxps into the Ghostscript build system, and a shared set of graphics library object files for all the interpreters. Also, brings the same configuration options to the pcl and xps products as we have for Ghostscript.