pax_global_header00006660000000000000000000000064140745774310014526gustar00rootroot0000000000000052 comment=1c76c98cbac9c86567f1cd8d31b10270164ecc4f .depend000066400000000000000000000004351407457743100123340ustar00rootroot00000000000000# DO NOT DELETE error.o: raster.h raster.o: raster.h RasterDisplay.o: RasterDisplay.h raster.h RasterView.o: RasterView.h RasterDisplay.h raster.h eyedropper.xbm left.xbm RasterView.o: list.xbm move.xbm right.xbm zoom-in.xbm zoom-out.xbm main.o: RasterView.h RasterDisplay.h raster.h .lgtm.yml000066400000000000000000000000761407457743100126410ustar00rootroot00000000000000queries: - exclude: cpp/resource-not-released-in-destructor LICENSE000066400000000000000000000261361407457743100121070ustar00rootroot00000000000000 Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright [yyyy] [name of copyright owner] Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Makefile.in000066400000000000000000000076551407457743100131540ustar00rootroot00000000000000# # Makefile for rasterview, a CUPS/PWG Raster viewing program. # # Copyright © 2002-2021 by Michael R Sweet # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. # # Version... VERSION = @VERSION@ # Installation directories BUILDROOT = $(DSTROOT)$(RPM_BUILD_ROOT)$(DESTDIR) prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ datadir = @datadir@ datarootdir = @datarootdir@ desktopdir = @desktopdir@ # Compiler definitions... ARCHFLAGS = @ARCHFLAGS@ CC = @CC@ CFLAGS = $(ARCHFLAGS) $(CPPFLAGS) $(OPTIM) @CFLAGS@ @DEFS@ CP = @CP@ CODE_SIGN = @CODE_SIGN@ CODESIGN_IDENTITY = - CPPFLAGS = @CPPFLAGS@ CSFLAGS = -s "$(CODESIGN_IDENTITY)" @CSFLAGS@ --timestamp CXX = @CXX@ CXXFLAGS = $(ARCHFLAGS) $(CPPFLAGS) $(OPTIM) @CXXFLAGS@ @DEFS@ FLTKCONFIG = @FLTKCONFIG@ LDFLAGS = $(ARCHFLAGS) $(OPTIM) @LDFLAGS@ LIBS = @LIBS@ OPTIM = @OPTIM@ MKDIR = @MKDIR@ -p RM = @RM@ -f SHELL = /bin/sh # Rules for compiling... .SUFFIXES: .c .cxx .o .c.o: $(CC) $(CFLAGS) -c $< .cxx.o: $(CXX) $(CXXFLAGS) -c $< # Objects... RVOBJS = \ RasterDisplay.o \ RasterView.o \ error.o \ raster.o \ main.o OBJS = \ $(RVOBJS) \ testcie.o # Standard install targets... all: rasterview testcie clean: $(RM) rasterview testcie $(RM) $(OBJS) $(RM) *.bck $(RM) *~ depend: makedepend -Y -f .depend *.c *.cxx distclean: clean $(RM) -r autom4te* $(RM) config.* $(RM) Makefile $(RM) RasterView.app/Contents/MacOS/rasterview install: all @INSTALLDESKTOP@ $(MKDIR) $(BUILDROOT)$(bindir) cp rasterview $(BUILDROOT)$(bindir) install-desktop: $(MKDIR) $(BUILDROOT)$(desktopdir)/Development cp rasterview.desktop $(BUILDROOT)$(desktopdir)/Development $(MKDIR) $(BUILDROOT)$(datadir)/mimelnk/application cp vnd.cups-raster.desktop $(BUILDROOT)$(datadir)/mimelnk/application $(MKDIR) $(BUILDROOT)$(datadir)/mimelnk/image cp pwg-raster.desktop $(BUILDROOT)$(datadir)/mimelnk/image cp urf.desktop $(BUILDROOT)$(datadir)/mimelnk/image $(MKDIR) $(BUILDROOT)$(datadir)/icons/hicolor/32x32/apps cp rasterview-32.png $(BUILDROOT)$(datadir)/icons/hicolor/32x32/apps/rasterview.png $(MKDIR) $(BUILDROOT)$(datadir)/icons/hicolor/128x128/apps cp rasterview-128.png $(BUILDROOT)$(datadir)/icons/hicolor/128x128/apps/rasterview.png uninstall: @UNINSTALLDESKTOP@ $(RM) $(BUILDROOT)$(bindir)/rasterview uninstall-desktop: $(RM) $(desktopdir)/Graphics/rasterview.desktop $(RM) $(datadir)/mimelnk/application/vnd.cups-raster.desktop $(RM) $(datadir)/mimelnk/image/pwg-raster.desktop $(RM) $(datadir)/mimelnk/image/urf.desktop $(RM) $(datadir)/icons/hicolor/32x32/apps/rasterview.png $(RM) $(datadir)/icons/hicolor/128x128/apps/rasterview.png # Make a disk image with the compiled program on macOS... dmg: all echo Signing RasterView application bundle codesign -f $(CSFLAGS) RasterView.app echo Creating archive for notarization rm -f RasterView.zip ditto -c -k --keepParent RasterView.app RasterView.zip echo Notarizing application xcrun altool --notarize-app -f RasterView.zip \ --primary-bundle-id org.msweet.rasterview \ --username "$(APPLEID)" \ --password "@keychain:AC_$(TEAMID)" \ --asc-provider "$(TEAMID)" echo Making disk image rm -f rasterview-$(VERSION).dmg dmgbuild -s dmgbuild.py "RasterView $(VERSION)" ~/Desktop/rasterview-$(VERSION)-macos.dmg # Make an RPM for Linux... rpm: all epm -v -f rpm -nsm --output-dir dist rasterview mv dist/*.rpm . rm -rf dist # Build the rasterview program... rasterview: $(RVOBJS) Makefile $(CXX) $(LDFLAGS) -o $@ $(RVOBJS) $(LIBS) if test x`uname` = xDarwin; then \ test -d RasterView.app/Contents/MacOS || mkdir RasterView.app/Contents/MacOS; \ $(CP) rasterview RasterView.app/Contents/MacOS/rasterview; \ $(CODE_SIGN) $(CSFLAGS) RasterView.app; \ fi $(RVOBJS): RasterView.h RasterDisplay.h # Build the CIE test program... testcie: testcie.o Makefile $(CC) $(LDFLAGS) -o $@ testcie.o -lm # Dependencies... $(OBJS): Makefile include .depend NOTICE000066400000000000000000000000661407457743100120000ustar00rootroot00000000000000RasterView Copyright © 2002-2021 by Michael R Sweet README.md000066400000000000000000000073621407457743100123610ustar00rootroot00000000000000RasterView ========== RasterView is a CUPS, PWG, and Apple raster file viewing application. It basically allows you to look at the raster data produced by any of the standard CUPS RIP filters (cgpdftoraster, imagetoraster, pdftoraster, and pstoraster) and is normally used to either test those filters or look at the data that is being sent to your raster printer driver. RasterView is licensed under the Apache License Version 2.0. More information can be found at: https://www.msweet.org/rasterview Requirements ------------ If you plan on (re)compiling it, you'll need FLTK () 1.1.x or later and a C++ compiler. ## How to Compile Run the following commands: ./configure make How to Use ---------- The program is called "rasterview" on UNIX/Linux and "RasterView.app" on macOS. Run the program and then open a raster file, or pass the filename on the command-line. You can view multiple files simultaneously. The "test" subdirectory includes a script for generating raster data using the standard RIP filters. Run the following command for help: tools/maketestfiles.sh help Legal Stuff ----------- RasterView is Copyright © 2002-2021 by Michael R Sweet. RasterView is provided under the terms of the Apache License, Version 2.0. A copy of this license can be found in the file `LICENSE`. Additional legal information is provided in the file `NOTICE`. Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. Changes in v1.8 (2021-07-17) ---------------------------- - Fixed HiDPI support on Linux (Issue #11) - Fixed macOS 11 (Big Sur) issues (Issue #15) - Can now view page bitmaps up to 2GB in size (Issue #16) - Color picker mode now copies the hex RGB color to the clipboard. - Zoom gestures are now supported on macOS. - Addressed a few warnings from LGTM. - Fixed macOS bundle information and now provide fat binaries for Intel and Apple Silicon. Changes in v1.7.1 (2018-07-02) ------------------------------ - Fixed a crash bug on macOS. Changes in v1.7 (2018-06-03) ---------------------------- - Updated the page controls to allow navigation to the previous page and to selected pages. - Added mode buttons for zoom, pan, and color (to show the current mode). Changes in v1.6 (2018-01-21) ---------------------------- - Now licensed under the Apache License Version 2.0. - Fixed support for 16-bit per color files. - Added support for gzip'd raster files (Issue #7) Changes in v1.5 (2017-03-22) ---------------------------- - Added support for Apple raster files. Changes in v1.4.1 (2015-08-27) ------------------------------ - Fixed the dependency on strlcpy. Changes in v1.4 (2015-08-26) ---------------------------- - Added support for Device-N raster files. - Colorants can now be changed for Device-N, K, CMY, and CMYK raster files. - Attributes for PWG Raster files are now reported using the PWG 5102.4 naming and contents. Changes in v1.3 (2011-05-18) ---------------------------- - Added support for PWG Raster files (requires CUPS 1.5 or higher) Changes in v1.2.2 (2007-06-21) ------------------------------ - Added range checks to the page reader so that pages larger than 64MB or with invalid dimensions will not cause the program to crash. Changes in v1.2.1 (2006-09-28) ------------------------------ - Changed the default scheme to gtk+, which is available in FLTK 1.1.8 and higher. - Added a --enable-static configure option to use the static CUPS libraries. Changes in v1.2 (2006-05-13) ---------------------------- - First public release. RasterDisplay.cxx000066400000000000000000003542731407457743100144220ustar00rootroot00000000000000// // CUPS/PWG Raster display widget methods. // // Copyright © 2002-2021 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // #include "RasterDisplay.h" #include #include #include #include #include #include #include #include #include #include #include #include #include #include // // Absolute value macro... // #define abs(a) ((a) < 0 ? -(a) : (a)) // // Constants... // #define D65_X (0.412453 + 0.357580 + 0.180423) #define D65_Y (0.212671 + 0.715160 + 0.072169) #define D65_Z (0.019334 + 0.119193 + 0.950227) #define SBWIDTH 17 // Scrollbar width // // Local globals... // static int endian_offset = -1; static Fl_Preferences *prefs = NULL; // // Local functions... // static void convert_cmy(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_cmyk(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_device(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels, uchar device_colors[][3]); static void convert_k(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_kcmy(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_kcmycm(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_lab(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_rgb(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_rgba(cups_page_header2_t *header, int y, uchar *line, uchar *colors, uchar *pixels); static void convert_rgbw(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_w(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_xyz(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_ymc(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static void convert_ymck(cups_page_header2_t *header, uchar *line, uchar *colors, uchar *pixels); static ssize_t raster_cb(gzFile ctx, unsigned char *buffer, size_t length); // // 'RasterDisplay::RasterDisplay()' - Create a new raster display widget. // RasterDisplay::RasterDisplay( int X, // I - X position int Y, // I - Y position int W, // I - Width int H, // I - Height const char *L) // I - Label string : Fl_Group(X, Y, W, H, L), xscrollbar_(X, Y + H - SBWIDTH, W - SBWIDTH, SBWIDTH), yscrollbar_(X + W - SBWIDTH, Y, SBWIDTH, H - SBWIDTH) { end(); box(FL_DOWN_BOX); memset(&header_, 0, sizeof(header_)); fp_ = NULL; filename_ = NULL; ras_ = NULL; pixels_ = NULL; alloc_pixels_ = 0; colors_ = NULL; alloc_colors_ = 0; factor_ = 0.0; mode_ = RASTER_MODE_ZOOM_IN; mouse_x_ = 0; mouse_y_ = 0; xscrollbar_.type(FL_HORIZONTAL); xscrollbar_.callback(scrollbar_cb, this); yscrollbar_.type(FL_VERTICAL); yscrollbar_.callback(scrollbar_cb, this); resize(X, Y, W, H); } // // 'RasterDisplay::~RasterDisplay()' - Destroy a raster display widget. // RasterDisplay::~RasterDisplay() { close_file(); } // // 'RasterDisplay::close_file()' - Close an opened raster file. // int // O - 1 on success, 0 on failure RasterDisplay::close_file() { if (ras_) { cupsRasterClose(ras_); ras_ = NULL; } if (fp_) { gzclose(fp_); fp_ = NULL; } if (filename_) { free((void *)filename_); filename_ = NULL; } if (pixels_) { delete[] pixels_; pixels_ = NULL; alloc_pixels_ = 0; } if (colors_) { delete[] colors_; colors_ = NULL; alloc_colors_ = 0; } memset(&header_, 0, sizeof(header_)); return (1); } // // 'RasterDisplay::draw()' - Draw the raster display widget. // void RasterDisplay::draw() { int xoff, yoff; // Offset of image int X, Y, W, H; // Interior of widget #ifdef DEBUG puts("RasterDisplay::draw()"); #endif // DEBUG X = x() + Fl::box_dx(box()); Y = y() + Fl::box_dy(box()); W = w() - Fl::box_dw(box()); H = h() - Fl::box_dh(box()); if (factor_) { xscrollbar_.show(); yscrollbar_.show(); W -= SBWIDTH; H -= SBWIDTH; } else { xscrollbar_.hide(); yscrollbar_.hide(); } if (damage() & FL_DAMAGE_SCROLL) fl_push_clip(X, Y, W, H); if (factor_) draw_box(box(), x(), y(), w() - SBWIDTH, h() - SBWIDTH, color()); else draw_box(); if (damage() & FL_DAMAGE_SCROLL) fl_pop_clip(); else if (factor_) { fl_color(FL_GRAY); fl_rectf(x() + w() - SBWIDTH, y() + h() - SBWIDTH, SBWIDTH, SBWIDTH); } if (ras_ && pixels_ && header_.cupsWidth && header_.cupsHeight) { #ifdef DEBUG printf(" pixels_=%p, cupsWidth=%d, cupsHeight=%d\n", pixels_, header_.cupsWidth, header_.cupsHeight); #endif // DEBUG fl_push_clip(X, Y, W, H); if (xsize_ <= W) xoff = (W - xsize_) / 2; else xoff = 0; if (ysize_ <= H) yoff = (H - ysize_) / 2; else yoff = 0; xoff += X; yoff += Y; xstep_ = header_.cupsWidth / xsize_; xmod_ = header_.cupsWidth % xsize_; #ifdef DEBUG printf(" xoff=%d, yoff=%d, xsize_=%d, ysize_=%d, xstep_=%d, xmod_=%d\n", xoff, yoff, xsize_, ysize_, xstep_, xmod_); #endif // DEBUG fl_draw_image(image_cb, this, xoff, yoff, xsize_ > W ? W : xsize_, ysize_ > H ? H : ysize_, bpp_); fl_pop_clip(); } draw_label(X, Y, W, H - 2 * labelsize()); if (factor_) { if (damage() & FL_DAMAGE_SCROLL) { update_child(xscrollbar_); update_child(yscrollbar_); } else { draw_child(xscrollbar_); draw_child(yscrollbar_); } } } // // 'RasterDisplay::get_color()' - Return the original color value for a coordinate. // uchar * // O - Color values or NULL RasterDisplay::get_color(int X, // I - X position in image int Y) // I - Y position in image { if (!colors_ || X < 0 || X >= (int)header_.cupsWidth || Y < 0 || Y >= (int)header_.cupsHeight) return (NULL); else return (colors_ + (Y * header_.cupsWidth + X) * bpc_); } // // 'RasterDisplay::get_pixel()' - Return the displayed color value for a coordinate. // uchar * // O - RGB color value or NULL RasterDisplay::get_pixel(int X, // I - X position in image int Y) // I - Y position in image { if (!pixels_ || X < 0 || X >= (int)header_.cupsWidth || Y < 0 || Y >= (int)header_.cupsHeight) return (NULL); else return (pixels_ + (Y * header_.cupsWidth + X) * bpp_); } // // 'RasterDisplay::handle()' - Handle events in the widget. // int // O - 1 if handled, 0 otherwise RasterDisplay::handle(int event) // I - Event to handle { if (header_.cupsWidth && header_.cupsHeight) { switch (event) { case FL_ENTER : case FL_MOVE : update_mouse_xy(); if ((!yscrollbar_.visible() || Fl::event_x() < yscrollbar_.x()) && (!xscrollbar_.visible() || Fl::event_y() < xscrollbar_.y())) switch (mode_) { case RASTER_MODE_PAN : fl_cursor(FL_CURSOR_MOVE); break; case RASTER_MODE_ZOOM_IN : case RASTER_MODE_ZOOM_OUT : fl_cursor(FL_CURSOR_DEFAULT); break; default : case RASTER_MODE_CLICK : fl_cursor(FL_CURSOR_CROSS); break; } else fl_cursor(FL_CURSOR_DEFAULT); return (1); case FL_LEAVE : fl_cursor(FL_CURSOR_DEFAULT); return (1); case FL_SHORTCUT : switch (Fl::event_key()) { case '-' : // Zoom out if (factor_) scale(factor_ * 0.8f); else scale((float)xsize_ / (float)header_.cupsWidth * 0.8f); return (1); case '=' : // Zoom in if (factor_) scale(factor_ * 1.25f); else scale((float)xsize_ / (float)header_.cupsWidth * 1.25f); return (1); case '0' : // Fit scale(0.0f); return (1); case '1' : // 100% scale(1.0f); return (1); case '2' : // 200% scale(2.0f); return (1); case '3' : // 300% scale(3.0f); return (1); case '4' : // 400% scale(4.0f); return (1); } break; case FL_PUSH : if ((!yscrollbar_.visible() || Fl::event_x() < yscrollbar_.x()) && (!xscrollbar_.visible() || Fl::event_y() < xscrollbar_.y())) { update_mouse_xy(); last_x_ = Fl::event_x_root(); last_y_ = Fl::event_y_root(); start_x_ = mouse_x_; start_y_ = mouse_y_; start_ex_ = Fl::event_x(); start_ey_ = Fl::event_y(); if (mode_ == RASTER_MODE_CLICK) do_callback(); return (1); } break; case FL_DRAG : switch (mode_) { case RASTER_MODE_PAN : position(xscrollbar_.value() + last_x_ - Fl::event_x_root(), yscrollbar_.value() + last_y_ - Fl::event_y_root()); break; case RASTER_MODE_ZOOM_IN : if ((Fl::event_x() < start_ex_ && Fl::event_y() < start_ey_) || (Fl::event_x() > start_ex_ && Fl::event_y() > start_ey_)) fl_cursor(FL_CURSOR_NWSE); else fl_cursor(FL_CURSOR_NESW); window()->make_current(); fl_overlay_rect(start_ex_, start_ey_, Fl::event_x() - start_ex_, Fl::event_y() - start_ey_); break; case RASTER_MODE_CLICK : do_callback(); break; } last_x_ = Fl::event_x_root(); last_y_ = Fl::event_y_root(); update_mouse_xy(); return (1); case FL_RELEASE : update_mouse_xy(); switch (mode_) { case RASTER_MODE_ZOOM_IN : window()->make_current(); fl_cursor(FL_CURSOR_DEFAULT); fl_overlay_clear(); if (Fl::event_button() == FL_LEFT_MOUSE) { int W, H; W = w() - SBWIDTH - Fl::box_dw(box()); H = h() - SBWIDTH - Fl::box_dh(box()); if (abs(start_ex_ - Fl::event_x()) > 4 || abs(start_ey_ - Fl::event_y()) > 4) { // Zoom to box... float xfactor, yfactor; xfactor = (float)W / (float)abs(mouse_x_ - start_x_); yfactor = (float)H / (float)abs(mouse_y_ - start_y_); // printf("start_x_=%d, start_y_=%d, mouse_x_=%d, mouse_y_=%d\n", // start_x_, start_y_, mouse_x_, mouse_y_); // printf("W=%d, H=%d, dx=%d, dy=%d\n", W, H, // abs(mouse_x_ - start_x_), abs(mouse_x_ - start_x_)); // printf("xfactor=%g, yfactor=%g\n", xfactor, yfactor); scale(xfactor < yfactor ? xfactor : yfactor); position((int)((mouse_x_ < start_x_ ? mouse_x_ : start_x_) * scale()), (int)((mouse_y_ < start_y_ ? mouse_y_ : start_y_) * scale())); } else { if (factor_) scale(factor_ * 1.25f); else scale((float)xsize_ / (float)header_.cupsWidth * 1.25f); position((int)((mouse_x_ < start_x_ ? mouse_x_ : start_x_) * scale()) - W / 2, (int)((mouse_y_ < start_y_ ? mouse_y_ : start_y_) * scale()) - H / 2); } break; } case RASTER_MODE_ZOOM_OUT : if (factor_) scale(factor_ * 0.8f); else scale((float)xsize_ / (float)header_.cupsWidth * 0.8f); break; case RASTER_MODE_CLICK : do_callback(); break; } return (1); case FL_ZOOM_GESTURE : if (Fl::event_dy() < 0) { // Zoom out if (factor_) scale(factor_ * 0.875f); else scale((float)xsize_ / (float)header_.cupsWidth * 0.875f); } else { // Zoom in // update_mouse_xy(); if (factor_) scale(factor_ * 1.125f); else scale((float)xsize_ / (float)header_.cupsWidth * 1.125f); int W, H; W = w() - SBWIDTH - Fl::box_dw(box()); H = h() - SBWIDTH - Fl::box_dh(box()); position((int)(mouse_x_ * scale()) - W / 2, (int)(mouse_y_ * scale()) - H / 2); } return (1); } } return (Fl_Group::handle(event)); } // // 'RasterDisplay::image_cb()' - Provide a single line of an image. // void RasterDisplay::image_cb(void *p, // I - Raster display widget int X, // I - X offset int Y, // I - Y offset int W, // I - Width of image row uchar *D) // O - Image data { RasterDisplay *display; // Display widget const uchar *inptr; // Pointer into image int bpp, // Bytes per pixel value xerr, // Bresenheim values xstep, // ... xmod, // ... xsize; // ... display = (RasterDisplay *)p; bpp = display->bpp_; xstep = display->xstep_ * bpp; xmod = display->xmod_; xsize = display->xsize_; xerr = (X * xmod) % xsize; if (xsize > (display->w() - Fl::box_dw(display->box()) - SBWIDTH)) X = (X + display->xscrollbar_.value()) * (display->header_.cupsWidth - 1) / (xsize - 1); else X = X * (display->header_.cupsWidth - 1) / (xsize - 1); if (display->ysize_ > (display->h() - Fl::box_dh(display->box()) - SBWIDTH)) Y = (Y + display->yscrollbar_.value()) * (display->header_.cupsHeight - 1) / (display->ysize_ - 1); else Y = Y * (display->header_.cupsHeight - 1) / (display->ysize_ - 1); inptr = display->pixels_ + (Y * display->header_.cupsWidth + X) * bpp; if (xstep == bpp && xmod == 0) memcpy(D, inptr, (size_t)W * bpp); else if (bpp == 1) { for (; W > 0; W --) { *D++ = *inptr; inptr += xstep; xerr += xmod; if (xerr >= xsize) { xerr -= xsize; inptr += bpp; } } } else { for (; W > 0; W --) { *D++ = inptr[0]; *D++ = inptr[1]; *D++ = inptr[2]; inptr += xstep; xerr += xmod; if (xerr >= xsize) { xerr -= xsize; inptr += bpp; } } } } // // 'RasterDisplay::is_subtractive()' - Is the color space subtractive? // int RasterDisplay::is_subtractive() { return ((header_.cupsColorSpace >= CUPS_CSPACE_K && header_.cupsColorSpace <= CUPS_CSPACE_SILVER) || (header_.cupsColorSpace >= CUPS_CSPACE_DEVICE1 && header_.cupsColorSpace <= CUPS_CSPACE_DEVICEF)); } // // 'RasterDisplay::load_colors()' - Load device colors. // void RasterDisplay::load_colors() { int i; // Looping var char key[256], // Key string *value; // Value unsigned c, m ,y; // Colors if (!is_subtractive() || header_.cupsBitsPerColor < 8) return; if (!prefs) prefs = new Fl_Preferences(Fl_Preferences::USER, "msweet.org", "rasterview"); for (i = 0; i < header_.cupsNumColors; i ++) { snprintf(key, sizeof(key), "cs%dc%d", header_.cupsColorSpace, i); if (prefs->get(key, value, "") && sscanf(value, "%u %u %u", &c, &m, &y) == 3) { device_colors_[i][0] = c; device_colors_[i][1] = m; device_colors_[i][2] = y; } } } // // 'RasterDisplay::load_page()' - Load the next page from a raster stream. // int // O - 1 on success, 0 on failure RasterDisplay::load_page() { union { unsigned char bytes[sizeof(int)]; int integer; } endian_test; // Endian test variable if (!ras_ || page_ >= num_pages_) return (0); if (!cupsRasterReadHeader2(ras_, &header_)) { int err; fl_alert("Unable to read page header: %s", gzerror(fp_, &err)); return (0); } page_ ++; if (header_.cupsColorOrder == CUPS_ORDER_PLANAR) { fl_alert("Sorry, RasterView doesn't support planar raster data at this time."); return (0); } // Allocate memory for the page data... #ifdef DEBUG fprintf(stderr, "DEBUG: sizeof(cups_page_header_t) = %d\n", (int)sizeof(cups_page_header_t)); fprintf(stderr, "DEBUG: sizeof(cups_page_header2_t) = %d\n", (int)sizeof(cups_page_header2_t)); fprintf(stderr, "DEBUG: MediaClass = \"%s\"\n", header_.MediaClass); fprintf(stderr, "DEBUG: MediaColor = \"%s\"\n", header_.MediaColor); fprintf(stderr, "DEBUG: MediaType = \"%s\"\n", header_.MediaType); fprintf(stderr, "DEBUG: OutputType = \"%s\"\n", header_.OutputType); fprintf(stderr, "DEBUG: AdvanceDistance = %d(%x)\n", header_.AdvanceDistance, header_.AdvanceDistance); fprintf(stderr, "DEBUG: AdvanceMedia = %d(%x)\n", header_.AdvanceMedia, header_.AdvanceMedia); fprintf(stderr, "DEBUG: Collate = %d(%x)\n", header_.Collate, header_.Collate); fprintf(stderr, "DEBUG: CutMedia = %d(%x)\n", header_.CutMedia, header_.CutMedia); fprintf(stderr, "DEBUG: Duplex = %d(%x)\n", header_.Duplex, header_.Duplex); fprintf(stderr, "DEBUG: HWResolution = [ %d(%x) %d(%x) ]\n", header_.HWResolution[0], header_.HWResolution[0], header_.HWResolution[1], header_.HWResolution[1]); fprintf(stderr, "DEBUG: ImagingBoundingBox = [ %d(%x) %d(%x) %d(%x) %d(%x) ]\n", header_.ImagingBoundingBox[0], header_.ImagingBoundingBox[0], header_.ImagingBoundingBox[1], header_.ImagingBoundingBox[1], header_.ImagingBoundingBox[2], header_.ImagingBoundingBox[2], header_.ImagingBoundingBox[3], header_.ImagingBoundingBox[3]); fprintf(stderr, "DEBUG: InsertSheet = %d(%x)\n", header_.InsertSheet, header_.InsertSheet); fprintf(stderr, "DEBUG: Jog = %d(%x)\n", header_.Jog, header_.Jog); fprintf(stderr, "DEBUG: LeadingEdge = %d(%x)\n", header_.LeadingEdge, header_.LeadingEdge); fprintf(stderr, "DEBUG: Margins = [ %d(%x) %d(%x) ]\n", header_.Margins[0], header_.Margins[0], header_.Margins[1], header_.Margins[1]); fprintf(stderr, "DEBUG: ManualFeed = %d(%x)\n", header_.ManualFeed, header_.ManualFeed); fprintf(stderr, "DEBUG: MediaPosition = %d(%x)\n", header_.MediaPosition, header_.MediaPosition); fprintf(stderr, "DEBUG: MediaWeight = %d(%x)\n", header_.MediaWeight, header_.MediaWeight); fprintf(stderr, "DEBUG: MirrorPrint = %d(%x)\n", header_.MirrorPrint, header_.MirrorPrint); fprintf(stderr, "DEBUG: NegativePrint = %d(%x)\n", header_.NegativePrint, header_.NegativePrint); fprintf(stderr, "DEBUG: NumCopies = %d(%x)\n", header_.NumCopies, header_.NumCopies); fprintf(stderr, "DEBUG: Orientation = %d(%x)\n", header_.Orientation, header_.Orientation); fprintf(stderr, "DEBUG: OutputFaceUp = %d(%x)\n", header_.OutputFaceUp, header_.OutputFaceUp); fprintf(stderr, "DEBUG: PageSize = [ %d(%x) %d(%x) ]\n", header_.PageSize[0], header_.PageSize[0], header_.PageSize[1], header_.PageSize[1]); fprintf(stderr, "DEBUG: Separations = %d(%x)\n", header_.Separations, header_.Separations); fprintf(stderr, "DEBUG: TraySwitch = %d(%x)\n", header_.TraySwitch, header_.TraySwitch); fprintf(stderr, "DEBUG: Tumble = %d(%x)\n", header_.Tumble, header_.Tumble); fprintf(stderr, "DEBUG: cupsWidth = %d(%x)\n", header_.cupsWidth, header_.cupsWidth); fprintf(stderr, "DEBUG: cupsHeight = %d(%x)\n", header_.cupsHeight, header_.cupsHeight); fprintf(stderr, "DEBUG: cupsMediaType = %d(%x)\n", header_.cupsMediaType, header_.cupsMediaType); fprintf(stderr, "DEBUG: cupsBitsPerColor = %d(%x)\n", header_.cupsBitsPerColor, header_.cupsBitsPerColor); fprintf(stderr, "DEBUG: cupsBitsPerPixel = %d(%x)\n", header_.cupsBitsPerPixel, header_.cupsBitsPerPixel); fprintf(stderr, "DEBUG: cupsBytesPerLine = %d(%x)\n", header_.cupsBytesPerLine, header_.cupsBytesPerLine); fprintf(stderr, "DEBUG: cupsColorOrder = %d(%x)\n", header_.cupsColorOrder, header_.cupsColorOrder); fprintf(stderr, "DEBUG: cupsColorSpace = %d(%x)\n", header_.cupsColorSpace, header_.cupsColorSpace); fprintf(stderr, "DEBUG: cupsCompression = %d(%x)\n", header_.cupsCompression, header_.cupsCompression); fprintf(stderr, "DEBUG: cupsNumColors = %d(%x)\n", header_.cupsNumColors, header_.cupsNumColors); #endif // DEBUG bpp_ = ((header_.cupsBitsPerColor < 8 || !is_subtractive()) && header_.cupsNumColors == 1) ? 1 : 3; if (header_.cupsWidth == 0 || header_.cupsWidth > 1000000 || header_.cupsHeight == 0 || header_.cupsHeight > 1000000) { fl_alert("Sorry, image dimensions are out of range (%ux%u).", header_.cupsWidth, header_.cupsHeight); return (0); } long pixelsize = (long)header_.cupsWidth * bpp_; long bytes = pixelsize * header_.cupsHeight; if (bytes >= INT_MAX) { fl_alert("Sorry, image is too large to display (%ux%ux%u >= 2GB).", header_.cupsWidth, header_.cupsHeight, header_.cupsBitsPerPixel); return (0); } if (bytes > alloc_pixels_) { if (pixels_) delete[] pixels_; pixels_ = new uchar[bytes]; alloc_pixels_ = bytes; if (!pixels_) { fl_alert("Unable to allocate %ld bytes for page data.", bytes); return (0); } } bpc_ = (header_.cupsBitsPerPixel + 7) / 8; if (header_.cupsColorOrder != CUPS_ORDER_CHUNKED) bpc_ *= header_.cupsNumColors; long colorsize = (long)header_.cupsWidth * bpc_; bytes = colorsize * header_.cupsHeight; if (bytes > alloc_colors_) { if (colors_) delete[] colors_; colors_ = new uchar[bytes]; alloc_colors_ = bytes; if (!colors_) { fl_alert("Unable to allocate %ld bytes for page data.", bytes); return (0); } } // Update the page dimensions/scaling... resize(x(), y(), w(), h()); memset(colors_, 0, alloc_colors_); memset(pixels_, 255, alloc_pixels_); uchar *line = new uchar[header_.cupsBytesPerLine]; if (!line) { fl_alert("Unable to allocate %d bytes for raster data.", header_.cupsBytesPerLine); return (0); } // See what word order we need to use... if (endian_offset < 0) { memset(&endian_test, 0, sizeof(endian_test)); endian_test.bytes[sizeof(endian_test.bytes) - 1] = 1; if (endian_test.integer == 1) endian_offset = 0; // Big endian else endian_offset = 1; // Little endian } // Set device colors... memset(device_colors_, 255, sizeof(device_colors_)); switch (header_.cupsColorSpace) { case CUPS_CSPACE_DEVICE3 : case CUPS_CSPACE_DEVICE4 : case CUPS_CSPACE_CMY : case CUPS_CSPACE_CMYK : device_colors_[0][1] = device_colors_[0][2] = 0; device_colors_[1][0] = device_colors_[1][2] = 0; device_colors_[2][0] = device_colors_[2][1] = 0; break; case CUPS_CSPACE_YMC : case CUPS_CSPACE_YMCK : device_colors_[0][0] = device_colors_[0][1] = 0; device_colors_[1][0] = device_colors_[1][2] = 0; device_colors_[2][1] = device_colors_[2][2] = 0; break; case CUPS_CSPACE_DEVICE6 : device_colors_[0][1] = device_colors_[0][2] = 0; device_colors_[1][0] = device_colors_[1][2] = 0; device_colors_[2][0] = device_colors_[2][1] = 0; device_colors_[4][0] = 127; device_colors_[4][1] = device_colors_[4][2] = 0; device_colors_[5][1] = 127; device_colors_[5][0] = device_colors_[5][2] = 0; break; case CUPS_CSPACE_W : case CUPS_CSPACE_SW : device_colors_[0][0] = device_colors_[0][1] = device_colors_[0][2] = 0; break; case CUPS_CSPACE_RGB : case CUPS_CSPACE_SRGB : case CUPS_CSPACE_ADOBERGB : device_colors_[0][0] = 0; device_colors_[1][1] = 0; device_colors_[2][2] = 0; break; default : break; } load_colors(); // Read the raster data... uchar *pptr, // Pointer into pixels_ *cptr; // Pointer into colors_ int py; // Current position in page for (py = header_.cupsHeight, cptr = colors_, pptr = pixels_; py > 0; py --, cptr += colorsize, pptr += pixelsize) { if ((py % header_.HWResolution[1]) == 0) { // Update the screen to show progress... redraw(); Fl::check(); } if (!cupsRasterReadPixels(ras_, line, header_.cupsBytesPerLine)) { fl_alert("Unable to read page data: %s", strerror(errno)); delete[] line; return (0); } switch (header_.cupsColorSpace) { case CUPS_CSPACE_DEVICE1 : case CUPS_CSPACE_DEVICE2 : case CUPS_CSPACE_DEVICE3 : case CUPS_CSPACE_DEVICE4 : case CUPS_CSPACE_DEVICE5 : case CUPS_CSPACE_DEVICE6 : case CUPS_CSPACE_DEVICE7 : case CUPS_CSPACE_DEVICE8 : case CUPS_CSPACE_DEVICE9 : case CUPS_CSPACE_DEVICEA : case CUPS_CSPACE_DEVICEB : case CUPS_CSPACE_DEVICEC : case CUPS_CSPACE_DEVICED : case CUPS_CSPACE_DEVICEE : case CUPS_CSPACE_DEVICEF : convert_device(&header_, line, cptr, pptr, device_colors_); break; case CUPS_CSPACE_W : case CUPS_CSPACE_SW : convert_w(&header_, line, cptr, pptr); break; case CUPS_CSPACE_RGB : case CUPS_CSPACE_SRGB : case CUPS_CSPACE_ADOBERGB : convert_rgb(&header_, line, cptr, pptr); break; case CUPS_CSPACE_RGBA : convert_rgba(&header_, py, line, cptr, pptr); break; case CUPS_CSPACE_RGBW : convert_rgbw(&header_, line, cptr, pptr); break; case CUPS_CSPACE_K : case CUPS_CSPACE_WHITE : case CUPS_CSPACE_GOLD : case CUPS_CSPACE_SILVER : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_k(&header_, line, cptr, pptr); break; case CUPS_CSPACE_CMY : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_cmy(&header_, line, cptr, pptr); break; case CUPS_CSPACE_YMC : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_ymc(&header_, line, cptr, pptr); break; case CUPS_CSPACE_KCMYcm : if (header_.cupsBitsPerColor == 1) { convert_kcmycm(&header_, line, cptr, pptr); break; } case CUPS_CSPACE_KCMY : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_kcmy(&header_, line, cptr, pptr); break; case CUPS_CSPACE_CMYK : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_cmyk(&header_, line, cptr, pptr); break; case CUPS_CSPACE_YMCK : case CUPS_CSPACE_GMCK : case CUPS_CSPACE_GMCS : if (header_.cupsBitsPerColor >= 8) convert_device(&header_, line, cptr, pptr, device_colors_); else convert_ymck(&header_, line, cptr, pptr); break; case CUPS_CSPACE_CIEXYZ : convert_xyz(&header_, line, cptr, pptr); break; case CUPS_CSPACE_CIELab : case CUPS_CSPACE_ICC1 : case CUPS_CSPACE_ICC2 : case CUPS_CSPACE_ICC3 : case CUPS_CSPACE_ICC4 : case CUPS_CSPACE_ICC5 : case CUPS_CSPACE_ICC6 : case CUPS_CSPACE_ICC7 : case CUPS_CSPACE_ICC8 : case CUPS_CSPACE_ICC9 : case CUPS_CSPACE_ICCA : case CUPS_CSPACE_ICCB : case CUPS_CSPACE_ICCC : case CUPS_CSPACE_ICCD : case CUPS_CSPACE_ICCE : case CUPS_CSPACE_ICCF : convert_lab(&header_, line, cptr, pptr); break; } } delete[] line; // Mark the page for redisplay... redraw(); // Return successfully... return (1); } // // 'RasterDisplay::open_file()' - Open a raster file for viewing. // int // O - 1 on success, 0 on failure RasterDisplay::open_file( const char *filename) // I - File to open { cups_page_header2_t header; // Page header uchar *buffer = NULL; // Line buffer unsigned bufsize = 0; // Size of line buffer unsigned y; // Current line close_file(); if ((fp_ = gzopen(filename, "r")) == NULL) { fl_alert("Unable to open file: %s", strerror(errno)); return (0); } if ((ras_ = cupsRasterOpenIO((cups_raster_iocb_t)raster_cb, fp_, CUPS_RASTER_READ)) == NULL) { fl_alert("Unable to read raster file header."); gzclose(fp_); fp_ = NULL; return (0); } filename_ = strdup(filename); // Figure out the number of pages and their offsets... num_pages_ = 0; pages_[0] = gztell(fp_); while (cupsRasterReadHeader2(ras_, &header)) { num_pages_ ++; #ifdef DEBUG fprintf(stderr, "PAGE %d: %ux%ux%u @ %ld\n", num_pages_, header.cupsWidth, header.cupsHeight, header.cupsBitsPerPixel, (long)pages_[num_pages_ - 1]); #endif // DEBUG if (header.cupsBytesPerLine > bufsize) { bufsize = header.cupsBytesPerLine; buffer = (uchar *)realloc(buffer, bufsize); } for (y = header.cupsHeight; y > 0; y --) cupsRasterReadPixels(ras_, buffer, header.cupsBytesPerLine); if (num_pages_ >= RASTER_MAX_PAGES) break; pages_[num_pages_] = gztell(fp_) - rasterOffset(ras_); } gzseek(fp_, pages_[0], SEEK_SET); rasterReset(ras_); page_ = 0; return (load_page()); } // // 'RasterDisplay::page()' - Return the current page number. // int // O - Current page RasterDisplay::page(void) { return (page_); } /* * 'RasterDisplay::page()' - Set the current page number. */ void RasterDisplay::page(int number) // I - New page { if (number < 1) number = 1; else if (number > num_pages_) number = num_pages_; if (number == (page_ + 1)) this->load_page(); else if (number != page_) { gzseek(fp_, pages_[number - 1], SEEK_SET); rasterReset(ras_); page_ = number - 1; this->load_page(); } } // // 'RasterDisplay::position()' - Reposition the image on the screen. // void RasterDisplay::position(int X, // I - New X offset int Y) // I - New Y offset { int W, H; // Interior size W = w() - SBWIDTH; H = h() - SBWIDTH; if (X < 0) X = 0; else if (X > (xsize_ - W)) X = xsize_ - W; if (Y < 0) Y = 0; else if (Y > (ysize_ - H)) Y = ysize_ - H; xscrollbar_.value(X, W, 0, xsize_); yscrollbar_.value(Y, H, 0, ysize_); damage(FL_DAMAGE_SCROLL); } // // 'RasterDisplay::resize()' - Resize the raster display widget. // void RasterDisplay::resize(int X, // I - New X position int Y, // I - New Y position int W, // I - New width int H) // I - New height { Fl_Widget::resize(X, Y, W, H); xscrollbar_.resize(X, Y + H - SBWIDTH, W - SBWIDTH, SBWIDTH); yscrollbar_.resize(X + W - SBWIDTH, Y, SBWIDTH, H - SBWIDTH); W -= Fl::box_dw(box()) + SBWIDTH; H -= Fl::box_dh(box()) + SBWIDTH; if (factor_ == 0.0f && header_.cupsWidth && header_.cupsHeight) { xsize_ = W; if (xsize_ > (int)(header_.cupsWidth * 4)) xsize_ = header_.cupsWidth * 4; ysize_ = xsize_ * header_.cupsHeight / header_.cupsWidth; if (ysize_ > H) { ysize_ = H; if (ysize_ > (int)(header_.cupsHeight * 4)) ysize_ = header_.cupsHeight * 4; xsize_ = ysize_ * header_.cupsWidth / header_.cupsHeight; } } update_scrollbars(); redraw(); } // // 'RasterDisplay::save_colors()' - Save device colors. // void RasterDisplay::save_colors() { int i; // Looping var char key[256], // Key string value[256]; // Value if (!is_subtractive() || header_.cupsBitsPerColor < 8) return; if (!prefs) prefs = new Fl_Preferences(Fl_Preferences::USER, "msweet.org", "rasterview"); for (i = 0; i < header_.cupsNumColors; i ++) { snprintf(key, sizeof(key), "cs%dc%d", header_.cupsColorSpace, i); snprintf(value, sizeof(value), "%d %d %d", device_colors_[i][0], device_colors_[i][1], device_colors_[i][2]); prefs->set(key, value); } prefs->flush(); } // // 'RasterDisplay::scale()' - Scale the image. // void RasterDisplay::scale(float factor) // I - Scaling factor (0 = auto) { int X, Y, W, H; // Interior of widget float ratio; // Scaling ratio if (factor > 10.0f) factor = 10.0f; // Make sure that the image doesn't get scaled to nothin'... if (header_.cupsWidth && header_.cupsHeight) { if (factor > 0.0f && (header_.cupsWidth * factor) < 32.0f && header_.cupsWidth > 32) factor = 32.0f / header_.cupsWidth; if (factor > 0.0f && (header_.cupsHeight * factor) < 32.0f && header_.cupsHeight > 32) factor = 32.0f / header_.cupsHeight; } if (factor_ == 0.0f) ratio = 0.0f; else ratio = factor / factor_; factor_ = factor; redraw(); if (!header_.cupsWidth || !header_.cupsHeight) return; W = w() - SBWIDTH - Fl::box_dw(box()); H = h() - SBWIDTH - Fl::box_dh(box()); if (factor_ == 0.0f) { xsize_ = W; if (xsize_ > (int)(header_.cupsWidth * 4)) xsize_ = header_.cupsWidth * 4; ysize_ = xsize_ * header_.cupsHeight / header_.cupsWidth; if (ysize_ > H) { ysize_ = H; if (ysize_ > (int)(header_.cupsHeight * 4)) ysize_ = header_.cupsHeight * 4; xsize_ = ysize_ * header_.cupsWidth / header_.cupsHeight; } X = 0; Y = 0; } else { xsize_ = (int)((float)header_.cupsWidth * factor_ + 0.5f); ysize_ = (int)((float)header_.cupsHeight * factor_ + 0.5f); if (xsize_ <= W) { // The image will be centered... X = 0; } else if (ratio == 0.0) { // Previous zoom was auto-fit, center it... X = (xsize_ - W) / 2; } else { // Try to center on the previous location... X = (int)((xscrollbar_.value() + W / 2) * ratio) - W / 2; } if (ysize_ <= H) { // The image will be centered... Y = 0; } else if (ratio == 0.0) { // Previous zoom was auto-fit, center it... Y = (ysize_ - H) / 2; } else { // Try to center on the previous location... Y = (int)((yscrollbar_.value() + H / 2) * ratio) - H / 2; } } // Update the scrollbars... if (X < 0) X = 0; else if (X > (xsize_ - W)) X = xsize_ - W; xscrollbar_.value(X, W, 0, xsize_); if (xsize_ <= W) xscrollbar_.deactivate(); else xscrollbar_.activate(); if (Y < 0) Y = 0; else if (Y > (ysize_ - H)) Y = ysize_ - H; yscrollbar_.value(Y, H, 0, ysize_); if (ysize_ <= H) yscrollbar_.deactivate(); else yscrollbar_.activate(); } // // 'RasterDisplay::scrollbar_cb()' - Update the display based on the scrollbar position. // void RasterDisplay::scrollbar_cb( Fl_Widget *w, // I - Widget void *d) // I - Raster display widget { RasterDisplay *img = (RasterDisplay *)d; img->damage(FL_DAMAGE_SCROLL); } // // 'RasterDisplay::update_mouse_xy()' - Update the mouse X and Y values. // void RasterDisplay::update_mouse_xy() { int X, Y; // X,Y position int W, H; // Width and height X = Fl::event_x() - x() - Fl::box_dx(box()); Y = Fl::event_y() - y() - Fl::box_dy(box()); W = w() - SBWIDTH - Fl::box_dw(box()); H = h() - SBWIDTH - Fl::box_dh(box()); if (!ras_ || xsize_ <= 0 || ysize_ <= 0) { mouse_x_ = -1; mouse_y_ = -1; } if (xsize_ < W) { X -= (W - xsize_) / 2; if (X < 0) mouse_x_ = 0; else if (X >= xsize_) mouse_x_ = header_.cupsWidth; else mouse_x_ = X * header_.cupsWidth / xsize_; } else mouse_x_ = (xscrollbar_.value() + X) * header_.cupsWidth / xsize_; if (ysize_ < H) { Y -= (H - ysize_) / 2; if (Y < 0) mouse_y_ = 0; else if (Y >= ysize_) mouse_y_ = header_.cupsHeight; else mouse_y_ = Y * header_.cupsHeight / ysize_; } else mouse_y_ = (yscrollbar_.value() + Y) * header_.cupsHeight / ysize_; if (mouse_x_ < 0) mouse_x_ = 0; else if (mouse_x_ > (int)header_.cupsWidth) mouse_x_ = header_.cupsWidth; if (mouse_y_ < 0) mouse_y_ = 0; else if (mouse_y_ > (int)header_.cupsHeight) mouse_y_ = header_.cupsHeight; // printf("xscrollbar_=%d, yscrollbar_=%d\n", xscrollbar_.value(), // yscrollbar_.value()); // printf("mouse_x_=%d, mouse_y_=%d\n", mouse_x_, mouse_y_); } // // 'RasterDisplay::update_scrollbars()' - Update the scrollbars. // void RasterDisplay::update_scrollbars() { int X, Y; // X/Y offsets int W, H; // Interior size if (header_.cupsWidth && header_.cupsHeight) { W = w() - SBWIDTH - Fl::box_dw(box()); H = h() - SBWIDTH - Fl::box_dh(box()); X = xscrollbar_.value(); if (X > (xsize_ - W)) X = xsize_ - W; else if (X < 0) X = 0; xscrollbar_.value(X, W, 0, xsize_); if (xsize_ <= W) xscrollbar_.deactivate(); else xscrollbar_.activate(); Y = yscrollbar_.value(); if (Y > (ysize_ - H)) Y = ysize_ - H; else if (Y < 0) Y = 0; yscrollbar_.value(Y, H, 0, ysize_); if (ysize_ <= H) yscrollbar_.deactivate(); else yscrollbar_.activate(); } else { xscrollbar_.value(0, 1, 0, 1); yscrollbar_.value(0, 1, 0, 1); } } // // 'convert_cmy()' - Convert CMY or YMC raster data. // static void convert_cmy( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer bit; // Current bit w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x40) pixels[0] = 0; if (bit & 0x20) pixels[1] = 0; if (bit & 0x10) pixels[2] = 0; if (x > 1) { *colors++ = bit & 15; if (bit & 0x04) pixels[3] = 0; if (bit & 0x02) pixels[4] = 0; if (bit & 0x01) pixels[5] = 0; } } break; case 2 : for (x = w; x > 0; x --) { bit = *line++; *colors++ = bit; *pixels++ = 255 - 85 * ((bit & 0x30) >> 4); *pixels++ = 255 - 85 * ((bit & 0x0c) >> 2); *pixels++ = 255 - 85 * (bit & 0x03); } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; *pixels++ = 255 - 17 * (bit & 0x0f); *colors++ = bit = *line++; *pixels++ = 255 - 17 * ((bit & 0xf0) >> 4); *pixels++ = 255 - 17 * (bit & 0x0f); } break; case 8 : for (x = w; x > 0; x --) { *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = val = *line++; *pixels++ = 255 - val; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --) { *colors++ = *line++; *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = *line++; *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = *line++; *colors++ = val = *line++; *pixels++ = 255 - val; } } else { for (x = w; x > 0; x --) { *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = *line++; *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = *line++; *colors++ = val = *line++; *pixels++ = 255 - val; *colors++ = *line++; } } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; cptr = line; mptr = line + bytespercolor; yptr = line + 2 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*cptr & bit) { *colors++ = 1; pixels[0] = 0; } else colors ++; if (*mptr & bit) { *colors++ = 1; pixels[1] = 0; } else colors ++; if (*yptr & bit) { *colors++ = 1; pixels[2] = 0; } else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { case 0 : *colors++ = val = (*cptr & 0xc0) >> 6; *pixels++ = 255 - 85 * val; *colors++ = val = (*mptr & 0xc0) >> 6; *pixels++ = 255 - 85 * val; *colors++ = val = (*yptr & 0xc0) >> 6; *pixels++ = 255 - 85 * val; break; case 1 : *colors++ = val = (*cptr & 0x30) >> 4; *pixels++ = 255 - 85 * val; *colors++ = val = (*mptr & 0x30) >> 4; *pixels++ = 255 - 85 * val; *colors++ = val = (*yptr & 0x30) >> 4; *pixels++ = 255 - 85 * val; break; case 2 : *colors++ = val = (*cptr & 0x0c) >> 2; *pixels++ = 255 - 85 * val; *colors++ = val = (*mptr & 0x0c) >> 2; *pixels++ = 255 - 85 * val; *colors++ = val = (*yptr & 0x0c) >> 2; *pixels++ = 255 - 85 * val; break; case 3 : *colors++ = val = *cptr & 0x03; *pixels++ = 255 - 85 * val; *colors++ = val = *mptr & 0x03; *pixels++ = 255 - 85 * val; *colors++ = val = *yptr & 0x03; *pixels++ = 255 - 85 * val; cptr ++; mptr ++; yptr ++; break; } } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { case 0 : *colors++ = val = (*cptr & 0xf0) >> 4; *pixels++ = 255 - 17 * val; *colors++ = val = (*mptr & 0xf0) >> 4; *pixels++ = 255 - 17 * val; *colors++ = val = (*yptr & 0xf0) >> 4; *pixels++ = 255 - 17 * val; break; case 1 : *colors++ = val = *cptr & 0x0f; *pixels++ = 255 - 17 * val; *colors++ = val = *mptr & 0x0f; *pixels++ = 255 - 17 * val; *colors++ = val = *yptr & 0x0f; *pixels++ = 255 - 17 * val; cptr ++; mptr ++; yptr ++; break; } } break; case 8 : for (x = w; x > 0; x --) { *colors++ = val = *cptr++; *pixels++ = 255 - val; *colors++ = val = *mptr++; *pixels++ = 255 - val; *colors++ = val = *yptr++; *pixels++ = 255 - val; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --) { *colors++ = *cptr++; *colors++ = val = *cptr++; *pixels++ = 255 - val; *colors++ = *mptr++; *colors++ = val = *mptr++; *pixels++ = 255 - val; *colors++ = *yptr++; *colors++ = val = *yptr++; *pixels++ = 255 - val; } } else { for (x = w; x > 0; x --) { *colors++ = val = *cptr++; *pixels++ = 255 - val; *colors++ = *cptr++; *colors++ = val = *mptr++; *pixels++ = 255 - val; *colors++ = *mptr++; *colors++ = val = *yptr++; *pixels++ = 255 - val; *colors++ = *yptr++; } } break; } } } // // 'convert_cmyk()' - Convert CMYK raster data. // static void convert_cmyk( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer *kptr, // Black pointer bit; // Current bit int r, g, b, k; // Current RGB color + K w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x10) { pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { if (bit & 0x80) pixels[0] = 0; if (bit & 0x40) pixels[1] = 0; if (bit & 0x20) pixels[2] = 0; } if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x01) { pixels[3] = 0; pixels[4] = 0; pixels[5] = 0; } else { if (bit & 0x08) pixels[3] = 0; if (bit & 0x04) pixels[4] = 0; if (bit & 0x02) pixels[5] = 0; } } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; k = 85 * (bit & 0x03); r = 255 - 85 * ((bit & 0xc0) >> 6) - k; g = 255 - 85 * ((bit & 0x30) >> 4) - k; b = 255 - 85 * ((bit & 0x0c) >> 2) - k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; r = 255 - 17 * ((bit & 0xf0) >> 4); g = 255 - 17 * (bit & 0x0f); *colors++ = bit = *line++; b = 255 - 17 * ((bit & 0xf0) >> 4); k = 17 * (bit & 0x0f); r -= k; g -= k; b -= k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = val = *line++; r = 255 - val; *colors++ = val = *line++; g = 255 - val; *colors++ = val = *line++; b = 255 - val; *colors++ = k = *line++; r -= k; g -= k; b -= k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *line++; *colors++ = val = *line++; r = 255 - val; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val; *colors++ = *line++; *colors++ = val = *line++; b = 255 - val; *colors++ = *line++; *colors++ = k = *line++; } else { *colors++ = val = *line++; r = 255 - val; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val; *colors++ = *line++; *colors++ = val = *line++; b = 255 - val; *colors++ = *line++; *colors++ = k = *line++; *colors++ = *line++; } r -= k; g -= k; b -= k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; cptr = line; mptr = line + bytespercolor; yptr = line + 2 * bytespercolor; kptr = line + 3 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*cptr & bit) *colors++ = 1; else colors ++; if (*mptr & bit) *colors++ = 1; else colors ++; if (*yptr & bit) *colors++ = 1; else colors ++; if (*kptr & bit) { *colors++ = 1; pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { colors ++; if (*cptr & bit) pixels[0] = 0; if (*mptr & bit) pixels[1] = 0; if (*yptr & bit) pixels[2] = 0; } if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; kptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { default : case 0 : val = (*kptr & 0xc0) >> 6; k = 85 * val; *colors++ = val = (*cptr & 0xc0) >> 6; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0xc0) >> 6; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0xc0) >> 6; b = 255 - 85 * val - k; *colors++ = val; break; case 1 : val = (*kptr & 0x30) >> 4; k = 85 * val; *colors++ = val = (*cptr & 0x30) >> 4; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x30) >> 4; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0x30) >> 4; b = 255 - 85 * val - k; *colors++ = val; break; case 2 : val = (*kptr & 0x0c) >> 2; k = 85 * val; *colors++ = val = (*cptr & 0x0c) >> 2; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x0c) >> 2; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0x0c) >> 2; b = 255 - 85 * val - k; *colors++ = val; break; case 3 : val = *kptr & 0x03; k = 85 * val; *colors++ = val = *cptr & 0x03; r = 255 - 85 * val - k; *colors++ = val = *mptr & 0x03; g = 255 - 85 * val - k; *colors++ = val = *yptr & 0x03; b = 255 - 85 * val - k; *colors++ = val; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { default : case 0 : val = (*kptr & 0xf0) >> 4; k = 17 * val; *colors++ = val = (*cptr & 0xf0) >> 4; r = 255 - 17 * val - k; *colors++ = val = (*mptr & 0xf0) >> 4; g = 255 - 17 * val - k; *colors++ = val = (*yptr & 0xf0) >> 4; b = 255 - 17 * val - k; *colors++ = val; break; case 1 : val = *kptr & 0x0f; k = 17 * val; *colors++ = val = *cptr & 0x0f; r = 255 - 17 * val - k; *colors++ = val = *mptr & 0x0f; g = 255 - 17 * val - k; *colors++ = val = *yptr & 0x0f; b = 255 - 17 * val - k; *colors++ = val; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { k = *kptr++; *colors++ = val = *cptr++; r = 255 - val - k; *colors++ = val = *mptr++; g = 255 - val - k; *colors++ = val = *yptr++; b = 255 - val - k; *colors++ = k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *cptr++; *colors++ = val = *cptr++; r = 255 - val; *colors++ = *mptr++; *colors++ = val = *mptr++; g = 255 - val; *colors++ = *yptr++; *colors++ = val = *yptr++; b = 255 - val; *colors++ = *kptr++; *colors++ = k = *kptr++; } else { *colors++ = val = *cptr++; r = 255 - val; *colors++ = *cptr++; *colors++ = val = *mptr++; g = 255 - val; *colors++ = *mptr++; *colors++ = val = *yptr++; b = 255 - val; *colors++ = *yptr++; *colors++ = k = *kptr++; *colors++ = *kptr++; } r -= k; g -= k; b -= k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } } // // 'convert_device()' - Convert Device-N raster data. // static void convert_device( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels, // O - RGB pixels uchar device_colors[][3]) // I - RGB values for each device color { int x, // X position in line z, // Color w, // Width of line val; // Pixel value int r, g, b; // Current RGB color w = header->cupsWidth; if (header->cupsColorOrder != CUPS_ORDER_CHUNKED) { fputs("Error: Unsupported color order for Device-N...\n", stderr); return; } if (header->cupsBitsPerColor != 8 && header->cupsBitsPerColor != 16) { fputs("Error: Unsupported bit depth for Device-N...\n", stderr); return; } switch (header->cupsBitsPerColor) { case 8 : for (x = w; x > 0; x --) { r = g = b = 255; for (z = 0; z < header->cupsNumColors; z ++) { *colors++ = val = *line++; r -= val * device_colors[z][0] / 255; g -= val * device_colors[z][1] / 255; b -= val * device_colors[z][2] / 255; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { r = g = b = 255; for (z = 0; z < header->cupsNumColors; z ++) { if (endian_offset) { *colors++ = *line++; *colors++ = val = *line++; } else { *colors++ = val = *line++; *colors++ = *line++; } r -= val * device_colors[z][0] / 255; g -= val * device_colors[z][1] / 255; b -= val * device_colors[z][2] / 255; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } // // 'convert_k()' - Convert black raster data. // static void convert_k( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - Grayscale pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar bit, // Current bit byte; // Current byte w = header->cupsWidth; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80, byte = *line++; x > 0; x --) { if (byte & bit) { *colors++ = 1; *pixels++ = 0; } else { colors ++; pixels ++; } if (bit > 1) bit >>= 1; else { bit = 0x80; byte = *line++; } } break; case 2 : for (x = w; x > 0; x -= 4) { byte = *line++; *colors++ = val = (byte & 0xc0) >> 6; *pixels++ = ~(85 * val); if (x > 1) { *colors++ = val = (byte & 0x30) >> 4; *pixels++ = ~(85 * val); } if (x > 2) { *colors++ = val = (byte & 0x0c) >> 2; *pixels++ = ~(85 * val); } if (x > 3) { *colors++ = val = byte & 0x03; *pixels++ = ~(85 * val); } } break; case 4 : for (x = w; x > 0; x -= 2) { byte = *line++; *colors++ = val = (byte & 0xf0) >> 4; *pixels++ = ~(17 * val); *colors++ = val = byte & 0x0f; *pixels++ = ~(17 * val); } break; case 8 : for (x = w; x > 0; x --) { *colors++ = val = *line++; *pixels++ = ~val; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --) { *colors++ = *line++; *colors++ = val = *line++; *pixels++ = ~val; } } else { for (x = w; x > 0; x --) { *colors++ = val = *line++; *pixels++ = ~val; *colors++ = *line++; } } break; } } // // 'convert_kcmy()' - Convert KCMY or KCMYcm (8-bit) raster data. // static void convert_kcmy( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer *kptr, // Black pointer bit; // Current bit int r, g, b, k; // Current RGB color + K w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x80) { pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { if (bit & 0x40) pixels[0] = 0; if (bit & 0x20) pixels[1] = 0; if (bit & 0x10) pixels[2] = 0; } if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x08) { pixels[3] = 0; pixels[4] = 0; pixels[5] = 0; } else { if (bit & 0x04) pixels[3] = 0; if (bit & 0x02) pixels[4] = 0; if (bit & 0x01) pixels[5] = 0; } } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; k = 85 * ((bit & 0xc0) >> 6); r = 255 - 85 * ((bit & 0x30) >> 4) - k; g = 255 - 85 * ((bit & 0x0c) >> 2) - k; b = 255 - 85 * (bit & 0x03) - k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; k = 17 * ((bit & 0xf0) >> 4); r = 255 - 17 * (bit & 0x0f) - k; *colors++ = bit = *line++; g = 255 - 17 * ((bit & 0xf0) >> 4) - k; b = 255 - 17 * (bit & 0x0f) - k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = *line; k = *line++; *colors++ = *line; r = 255 - *line++ - k; *colors++ = *line; g = 255 - *line++ - k; *colors++ = *line; b = 255 - *line++ - k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *line++; *colors++ = k = *line++; *colors++ = *line++; *colors++ = val = *line++; r = 255 - val - k; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val - k; *colors++ = *line++; *colors++ = val = *line++; b = 255 - val - k; } else { *colors++ = k = *line++; *colors++ = *line++; *colors++ = val = *line++; r = 255 - val - k; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val - k; *colors++ = *line++; *colors++ = val = *line++; b = 255 - val - k; *colors++ = *line++; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; kptr = line; cptr = line + bytespercolor; mptr = line + 2 * bytespercolor; yptr = line + 3 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*kptr & bit) { *colors++ = 1; pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { colors ++; if (*cptr & bit) pixels[0] = 0; if (*mptr & bit) pixels[1] = 0; if (*yptr & bit) pixels[2] = 0; } if (*cptr & bit) *colors++ = 1; else colors ++; if (*mptr & bit) *colors++ = 1; else colors ++; if (*yptr & bit) *colors++ = 1; else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; kptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { default : case 0 : *colors++ = val = (*kptr & 0xc0) >> 6; k = 85 * val; *colors++ = val = (*cptr & 0xc0) >> 6; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0xc0) >> 6; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0xc0) >> 6; b = 255 - 85 * val - k; break; case 1 : *colors++ = val = (*kptr & 0x30) >> 4; k = 85 * val; *colors++ = val = (*cptr & 0x30) >> 4; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x30) >> 4; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0x30) >> 4; b = 255 - 85 * val - k; break; case 2 : *colors++ = val = (*kptr & 0x0c) >> 2; k = 85 * val; *colors++ = val = (*cptr & 0x0c) >> 2; r = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x0c) >> 2; g = 255 - 85 * val - k; *colors++ = val = (*yptr & 0x0c) >> 2; b = 255 - 85 * val - k; break; case 3 : *colors++ = val = *kptr & 0x03; k = 85 * val; *colors++ = val = *cptr & 0x03; r = 255 - 85 * val - k; *colors++ = val = *mptr & 0x03; g = 255 - 85 * val - k; *colors++ = val = *yptr & 0x03; b = 255 - 85 * val - k; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { default : case 0 : *colors++ = val = (*kptr & 0xf0) >> 4; k = 17 * val; *colors++ = val = (*cptr & 0xf0) >> 4; r = 255 - 17 * val - k; *colors++ = val = (*mptr & 0xf0) >> 4; g = 255 - 17 * val - k; *colors++ = val = (*yptr & 0xf0) >> 4; b = 255 - 17 * val - k; break; case 1 : *colors++ = val = *kptr & 0x0f; k = 17 * val; *colors++ = val = *cptr & 0x0f; r = 255 - 17 * val - k; *colors++ = val = *mptr & 0x0f; g = 255 - 17 * val - k; *colors++ = val = *yptr & 0x0f; b = 255 - 17 * val - k; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = k = *kptr++; *colors++ = val = *cptr++; r = 255 - val - k; *colors++ = val = *mptr++; g = 255 - val - k; *colors++ = val = *yptr++; b = 255 - val - k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *kptr++; *colors++ = k = *kptr++; *colors++ = *cptr++; *colors++ = val = *cptr++; r = 255 - val - k; *colors++ = *mptr++; *colors++ = val = *mptr++; g = 255 - val - k; *colors++ = *yptr++; *colors++ = val = *yptr++; b = 255 - val - k; } else { *colors++ = k = *kptr++; *colors++ = *kptr++; *colors++ = val = *cptr++; r = 255 - val - k; *colors++ = *cptr++; *colors++ = val = *mptr++; g = 255 - val - k; *colors++ = *mptr++; *colors++ = val = *yptr++; b = 255 - val - k; *colors++ = *yptr++; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } } // // 'convert_kcmycm()' - Convert KCMYcm (1-bit) raster data. // static void convert_kcmycm( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w; // Width of line uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer *kptr, // Black pointer *lcptr, // Light cyan pointer *lmptr, // Light magenta pointer bit; // Current bit int r, g, b; // Current RGB color w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky for (x = w; x > 0; x --) { bit = *line++; *colors++ = bit; if (bit & 0x20) { *pixels++ = 0; *pixels++ = 0; *pixels++ = 0; continue; } r = g = 255; if (bit & 0x10) r -= 255; if (bit & 0x08) g -= 255; if (bit & 0x02) r -= 127; if (bit & 0x01) g -= 127; if (bit & 0x04) b = 0; else b = 255; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; // Blue is always in range... *pixels++ = b; } } else { // Banded int bytespercolor = header->cupsBytesPerLine / 6; kptr = line; cptr = line + bytespercolor; mptr = line + 2 * bytespercolor; yptr = line + 3 * bytespercolor; lcptr = line + 4 * bytespercolor; lmptr = line + 5 * bytespercolor; for (x = w, bit = 0x80; x > 0; x --) { if (*kptr & bit) { *colors++ = 1; *pixels++ = 0; *pixels++ = 0; *pixels++ = 0; } else { colors ++; r = g = 255; if (*cptr & bit) r -= 255; if (*mptr & bit) g -= 255; if (*lcptr & bit) r -= 127; if (*lmptr & bit) g -= 127; if (*yptr & bit) b = 0; else b = 255; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; // Blue is always in range... *pixels++ = b; } if (*cptr & bit) *colors++ = 1; else colors ++; if (*mptr & bit) *colors++ = 1; else colors ++; if (*yptr & bit) *colors++ = 1; else colors ++; if (*lcptr & bit) *colors++ = 1; else colors ++; if (*lmptr & bit) *colors++ = 1; else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; kptr ++; lcptr ++; lmptr ++; } } } } // // 'convert_lab()' - Convert CIE Lab or ICCn raster data. // static void convert_lab( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value unsigned short *sline; // 16-bit pixels float lab[3], // Lab color p, // xyz[3], // XYZ color rgb[3]; // RGB color w = header->cupsWidth; for (x = w, sline = (unsigned short *)line; x > 0; x --) { // Extract the Lab color value... if (header->cupsBitsPerColor == 8) { // 8-bit color values... *colors++ = val = *line++; lab[0] = val / 2.55f; *colors++ = val = *line++; lab[1] = val - 128.0f; *colors++ = val = *line++; lab[2] = val - 128.0f; } else { // 16-bit color values... *colors++ = *line++; *colors++ = *line++; lab[0] = *sline++ / 655.35f; *colors++ = *line++; *colors++ = *line++; lab[1] = *sline++ / 256.0f - 128.0f; *colors++ = *line++; *colors++ = *line++; lab[2] = *sline++ / 256.0f - 128.0f; } // Convert Lab to XYZ... if (lab[0] < 8) p = lab[0] / 903.3; else p = (lab[0] + 16.0f) / 116.0f; xyz[0] = D65_X * pow(p + lab[1] * 0.002, 3.0); xyz[1] = D65_Y * pow((double)p, 3.0); xyz[2] = D65_Z * pow(p - lab[2] * 0.005, 3.0); // Convert XYZ to sRGB... rgb[0] = 3.240479f * xyz[0] - 1.537150f * xyz[1] - 0.498535f * xyz[2]; rgb[1] = -0.969256f * xyz[0] + 1.875992f * xyz[1] + 0.041556f * xyz[2]; rgb[2] = 0.055648f * xyz[0] - 0.204043f * xyz[1] + 1.057311f * xyz[2]; rgb[0] = rgb[0] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[0], 0.41666) - 0.055f; rgb[1] = rgb[1] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[1], 0.41666) - 0.055f; rgb[2] = rgb[2] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[2], 0.41666) - 0.055f; // Save it... if (rgb[0] <= 0.0f) *pixels++ = 0; else if (rgb[0] < 1.0f) *pixels++ = (int)(255.0f * rgb[0] + 0.5); else *pixels++ = 255; if (rgb[1] <= 0.0f) *pixels++ = 0; else if (rgb[1] < 1.0f) *pixels++ = (int)(255.0f * rgb[1] + 0.5); else *pixels++ = 255; if (rgb[2] <= 0.0f) *pixels++ = 0; else if (rgb[2] < 1.0f) *pixels++ = (int)(255.0f * rgb[2] + 0.5); else *pixels++ = 255; } } // // 'convert_rgb()' - Convert RGB raster data. // static void convert_rgb( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *rptr, // Red pointer *gptr, // Green pointer *bptr, // Blue pointer bit; // Current bit w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x40) pixels[0] = 255; if (bit & 0x20) pixels[1] = 255; if (bit & 0x10) pixels[2] = 255; if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x04) pixels[3] = 255; if (bit & 0x02) pixels[4] = 255; if (bit & 0x01) pixels[5] = 255; } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; *pixels++ = 85 * ((bit & 0x30) >> 4); *pixels++ = 85 * ((bit & 0x0c) >> 2); *pixels++ = 85 * (bit & 0x03); } break; case 4 : memset(pixels, 0, w * 3); for (x = w; x > 0; x --, pixels += 3) { bit = *line++; *colors++ = bit; if (bit & 0x0f) pixels[0] += 17 * (bit & 0x0f); bit = *line++; *colors++ = bit; if (bit & 0xf0) pixels[1] += 17 * ((bit & 0xf0) >> 4); if (bit & 0x0f) pixels[2] += 17 * (bit & 0x0f); } break; case 8 : memcpy(colors, line, w * 3); memcpy(pixels, line, w * 3); break; case 16 : if (endian_offset) *colors++ = *line++; for (x = w; x > 0; x --) { *colors++ = *pixels++ = *line++; *colors++ = *line++; *colors++ = *pixels++ = *line++; *colors++ = *line++; *colors++ = *pixels++ = *line++; if (!endian_offset || x > 1) *colors++ = *line++; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; rptr = line; gptr = line + bytespercolor; bptr = line + 2 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*rptr & bit) { *colors++ = 1; pixels[0] = 255; } else colors ++; if (*gptr & bit) { *colors++ = 1; pixels[1] = 255; } else colors ++; if (*bptr & bit) { *colors++ = 1; pixels[2] = 255; } else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; rptr ++; gptr ++; bptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { case 0 : *colors++ = val = (*rptr & 0xc0) >> 6; *pixels++ = 85 * val; *colors++ = val = (*gptr & 0xc0) >> 6; *pixels++ = 85 * val; *colors++ = val = (*bptr & 0xc0) >> 6; *pixels++ = 85 * val; break; case 1 : *colors++ = val = (*rptr & 0x30) >> 4; *pixels++ = 85 * val; *colors++ = val = (*gptr & 0x30) >> 4; *pixels++ = 85 * val; *colors++ = val = (*bptr & 0x30) >> 4; *pixels++ = 85 * val; break; case 2 : *colors++ = val = (*rptr & 0x0c) >> 2; *pixels++ = 85 * val; *colors++ = val = (*gptr & 0x0c) >> 2; *pixels++ = 85 * val; *colors++ = val = (*bptr & 0x0c) >> 2; *pixels++ = 85 * val; break; case 3 : *colors++ = val = *rptr & 0x03; *pixels++ = 85 * val; *colors++ = val = *gptr & 0x03; *pixels++ = 85 * val; *colors++ = val = *bptr & 0x03; *pixels++ = 85 * val; rptr ++; gptr ++; bptr ++; break; } } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { case 0 : *colors++ = val = (*rptr & 0xf0) >> 4; *pixels++ = 17 * val; *colors++ = val = (*gptr & 0xf0) >> 4; *pixels++ = 17 * val; *colors++ = val = (*bptr & 0xf0) >> 4; *pixels++ = 17 * val; break; case 1 : *colors++ = val = *rptr & 0x0f; *pixels++ = 17 * val; *colors++ = val = *gptr & 0x0f; *pixels++ = 17 * val; *colors++ = val = *bptr & 0x0f; *pixels++ = 17 * val; rptr ++; gptr ++; bptr ++; break; } } break; case 8 : for (x = w; x > 0; x --) { *colors++ = *pixels++ = *rptr++; *colors++ = *pixels++ = *gptr++; *colors++ = *pixels++ = *bptr++; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --) { *colors++ = *rptr++; *colors++ = *pixels++ = *rptr++; *colors++ = *gptr++; *colors++ = *pixels++ = *gptr++; *colors++ = *bptr++; *colors++ = *pixels++ = *bptr++; } } else { for (x = w; x > 0; x --) { *colors++ = *pixels++ = *rptr++; *colors++ = *rptr++; *colors++ = *pixels++ = *gptr++; *colors++ = *gptr++; *colors++ = *pixels++ = *bptr++; *colors++ = *bptr++; } } break; } } } // // 'convert_rgba()' - Convert RGBA raster data. // static void convert_rgba( cups_page_header2_t *header, // I - Raster header */ int y, // I - Raster Y position uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *rptr, // Red pointer *gptr, // Green pointer *bptr, // Blue pointer *aptr, // Alpha pointer bit; // Current bit int r, g, b, a; // Current color int bg; // Background to blend w = header->cupsWidth; y &= 128; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x10) { if (bit & 0x80) pixels[0] = 255; if (bit & 0x40) pixels[1] = 255; if (bit & 0x20) pixels[2] = 255; } else if ((x & 128) ^ y) { pixels[0] = 128; pixels[1] = 128; pixels[2] = 128; } else { pixels[0] = 192; pixels[1] = 192; pixels[2] = 192; } if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x01) { if (bit & 0x08) pixels[3] = 255; if (bit & 0x04) pixels[4] = 255; if (bit & 0x02) pixels[5] = 255; } else if (((x - 1) & 128) ^ y) { pixels[3] = 128; pixels[4] = 128; pixels[5] = 128; } else { pixels[3] = 192; pixels[4] = 192; pixels[5] = 192; } } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; r = 85 * ((bit & 0xc0) >> 6); g = 85 * ((bit & 0x30) >> 4); b = 85 * ((bit & 0x0c) >> 2); a = 85 * (bit & 0x03); if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; r = 17 * ((bit & 0xf0) >> 4); g = 17 * (bit & 0x0f); *colors++ = bit = *line++; b = 17 * ((bit & 0xf0) >> 4); a = 17 * (bit & 0x0f); if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = r = *line++; *colors++ = g = *line++; *colors++ = b = *line++; *colors++ = a = *line++; if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 16 : if (endian_offset) *colors++ = *line++; for (x = w; x > 0; x --) { *colors++ = r = *line++; *colors++ = *line++; *colors++ = g = *line++; *colors++ = *line++; *colors++ = b = *line++; *colors++ = *line++; *colors++ = a = *line++; if (!endian_offset || x > 1) *colors++ = *line++; if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; rptr = line; gptr = line + bytespercolor; bptr = line + 2 * bytespercolor; aptr = line + 3 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*rptr & bit) { *colors++ = 1; pixels[0] = 255; } else colors ++; if (*gptr & bit) { *colors++ = 1; pixels[1] = 255; } else colors ++; if (*bptr & bit) { *colors++ = 1; pixels[2] = 255; } else colors ++; if (*aptr & bit) *colors++ = 1; else { colors ++; if ((x & 128) ^ y) { pixels[0] = 128; pixels[1] = 128; pixels[2] = 128; } else { pixels[0] = 192; pixels[1] = 192; pixels[2] = 192; } } if (bit > 1) bit >>= 1; else { bit = 0x80; rptr ++; gptr ++; bptr ++; aptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { default : case 0 : *colors++ = val = (*rptr & 0xc0) >> 6; r = 85 * val; *colors++ = val = (*gptr & 0xc0) >> 6; g = 85 * val; *colors++ = val = (*bptr & 0xc0) >> 6; b = 85 * val; *colors++ = val = (*aptr & 0xc0) >> 6; a = 85 * val; break; case 1 : *colors++ = val = (*rptr & 0x30) >> 4; r = 85 * val; *colors++ = val = (*gptr & 0x30) >> 4; g = 85 * val; *colors++ = val = (*bptr & 0x30) >> 4; b = 85 * val; *colors++ = val = (*aptr & 0x30) >> 4; a = 85 * val; break; case 2 : *colors++ = val = (*rptr & 0x0c) >> 2; r = 85 * val; *colors++ = val = (*gptr & 0x0c) >> 2; g = 85 * val; *colors++ = val = (*bptr & 0x0c) >> 2; b = 85 * val; *colors++ = val = (*aptr & 0x0c) >> 2; a = 85 * val; break; case 3 : *colors++ = val = *rptr & 0x03; r = 85 * val; *colors++ = val = *gptr & 0x03; g = 85 * val; *colors++ = val = *bptr & 0x03; b = 85 * val; *colors++ = val = *aptr & 0x03; a = 85 * val; rptr ++; gptr ++; bptr ++; aptr ++; break; } if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { default : case 0 : *colors++ = val = (*rptr & 0xf0) >> 4; r = 17 * val; *colors++ = val = (*gptr & 0xf0) >> 4; g = 17 * val; *colors++ = val = (*bptr & 0xf0) >> 4; b = 17 * val; *colors++ = val = (*aptr & 0xf0) >> 4; a = 17 * val; break; case 1 : *colors++ = val = *rptr & 0x0f; r = 17 * val; *colors++ = val = *gptr & 0x0f; g = 17 * val; *colors++ = val = *bptr & 0x0f; b = 17 * val; *colors++ = val = *aptr & 0x0f; a = 17 * val; rptr ++; gptr ++; bptr ++; aptr ++; break; } if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = r = *rptr++; *colors++ = g = *gptr++; *colors++ = b = *bptr++; *colors++ = a = *aptr++; if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *rptr++; *colors++ = r = *rptr++; *colors++ = *gptr++; *colors++ = g = *gptr++; *colors++ = *bptr++; *colors++ = b = *bptr++; *colors++ = *aptr++; *colors++ = a = *aptr++; } else { *colors++ = r = *rptr++; *colors++ = *rptr++; *colors++ = g = *gptr++; *colors++ = *gptr++; *colors++ = b = *bptr++; *colors++ = *bptr++; *colors++ = a = *aptr++; *colors++ = *aptr++; } if (a < 255) { if ((x & 128) ^ y) bg = 128; else bg = 192; if (a == 0) r = g = b = bg; else { r = (a * r + (255 - a) * bg) / 255; g = (a * g + (255 - a) * bg) / 255; b = (a * b + (255 - a) * bg) / 255; } } *pixels++ = r; *pixels++ = g; *pixels++ = b; } break; } } } // // 'convert_rgbw()' - Convert RGBW raster data. // static void convert_rgbw( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *rptr, // Red pointer *gptr, // Green pointer *bptr, // Blue pointer *wptr, // White pointer bit; // Current bit int r, g, b, white; // Current RGBW color w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x10) { if (bit & 0x80) pixels[0] = 255; if (bit & 0x40) pixels[1] = 255; if (bit & 0x20) pixels[2] = 255; } if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x01) { if (bit & 0x08) pixels[3] = 255; if (bit & 0x04) pixels[4] = 255; if (bit & 0x02) pixels[5] = 255; } } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; white = 85 * (bit & 0x03) - 255; r = 85 * ((bit & 0xc0) >> 6) + white; g = 85 * ((bit & 0x30) >> 4) + white; b = 85 * ((bit & 0x0c) >> 2) + white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; r = 17 * ((bit & 0xf0) >> 4); g = 17 * (bit & 0x0f); *colors++ = bit = *line++; b = 17 * ((bit & 0xf0) >> 4); white = 17 * (bit & 0x0f) - 255; r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = r = *line++; *colors++ = g = *line++; *colors++ = b = *line++; *colors++ = val = *line++; white = val - 255; r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 16 : if (endian_offset) *colors++ = *line++; for (x = w; x > 0; x --) { *colors++ = r = *line++; *colors++ = *line++; *colors++ = g = *line++; *colors++ = *line++; *colors++ = b = *line++; *colors++ = *line++; *colors++ = val = *line++; white = val - 255; if (!endian_offset || x > 1) *colors++ = *line++; r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; rptr = line; gptr = line + bytespercolor; bptr = line + 2 * bytespercolor; wptr = line + 3 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : memset(pixels, 0, w * 3); for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*rptr & bit) *colors++ = 1; else colors ++; if (*gptr & bit) *colors++ = 1; else colors ++; if (*bptr & bit) *colors++ = 1; else colors ++; if (*wptr & bit) { *colors++ = 1; if (*rptr & bit) pixels[0] = 255; if (*gptr & bit) pixels[1] = 255; if (*bptr & bit) pixels[2] = 255; } else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; rptr ++; gptr ++; bptr ++; wptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { default : case 0 : *colors++ = val = (*rptr & 0xc0) >> 6; r = 85 * val; *colors++ = val = (*gptr & 0xc0) >> 6; g = 85 * val; *colors++ = val = (*bptr & 0xc0) >> 6; b = 85 * val; *colors++ = val = (*wptr & 0xc0) >> 6; white = 85 * val - 255; break; case 1 : *colors++ = val = (*rptr & 0x30) >> 4; r = 85 * val; *colors++ = val = (*gptr & 0x30) >> 4; g = 85 * val; *colors++ = val = (*bptr & 0x30) >> 4; b = 85 * val; *colors++ = val = (*wptr & 0x30) >> 4; white = 85 * val - 255; break; case 2 : *colors++ = val = (*rptr & 0x0c) >> 2; r = 85 * val; *colors++ = val = (*gptr & 0x0c) >> 2; g = 85 * val; *colors++ = val = (*bptr & 0x0c) >> 2; b = 85 * val; *colors++ = val = (*wptr & 0x0c) >> 2; white = 85 * val - 255; break; case 3 : *colors++ = val = *rptr & 0x03; r = 85 * val; *colors++ = val = *gptr & 0x03; g = 85 * val; *colors++ = val = *bptr & 0x03; b = 85 * val; *colors++ = val = *wptr & 0x03; white = 85 * val - 255; rptr ++; gptr ++; bptr ++; wptr ++; break; } r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { default : case 0 : *colors++ = val = (*rptr & 0xf0) >> 4; r = 17 * val; *colors++ = val = (*gptr & 0xf0) >> 4; g = 17 * val; *colors++ = val = (*bptr & 0xf0) >> 4; b = 17 * val; *colors++ = val = (*wptr & 0xf0) >> 4; white = 17 * val - 255; break; case 1 : *colors++ = val = *rptr & 0x0f; r = 17 * val; *colors++ = val = *gptr & 0x0f; g = 17 * val; *colors++ = val = *bptr & 0x0f; b = 17 * val; *colors++ = val = *wptr & 0x0f; white = 17 * val - 255; rptr ++; gptr ++; bptr ++; wptr ++; break; } r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = r = *rptr++; *colors++ = g = *gptr++; *colors++ = b = *bptr++; *colors++ = val = *wptr++; white = val - 255; r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *rptr++; *colors++ = r = *rptr++; *colors++ = *gptr++; *colors++ = g = *gptr++; *colors++ = *bptr++; *colors++ = b = *bptr++; *colors++ = *wptr++; *colors++ = val = *wptr++; white = val - 255; } else { *colors++ = r = *rptr++; *colors++ = *rptr++; *colors++ = g = *gptr++; *colors++ = *gptr++; *colors++ = b = *bptr++; *colors++ = *bptr++; *colors++ = val = *wptr++; white = val - 255; *colors++ = *wptr++; } r += white; g += white; b += white; if (r <= 0) *pixels++ = 0; else if (r < 255) *pixels++ = r; else *pixels++ = 255; if (g <= 0) *pixels++ = 0; else if (g < 255) *pixels++ = g; else *pixels++ = 255; if (b <= 0) *pixels++ = 0; else if (b < 255) *pixels++ = b; else *pixels++ = 255; } break; } } } // // 'convert_w()' - Convert grayscale raster data. // static void convert_w( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - Grayscale pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar bit, // Current bit byte; // Current byte w = header->cupsWidth; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80, byte = *line++; x > 0; x --) { if (byte & bit) { *colors++ = 1; pixels ++; } else { colors ++; *pixels++ = 0; } if (bit > 1) bit >>= 1; else { bit = 0x80; byte = *line++; } } break; case 2 : for (x = w; x > 0; x -= 4) { byte = *line++; *colors++ = val = (byte & 0xc0) >> 6; *pixels++ = 85 * val; if (x > 1) { *colors++ = val = (byte & 0x30) >> 4; *pixels++ = 85 * val; } if (x > 2) { *colors++ = val = (byte & 0x0c) >> 2; *pixels++ = 85 * val; } if (x > 3) { *colors++ = val = byte & 0x03; *pixels++ = 85 * val; } } break; case 4 : for (x = w; x > 0; x -= 2) { byte = *line++; *colors++ = val = (byte & 0xf0) >> 4; *pixels++ = 17 * val; if (x > 1) { *colors++ = val = byte & 0x0f; *pixels++ = 17 * val; } } break; case 8 : memcpy(colors, line, w); memcpy(pixels, line, w); break; case 16 : if (endian_offset) { for (x = w; x > 0; x --) { *colors++ = *line++; *colors++ = *pixels++ = *line++; } } else { for (x = w; x > 0; x --) { *colors++ = *pixels++ = *line++; *colors++ = *line++; } } break; } } // // 'convert_xyz()' - Convert CIE XYZ raster data. // static void convert_xyz( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value unsigned short *sline; // 16-bit pixels float xyz[3], // XYZ color rgb[3]; // RGB color w = header->cupsWidth; for (x = w, sline = (unsigned short *)line; x > 0; x --) { // Extract the Lab color value... if (header->cupsBitsPerColor == 8) { // 8-bit color values... *colors++ = val = *line++; xyz[0] = val / 231.8181f; *colors++ = val = *line++; xyz[1] = val / 231.8181f; *colors++ = val = *line++; xyz[2] = val / 231.8181f; } else { // 16-bit color values... *colors++ = *line++; *colors++ = *line++; *colors++ = *line++; *colors++ = *line++; *colors++ = *line++; *colors++ = *line++; xyz[0] = *sline++ / 59577.2727f; xyz[1] = *sline++ / 59577.2727f; xyz[2] = *sline++ / 59577.2727f; } // Convert XYZ to sRGB... rgb[0] = 3.240479f * xyz[0] - 1.537150f * xyz[1] - 0.498535f * xyz[2]; rgb[1] = -0.969256f * xyz[0] + 1.875992f * xyz[1] + 0.041556f * xyz[2]; rgb[2] = 0.055648f * xyz[0] - 0.204043f * xyz[1] + 1.057311f * xyz[2]; rgb[0] = rgb[0] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[0], 0.41666) - 0.055f; rgb[1] = rgb[1] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[1], 0.41666) - 0.055f; rgb[2] = rgb[2] <= 0.0 ? 0.0 : 1.055f * pow((double)rgb[2], 0.41666) - 0.055f; // Save it... if (rgb[0] <= 0.0f) *pixels++ = 0; else if (rgb[0] < 1.0f) *pixels++ = (int)(255.0f * rgb[0] + 0.5); else *pixels++ = 255; if (rgb[1] <= 0.0f) *pixels++ = 0; else if (rgb[1] < 1.0f) *pixels++ = (int)(255.0f * rgb[1] + 0.5); else *pixels++ = 255; if (rgb[2] <= 0.0f) *pixels++ = 0; else if (rgb[2] < 1.0f) *pixels++ = (int)(255.0f * rgb[2] + 0.5); else *pixels++ = 255; } } // // 'convert_ymc()' - Convert YMC raster data. // static void convert_ymc( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer bit; // Current bit w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x40) pixels[2] = 0; if (bit & 0x20) pixels[1] = 0; if (bit & 0x10) pixels[0] = 0; if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x04) pixels[5] = 0; if (bit & 0x02) pixels[4] = 0; if (bit & 0x01) pixels[3] = 0; } } break; case 2 : for (x = w; x > 0; x --, pixels += 3) { *colors++ = bit = *line++; pixels[2] = 255 - 85 * ((bit & 0x30) >> 4); pixels[1] = 255 - 85 * ((bit & 0x0c) >> 2); pixels[0] = 255 - 85 * (bit & 0x03); } break; case 4 : for (x = w; x > 0; x --, pixels += 3) { *colors++ = bit = *line++; pixels[2] = 255 - 17 * (bit & 0x0f); *colors++ = bit = *line++; pixels[1] = 255 - 17 * ((bit & 0xf0) >> 4); pixels[0] = 255 - 17 * (bit & 0x0f); } break; case 8 : for (x = w; x > 0; x --, pixels += 3) { *colors++ = val = *line++; pixels[2] = 255 - val; *colors++ = val = *line++; pixels[1] = 255 - val; *colors++ = val = *line++; pixels[0] = 255 - val; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --, pixels += 3) { *colors++ = *line++; *colors++ = val = *line++; pixels[2] = 255 - val; *colors++ = *line++; *colors++ = val = *line++; pixels[1] = 255 - val; *colors++ = *line++; *colors++ = val = *line++; pixels[0] = 255 - val; } } else { for (x = w; x > 0; x --, pixels += 3) { *colors++ = val = *line++; pixels[2] = 255 - val; *colors++ = *line++; *colors++ = val = *line++; pixels[1] = 255 - val; *colors++ = *line++; *colors++ = val = *line++; pixels[0] = 255 - val; *colors++ = *line++; } } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; yptr = line; mptr = line + bytespercolor; cptr = line + 2 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*yptr & bit) { *colors++ = 1; pixels[2] = 0; } else colors ++; if (*mptr & bit) { *colors++ = 1; pixels[1] = 0; } else colors ++; if (*cptr & bit) { *colors++ = 1; pixels[0] = 0; } else colors ++; if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; } } break; case 2 : for (x = 0; x < w; x ++, pixels += 3) { switch (x & 3) { case 0 : *colors++ = val = (*yptr & 0xc0) >> 6; pixels[2] = 255 - 85 * val; *colors++ = val = (*mptr & 0xc0) >> 6; pixels[1] = 255 - 85 * val; *colors++ = val = (*cptr & 0xc0) >> 6; pixels[0] = 255 - 85 * val; break; case 1 : *colors++ = val = (*yptr & 0x30) >> 4; pixels[2] = 255 - 85 * val; *colors++ = val = (*mptr & 0x30) >> 4; pixels[1] = 255 - 85 * val; *colors++ = val = (*cptr & 0x30) >> 4; pixels[0] = 255 - 85 * val; break; case 2 : *colors++ = val = (*yptr & 0x0c) >> 2; pixels[2] = 255 - 85 * val; *colors++ = val = (*mptr & 0x0c) >> 2; pixels[1] = 255 - 85 * val; *colors++ = val = (*cptr & 0x0c) >> 2; pixels[0] = 255 - 85 * val; break; case 3 : *colors++ = val = *yptr & 0x03; pixels[2] = 255 - 85 * val; *colors++ = val = *mptr & 0x03; pixels[1] = 255 - 85 * val; *colors++ = val = *cptr & 0x03; pixels[0] = 255 - 85 * val; cptr ++; mptr ++; yptr ++; break; } } break; case 4 : for (x = 0; x < w; x ++, pixels += 3) { switch (x & 1) { case 0 : *colors++ = val = (*yptr & 0xf0) >> 4; pixels[2] = 255 - 17 * val; *colors++ = val = (*mptr & 0xf0) >> 4; pixels[1] = 255 - 17 * val; *colors++ = val = (*cptr & 0xf0) >> 4; pixels[0] = 255 - 17 * val; break; case 1 : *colors++ = val = *yptr & 0x0f; pixels[2] = 255 - 17 * val; *colors++ = val = *mptr & 0x0f; pixels[1] = 255 - 17 * val; *colors++ = val = *cptr & 0x0f; pixels[0] = 255 - 17 * val; cptr ++; mptr ++; yptr ++; break; } } break; case 8 : for (x = w; x > 0; x --, pixels += 3) { *colors++ = val = *yptr++; pixels[2] = 255 - val; *colors++ = val = *mptr++; pixels[1] = 255 - val; *colors++ = val = *cptr++; pixels[0] = 255 - val; } break; case 16 : if (endian_offset) { for (x = w; x > 0; x --, pixels += 3) { *colors++ = *yptr++; *colors++ = val = *yptr++; pixels[2] = 255 - val; *colors++ = *mptr++; *colors++ = val = *mptr++; pixels[1] = 255 - val; *colors++ = *cptr++; *colors++ = val = *cptr++; pixels[0] = 255 - val; } } else { for (x = w; x > 0; x --, pixels += 3) { *colors++ = val = *yptr++; pixels[2] = 255 - val; *colors++ = *yptr++; *colors++ = val = *mptr++; pixels[1] = 255 - val; *colors++ = *mptr++; *colors++ = val = *cptr++; pixels[0] = 255 - val; *colors++ = *cptr++; } } break; } } } // // 'convert_ymck()' - Convert YMCK, GMCK, or GMCS raster data. // static void convert_ymck( cups_page_header2_t *header, // I - Raster header */ uchar *line, // I - Raster line uchar *colors, // O - Original pixels uchar *pixels) // O - RGB pixels { int x, // X position in line w, // Width of line val; // Pixel value uchar *cptr, // Cyan pointer *mptr, // Magenta pointer *yptr, // Yellow pointer *kptr, // Black pointer bit; // Current bit int r, g, b, k; // Current RGB color + K w = header->cupsWidth; if (header->cupsColorOrder == CUPS_ORDER_CHUNKED) { // Chunky switch (header->cupsBitsPerColor) { case 1 : for (x = w; x > 0; x -= 2, pixels += 6) { bit = *line++; *colors++ = bit >> 4; if (bit & 0x10) { pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { if (bit & 0x80) pixels[2] = 0; if (bit & 0x40) pixels[1] = 0; if (bit & 0x20) pixels[0] = 0; } if (x > 1) { *colors++ = bit & 0x0f; if (bit & 0x01) { pixels[3] = 0; pixels[4] = 0; pixels[5] = 0; } else { if (bit & 0x08) pixels[5] = 0; if (bit & 0x04) pixels[4] = 0; if (bit & 0x02) pixels[3] = 0; } } } break; case 2 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; k = 85 * (bit & 0x03); b = 255 - 85 * ((bit & 0xc0) >> 6) - k; g = 255 - 85 * ((bit & 0x30) >> 4) - k; r = 255 - 85 * ((bit & 0x0c) >> 2) - k; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; if (b < 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = w; x > 0; x --) { *colors++ = bit = *line++; b = 255 - 17 * ((bit & 0xf0) >> 4); g = 255 - 17 * (bit & 0x0f); *colors++ = bit = *line++; r = 255 - 17 * ((bit & 0xf0) >> 4); k = 17 * (bit & 0x0f); r -= k; g -= k; b -= k; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; if (b < 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { *colors++ = val = *line++; b = 255 - val; *colors++ = val = *line++; g = 255 - val; *colors++ = val = *line++; r = 255 - val; *colors++ = k = *line++; r -= k; g -= k; b -= k; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; if (b < 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *line++; *colors++ = val = *line++; b = 255 - val; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val; *colors++ = *line++; *colors++ = val = *line++; r = 255 - val; *colors++ = *line++; *colors++ = k = *line++; } else { *colors++ = val = *line++; b = 255 - val; *colors++ = *line++; *colors++ = val = *line++; g = 255 - val; *colors++ = *line++; *colors++ = val = *line++; r = 255 - val; *colors++ = *line++; *colors++ = k = *line++; *colors++ = *line++; } r -= k; g -= k; b -= k; if (r < 0) *pixels++ = 0; else *pixels++ = r; if (g < 0) *pixels++ = 0; else *pixels++ = g; if (b < 0) *pixels++ = 0; else *pixels++ = b; } break; } } else { // Banded int bytespercolor = (header->cupsBitsPerColor * header->cupsWidth + 7) / 8; yptr = line; mptr = line + bytespercolor; cptr = line + 2 * bytespercolor; kptr = line + 3 * bytespercolor; switch (header->cupsBitsPerColor) { case 1 : for (x = w, bit = 0x80; x > 0; x --, pixels += 3) { if (*yptr & bit) *colors++ = 1; else colors ++; if (*mptr & bit) *colors++ = 1; else colors ++; if (*cptr & bit) *colors++ = 1; else colors ++; if (*kptr & bit) { *colors++ = 1; pixels[0] = 0; pixels[1] = 0; pixels[2] = 0; } else { colors ++; if (*cptr & bit) pixels[0] = 0; if (*mptr & bit) pixels[1] = 0; if (*yptr & bit) pixels[2] = 0; } if (bit > 1) bit >>= 1; else { bit = 0x80; cptr ++; mptr ++; yptr ++; kptr ++; } } break; case 2 : for (x = 0; x < w; x ++) { switch (x & 3) { default : case 0 : val = (*kptr & 0xc0) >> 6; k = 85 * val; *colors++ = val = (*yptr & 0xc0) >> 6; b = 255 - 85 * val - k; *colors++ = val = (*mptr & 0xc0) >> 6; g = 255 - 85 * val - k; *colors++ = val = (*cptr & 0xc0) >> 6; r = 255 - 85 * val - k; *colors++ = val; break; case 1 : val = (*kptr & 0x30) >> 4; k = 85 * val; *colors++ = val = (*yptr & 0x30) >> 4; b = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x30) >> 4; g = 255 - 85 * val - k; *colors++ = val = (*cptr & 0x30) >> 4; r = 255 - 85 * val - k; *colors++ = val; break; case 2 : val = (*kptr & 0x0c) >> 2; k = 85 * val; *colors++ = val = (*yptr & 0x0c) >> 2; b = 255 - 85 * val - k; *colors++ = val = (*mptr & 0x0c) >> 2; g = 255 - 85 * val - k; *colors++ = val = (*cptr & 0x0c) >> 2; r = 255 - 85 * val - k; *colors++ = val; break; case 3 : val = *kptr & 0x03; k = 85 * val; *colors++ = val = *yptr & 0x03; b = 255 - 85 * val - k; *colors++ = val = *mptr & 0x03; g = 255 - 85 * val - k; *colors++ = val = *cptr & 0x03; r = 255 - 85 * val - k; *colors++ = val; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 4 : for (x = 0; x < w; x ++) { switch (x & 1) { default : case 0 : val = (*kptr & 0xf0) >> 4; k = 17 * val; *colors++ = val = (*yptr & 0xf0) >> 4; b = 255 - 17 * val - k; *colors++ = val = (*mptr & 0xf0) >> 4; g = 255 - 17 * val - k; *colors++ = val = (*cptr & 0xf0) >> 4; r = 255 - 17 * val - k; *colors++ = val; break; case 1 : val = *kptr & 0x0f; k = 17 * val; *colors++ = val = *yptr & 0x0f; b = 255 - 17 * val - k; *colors++ = val = *mptr & 0x0f; g = 255 - 17 * val - k; *colors++ = val = *cptr & 0x0f; r = 255 - 17 * val - k; *colors++ = val; cptr ++; mptr ++; yptr ++; kptr ++; break; } if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 8 : for (x = w; x > 0; x --) { k = *kptr++; *colors++ = val = *yptr++; b = 255 - val - k; *colors++ = val = *mptr++; g = 255 - val - k; *colors++ = val = *cptr++; r = 255 - val - k; *colors++ = k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; case 16 : for (x = w; x > 0; x --) { if (endian_offset) { *colors++ = *cptr++; *colors++ = val = *cptr++; r = 255 - val; *colors++ = *mptr++; *colors++ = val = *mptr++; g = 255 - val; *colors++ = *yptr++; *colors++ = val = *yptr++; b = 255 - val; *colors++ = *kptr++; *colors++ = k = *kptr++; } else { *colors++ = val = *cptr++; r = 255 - val; *colors++ = *cptr++; *colors++ = val = *mptr++; g = 255 - val; *colors++ = *mptr++; *colors++ = val = *yptr++; b = 255 - val; *colors++ = *yptr++; *colors++ = k = *kptr++; *colors++ = *kptr++; } r -= k; g -= k; b -= k; if (r <= 0) *pixels++ = 0; else *pixels++ = r; if (g <= 0) *pixels++ = 0; else *pixels++ = g; if (b <= 0) *pixels++ = 0; else *pixels++ = b; } break; } } } /* * 'raster_cb()' - Read data from a gzFile. */ static ssize_t /* O - Bytes read or -1 on error */ raster_cb(gzFile ctx, /* I - File pointer */ unsigned char *buffer, /* I - Buffer */ size_t length) /* I - Bytes to read */ { return ((ssize_t)gzread(ctx, buffer, (unsigned)length)); } RasterDisplay.h000066400000000000000000000066451407457743100140440ustar00rootroot00000000000000// // CUPS raster file display widget header file. // // Copyright 2002-2018 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // #ifndef RasterDisplay_h # define RasterDisplay_h // // Include necessary headers... // # include "raster.h" # include # include # include # include // Maximum pages # define RASTER_MAX_PAGES 1000 // // Display control modes... // enum { RASTER_MODE_PAN, RASTER_MODE_ZOOM_IN, RASTER_MODE_ZOOM_OUT, RASTER_MODE_CLICK }; // // RasterDisplay widget... // class RasterDisplay : public Fl_Group { cups_raster_t *ras_; // Raster stream const char *filename_; // Filename gzFile fp_; // File pointer int page_, // Current page number num_pages_; // Number of pages z_off_t pages_[RASTER_MAX_PAGES]; // Page offsets cups_page_header2_t header_; // Page header for current page int bpc_, // Bytes per color bpp_; // Bytes per pixel uchar *pixels_; // Pixel buffer long alloc_pixels_; // Number of bytes allocated uchar *colors_; // Color data buffer long alloc_colors_; // Numebr of colors allocated float factor_; // Zoom factor int xsize_; // Bresenheim variables int xstep_; // ... int xmod_; // ... int ysize_; // ... Fl_Scrollbar xscrollbar_; // Horizontal scrollbar Fl_Scrollbar yscrollbar_; // Vertical scrollbar int mode_; // Viewing mode int start_ex_, // Start position (mouse coords) start_ey_; int start_x_, // Start position (image coords) start_y_; int mouse_x_, // Current position (image coords) mouse_y_; int last_x_, // Previous position (image coords) last_y_; uchar device_colors_[15][3]; // CMY device colors static void image_cb(void *p, int X, int Y, int W, uchar *D); void load_colors(); void save_colors(); static void scrollbar_cb(Fl_Widget *w, void *d); void update_mouse_xy(); void update_scrollbars(); protected: void draw(); public: RasterDisplay(int X, int Y, int W, int H, const char *L = 0); ~RasterDisplay(); int bytes_per_color() const { return bpc_; } int bytes_per_pixel() const { return bpp_; } int close_file(); void device_color(int n, Fl_Color c) { uchar r,g,b; Fl::get_color(c, r, g, b); device_colors_[n][0] = 255-r; device_colors_[n][1] = 255-g; device_colors_[n][2] = 255-b; save_colors();} Fl_Color device_color(int n) { return (fl_rgb_color(255-device_colors_[n][0], 255-device_colors_[n][1], 255-device_colors_[n][2])); } uchar *get_color(int X, int Y); uchar *get_pixel(int X, int Y); int handle(int event); cups_page_header2_t *header() { return &header_; } int is_subtractive(); int load_page(); void mode(int m) { mode_ = m; } int mode() const { return mode_; } int mouse_x() const { return mouse_x_; } int mouse_y() const { return mouse_y_; } int num_pages() const { return num_pages_; } int page(void); void page(int number); void position(int X, int Y); void resize(int X, int Y, int W, int H); void scale(float factor); float scale() const { return factor_; } int start_x() const { return start_x_; } int start_y() const { return start_y_; } int open_file(const char *filename); int xposition() { return xscrollbar_.value(); } int yposition() { return yscrollbar_.value(); } }; #endif // !RasterDisplay_h RasterView.app/000077500000000000000000000000001407457743100137445ustar00rootroot00000000000000RasterView.app/Contents/000077500000000000000000000000001407457743100155415ustar00rootroot00000000000000RasterView.app/Contents/Info.plist000066400000000000000000000034321407457743100175130ustar00rootroot00000000000000 CFBundleInfoDictionaryVersion 6.0 CFBundleExecutable rasterview CFBundleIdentifier org.msweet.rasterview CFBundleVersion 1.8 CFBundleDevelopmentRegion English NSHumanReadableCopyright Copyright © 2002-2021 by Michael R Sweet CFAppleHelpAnchor help CFBundleName RasterView CFBundlePackageType APPL CFBundleSignature CUPS CFBundleIconFile rasterview.icns CFBundleShortVersionString 1.8 CFBundleGetInfoString 1.8, Copyright © 2002-2021 by Michael R Sweet CFBundleDocumentTypes CFBundleTypeExtensions apple apple.gz pwg pwg.gz ras ras.gz urf urf.gz CFBundleTypeIconFile rasterview.icns CFBundleTypeName CUPS Raster File CFBundleTypeOSTypes CUPR CFBundleTypeRole Editor RasterView.app/Contents/PkgInfo000066400000000000000000000000111407457743100170110ustar00rootroot00000000000000CUPSCUPR RasterView.app/Contents/Resources/000077500000000000000000000000001407457743100175135ustar00rootroot00000000000000RasterView.app/Contents/Resources/rasterview.icns000066400000000000000000003140701407457743100225710ustar00rootroot00000000000000icns8TOC pis32gs8mkil32l8mkic11ic12it32t8mk@ic08ic13ic098[ic148[ic10is32g@@&@&@s8mkbil32 && &&&&@@&&@@&&@@&&@@ && &&&&@@&&@@&&@@&&@@&&@@&&@@l8mkFFGG h~{OjqrrrrrrrrrrrrrrrrrrrrqjOic11PNG  IHDR szzsRGB pHYs%%IR$ciTXtXML:com.adobe.xmp Michael Sweet Copyright 2017 Michael Sweet New Icon New Icon VIDATX 1E;c,V5_e+aI,ͤY&Ѩ׾SA#xMz}iKEL1(rݧg+.Wp6 . ?ҏY玖POdTS((@iE$ O?"% .]8!(Ƀ]2c86Ft7Cy ywZU6ٙ kℋ^һu0! o+)/Jh8S0mVUau{c0oCIENDB`ic12PNG  IHDR@@iqsRGB pHYs%%IR$ciTXtXML:com.adobe.xmp Michael Sweet Copyright 2017 Michael Sweet New Icon New Icon VIDATxN13I*Td͊XQm*]wWD+AO Z*U/i8#`+"!iYLdf% *!7&@c5FW{#iHB>*KH{#d Ċr=˚>l@ 祈s pOךf_Odg^v!]>cy\pŠ$رp^r;saC$>}tW®@. L@B$P!|d}fOp  x؆'qg~ {M EJƠ Ї+鍈03<|)hSɥn_IENDB`it32&&&&&&&&&&&&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&&&&&&&&&&&&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@&@t8mk@ VəV !!,,"" ))ee   !! ''**,,................................................................................................................................................................................,,**'OO' !@@!  8kk8 .MM."@aa@"1OzzO1"=YY="+F__F+ 1JassaJ1  3J_nɈn_J3 1FYhq~ʧ~qhYF1 +=O]hotwyzz{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{{zzywtoh]O=+  "1@MW_ehkllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllkhe_WM@1" ".8AGLOPQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQPOLGA8." !'*-........................................................................................-*'! ic08݉PNG  IHDR\rfsRGB pHYs  ciTXtXML:com.adobe.xmp Michael Sweet Copyright 2017 Michael Sweet New Icon New Icon V IDATx۫$G&cb";_}ѿBI!x!"L#(Q$ѐu1A%7=ٚ鞙:ӟVOuu]>o\̱c$@ @ @ @v^yi)戫#8#'A`0#qg?#,>fwG)$L1{"~{##nxKYA#t!oetĵ$@`1G"T~Ĩ@Mv!)7&{E4zk{78mA`~D#؎WԻG\Fi8 XFx'upbsqrįW?1. A#>l/7`᫝/D6woi×"@ AҢ4)mJ+W5=$@ҤiXV:$ Pc8ox"\a{Z_@,)Q6Qi5nTiQy #з@@7v'#X X>!@@QiU7mi:<-2ym'G#H@Ui t6}PG' J69y)$ A! i@λN1tNrQĉ 0'bn Ff.D2zmv%@Yi׻zn]r. P5WڵL`.-5m(' Jr&~i&p* vmA4Cp IHdzo4wkHHҰBZ|Zfr}1 i7,4TR.cP9. A# fa<0 &`}f"7+y @5׹LB"`+gdR뤒+)O@`TR?DS}<2X@`u z+;[vwv[.[H{~W{nq#mB7w+XFez<@SmYy 3e@'Lm^]B /3g!0'~ J0%dNΎ+!0z藐 @`8 `8; `_B&0'~ J0%dNΎ+!0z藐 @`8 `8; `_B&}+VG~w[Ә}{:n}w[d8r:@=ŶK'{'~=^2Z3Sd0  `:kL!2$@`:053@FȐP CBCZ3Sd0  `:kL!2$@`:053@FȐP CBCZ3Sd0  `:kL!2$@`:053@Foΐ;h钢ޛ!;-yL@-P `(ǚ P %a@(G(ǚ P %a@(G(ǚ P %a@(G(ǚ P %a@(G(ǚ P %a@(G(ǚ P %a@(G(ǚ P %a@(G(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> Їo @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @6P@IDAT Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S &'@ @}H @ @M$ @! > @4hkr @ Ї@  @ T@)  @ @@}( @ @@S{Mg79S ݟj-B+Znw}䬻Dz vD< @ @@TS @ @$z @ @ PMI @zmGC @H4@5% @M@ @h p$@`ROL[Z[z @|pO~ή2Xl & @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I @8qJ @ @& @ @8K+!@ @4 @ @Hg/ @l Hlx@ @# p @ ) I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*=S<6 @.Xe5֣ussYYunTgitE?h}@ñ)u(oQ8Zc[ssc]\g{ 59s]]3^@ H`g]5;mjlwU17KMUk=2z{[K;vܬbZK8Aesnk~U5kTk_wwb_jߪi_i{Rzs9zn?U\w{C @1(H3&Sep,*qħ?ekmHiWxW^cJwgyB>}l}7ֻ^V^sSk.ntTi;nsj˽\H3mz^XeݔjC @Nnyَv[(~9c#U,SG|ֺ^unڗj])@>lӷ-jm^Ӑ=7U/=G1:wܪ3{~Jsjط=}v(ySub€ @C%ϳKfNvNTbu/t6lZ}ζTC9o? }@L߶?dR{YU\Ct> pf,}Q9U9˘*SkN3'[C1KFkA @`KgcTc۞S2ogpmiG묣fI5RžTut.= )\e>l^ Uu>4Uۧ/z<}ñm[}NҹY;yVmUCJ5#۱n @ <m4cݖhGpfLڞөN=p>}o nkl\T/7}۩ɳV|e@kz=U{ږ?zz%Zmidk9}b @Go{N3'{TOS잓S{3oqNWI|X@لPM`Ow[uvs|kOn;7tVvd;&оi+}e6 @~j\#1!&fNtQ>h[aM6n5> }T1] eLi^S5nmKvdk(gۍ~qs\/Z'snsk֙ @`;ghlF1Kz?vbSq}ٟrn۩=At#<ҷ=Ҍ_Y3ek_2Xf;?yK4kd{hCcI͡=C @Ը^:44mcO۵sszTo{u"O67F6FQ<}#kOfϛSU5m7x?zkfN::l@ l\1efNw<7>F9!۩ݖ5[4Z MG1s7j{~1Ivm4cg2 @ ,i:{M#۱n3QcT{e.Q.׻~Jl4c5'j@;1#U,Gfݹm[Uc{J#_CShU~}Lm_@ p)9U.tצ?su1#͘lg T BS#[1mvCxGTH2Դ.Gr 6 @Qcczo۩M7I\νTcۖj#mź:oٞS #include #include #include #include #include #include "eyedropper.xbm" #include "left.xbm" #include "list.xbm" #include "move.xbm" #include "right.xbm" #include "zoom-in.xbm" #include "zoom-out.xbm" // // Constants... // #ifdef __APPLE__ # define MENU_OFFSET 0 #else # define MENU_OFFSET 25 #endif // __APPLE__ #define ATTRS_WIDTH 310 #define DEVICEN_HEIGHT 30 #define HELP_HTML \ "\n" \ "\n" \ "RasterView Help\n" \ "\n" \ "\n" \ "

RasterView Help

\n" \ "

The Basics

\n" \ "

RasterView starts in zoom in mode (Z, " \ "which allows you to click on the page or drag a zoom box on the " \ "page to zoom in. You can also use pan mode " \ "(P) to drag/pan the page in the window, zoom " \ "out mode (SHIFT + Z) to click on the page to " \ "zoom out, or color viewing mode (C) to " \ "click or drag the mouse and view the raw colors on the page.

\n" \ "

Keyboard Shortcuts

\n" \ "
    \n" \ "
  • Spacebar: Show next page
  • \n" \ "
  • Backspace/Delete: Show previous page
  • \n" \ "
  • 0: Zoom to fit
  • \n" \ "
  • 1: Zoom 100%
  • \n" \ "
  • 2: Zoom 200%
  • \n" \ "
  • 3: Zoom 300%
  • \n" \ "
  • 4: Zoom 400%
  • \n" \ "
  • -: Zoom out
  • \n" \ "
  • =: Zoom in
  • \n" \ "
  • C: Click or drag mouse to view colors
  • \n" \ "
  • P: Drag mouse to pan
  • \n" \ "
  • Z: Click or drag mouse to zoom in
  • \n" \ "
  • SHIFT + Z: Click to zoom out
  • \n" \ "
  • CTRL/CMD + A: Show/hide the page attributes
  • \n" \ "
  • CTRL/CMD + O: Open a raster file
  • \n" \ "
  • CTRL/CMD + Q: Quit RasterView
  • \n" \ "
  • CTRL/CMD + R: Reload the raster file
  • \n" \ "
\n" \ "\n" \ "\n" // // Class globals... // RasterView *RasterView::first_ = 0; Fl_Help_Dialog *RasterView::help_ = 0; #ifdef __APPLE__ // // 'RasterView::apple_open_cb()' - Open a file. // void RasterView::apple_open_cb(const char *f)// I - File to open { # ifdef DEBUG fprintf(stderr, "Opening \"%s\" via Apple event.\n", f); # endif // DEBUG open_file(f); } #endif // __APPLE__ // // 'RasterView::attrs_cb()' - Toggle attributes. // void RasterView::attrs_cb(Fl_Widget *widget) // I - Button { RasterView *view; // I - Window view = (RasterView *)(widget->window()); if (view->attributes_->visible()) { view->attributes_->hide(); view->resize(view->x(), view->y(), view->w() - ATTRS_WIDTH, view->h()); } else { view->attributes_->show(); view->resize(view->x(), view->y(), view->w() + ATTRS_WIDTH, view->h()); } } // // 'RasterView::close_cb()' - Close this window. // void RasterView::close_cb(Fl_Widget *widget)// I - Menu or window { RasterView *view; // I - Window if (widget->window()) view = (RasterView *)(widget->window()); else view = (RasterView *)widget; if (view->loading_) return; view->hide(); view->display_->close_file(); view->set_filename(NULL); } // // 'RasterView::color_cb()' - Show the color at the current position. // void RasterView::color_cb( RasterDisplay *display) // O - Display widget { RasterView *view; // I - Window int i; // Looping var uchar *cpixel, // Current pixel value *ccolor; // Current pixel color char *ptr; // Pointer into label cups_page_header2_t *header; // Page header ccolor = display->get_color(display->mouse_x(), display->mouse_y()); cpixel = display->get_pixel(display->mouse_x(), display->mouse_y()); view = (RasterView *)(display->window()); header = display->header(); view->pixel_[sizeof(view->pixel_) - 1] = '\0'; if (!ccolor || !cpixel) strncpy(view->pixel_, " -/=/0/1/2/3/4 to zoom", sizeof(view->pixel_) - 1); else { strncpy(view->pixel_, " ", sizeof(view->pixel_) - 1); for (i = 0, ptr = view->pixel_ + 7; i < display->bytes_per_pixel(); i ++) { snprintf(ptr, sizeof(view->pixel_) - (size_t)(ptr - view->pixel_), " %d", *cpixel++); ptr += strlen(ptr); } strcpy(ptr, " :"); ptr += 2; int banding = (header->cupsBitsPerPixel + 7) / 8; char *hexptr = ptr + 1; for (i = 0; i < display->bytes_per_color(); i ++) { if ((i % banding) == 0) *ptr++ = ' '; snprintf(ptr, sizeof(view->pixel_) - (ptr - view->pixel_), "%02X", ccolor[i]); ptr += 2; } Fl::copy(hexptr, strlen(hexptr), 1); if (header->cupsColorSpace == CUPS_CSPACE_CIEXYZ) { float xyz[3]; /* XYZ value */ if (header->cupsBitsPerColor == 16) { unsigned short *c16 = (unsigned short *)ccolor; xyz[0] = c16[0] / 59577.2727f; xyz[1] = c16[1] / 59577.2727f; xyz[2] = c16[2] / 59577.2727f; } else { xyz[0] = ccolor[0] / 231.8181f; xyz[1] = ccolor[1] / 231.8181f; xyz[2] = ccolor[2] / 231.8181f; } snprintf(ptr, sizeof(view->pixel_) - (ptr - view->pixel_), " (%.3f %.3f %.3f)", xyz[0], xyz[1], xyz[2]); } else if (header->cupsColorSpace == CUPS_CSPACE_CIELab || header->cupsColorSpace >= CUPS_CSPACE_ICC1) { float lab[3]; /* Lab value */ if (header->cupsBitsPerColor == 16) { unsigned short *c16 = (unsigned short *)ccolor; lab[0] = c16[0] / 655.35f; lab[1] = c16[1] / 256.0f - 128.0f; lab[2] = c16[2] / 256.0f - 128.0f; } else { lab[0] = ccolor[0] / 2.55f; lab[1] = ccolor[1] - 128.0f; lab[2] = ccolor[2] - 128.0f; } snprintf(ptr, sizeof(view->pixel_) - (ptr - view->pixel_), " (%.3f %.3f %.3f)", lab[0], lab[1], lab[2]); } } view->status_->label(view->pixel_); } // // 'RasterView::device_cb()' - Handle device color changes. // void RasterView::device_cb( Fl_Widget *widget) // I - Widget { RasterView *view; // I - Window int i; // Looping var view = (RasterView *)(widget->window()); for (i = 0; i < 15; i ++) if (widget == view->colors_[i]) { uchar r, g, b; Fl::get_color(view->display_->device_color(i), r, g, b); if (fl_color_chooser(widget->label(), r, g, b)) { view->display_->device_color(i, fl_rgb_color(r, g, b)); reopen_cb(widget); } break; } } // // 'RasterView::goto_cb()' - Show the specified page. // void RasterView::goto_cb(Fl_Widget *widget) // I - Next button { RasterView *view; // I - Window view = (RasterView *)(widget->window()); if (view->loading_) return; Fl::focus(view->display_); view->loading_ = 1; view->display_->page(atoi(view->page_input_->value())); view->load_attrs(); view->loading_ = 0; } // // 'RasterView::handle()' - Handle global shortcuts... // int // O - 1 if handled, 0 otherwise RasterView::handle(int event) // I - Event { #ifdef __APPLE__ if (event == FL_SHORTCUT && Fl::event_key() == 'w' && Fl::event_state(FL_COMMAND)) { close_cb(this); return (1); } #endif // __APPLE__ return (Fl_Double_Window::handle(event)); } // // 'RasterView::help_cb()' - Show the on-line help. // void RasterView::help_cb() { if (!help_) { help_ = new Fl_Help_Dialog(); help_->value(HELP_HTML); } help_->show(); } // // 'RasterView::init()' - Initialize the window. // void RasterView::init() { Fl_Group *sub_group; static Fl_Menu_Item items[] = // Menu items { {"&File", 0, 0, 0, FL_SUBMENU }, {"&Open...", FL_COMMAND + 'o', (Fl_Callback *)open_cb }, {"&Re-open", FL_COMMAND + 'r', (Fl_Callback *)reopen_cb, }, {"&Close", FL_COMMAND + 'w', (Fl_Callback *)close_cb }, #ifndef __APPLE__ {"&Quit", FL_COMMAND + 'q', (Fl_Callback *)quit_cb }, #endif // !__APPLE__ {0}, {"&Help", 0, 0, 0, FL_SUBMENU }, {"&About RasterView...", 0, (Fl_Callback *)help_cb }, {0}, {0} }; static const char * const color_labels[] = { "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13", "14", "15" }; menubar_ = new Fl_Sys_Menu_Bar(0, 0, w(), 25); menubar_->menu(items); display_ = new RasterDisplay(0, MENU_OFFSET, w(), h() - MENU_OFFSET - 30); display_->callback((Fl_Callback *)color_cb); buttons_ = new Fl_Group(0, h() - 30, w(), 30); sub_group = new Fl_Group(0, h() - 30, 80, 30); prev_button_ = new Fl_Button(0, h() - 30, 25, 30); prev_button_->image(new Fl_Bitmap(left_bits, left_width, left_height)); prev_button_->box(FL_FLAT_BOX); prev_button_->tooltip("Show Previous Page"); prev_button_->callback((Fl_Callback *)prev_cb); prev_button_->deactivate(); prev_button_->shortcut(FL_BackSpace); page_input_ = new Fl_Int_Input(25, h() - 30, 30, 30); page_input_->callback((Fl_Callback *)goto_cb); page_input_->clear_visible_focus(); page_input_->when(FL_WHEN_RELEASE | FL_WHEN_ENTER_KEY); next_button_ = new Fl_Button(55, h() - 30, 25, 30); next_button_->image(new Fl_Bitmap(right_bits, right_width, right_height)); next_button_->box(FL_FLAT_BOX); next_button_->tooltip("Show Next Page"); next_button_->callback((Fl_Callback *)next_cb); next_button_->deactivate(); next_button_->shortcut(' '); sub_group->resizable(page_input_); sub_group->end(); status_ = new Fl_Box(80, h() - 30, w() - 250, 30, "-/=/0/1/2/3/4 to zoom"); status_->align((Fl_Align)(FL_ALIGN_CENTER | FL_ALIGN_INSIDE)); sub_group = new Fl_Group(w() - 170, h() - 30, 120, 30); zoom_in_button_ = new Fl_Button(w() - 170, h() - 30, 30, 30); zoom_in_button_->image(new Fl_Bitmap(zoom_in_bits, zoom_in_width, zoom_in_height)); zoom_in_button_->box(FL_FLAT_BOX); zoom_in_button_->tooltip("Click to Zoom"); zoom_in_button_->type(FL_RADIO_BUTTON); zoom_in_button_->selection_color(FL_BLACK); zoom_in_button_->value(1); zoom_in_button_->align((Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER)); zoom_in_button_->callback((Fl_Callback *)mode_cb); zoom_in_button_->shortcut('z'); zoom_out_button_ = new Fl_Button(w() - 140, h() - 30, 30, 30); zoom_out_button_->image(new Fl_Bitmap(zoom_out_bits, zoom_out_width, zoom_out_height)); zoom_out_button_->box(FL_FLAT_BOX); zoom_out_button_->tooltip("Click to Zoom"); zoom_out_button_->type(FL_RADIO_BUTTON); zoom_out_button_->selection_color(FL_BLACK); zoom_out_button_->align((Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER)); zoom_out_button_->callback((Fl_Callback *)mode_cb); zoom_out_button_->shortcut('Z'); pan_button_ = new Fl_Button(w() - 110, h() - 30, 30, 30); pan_button_->image(new Fl_Bitmap(move_bits, move_width, move_height)); pan_button_->box(FL_FLAT_BOX); pan_button_->tooltip("Click and Drag to Pan"); pan_button_->type(FL_RADIO_BUTTON); pan_button_->selection_color(FL_BLACK); pan_button_->align((Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER)); pan_button_->callback((Fl_Callback *)mode_cb); pan_button_->shortcut('p'); color_button_ = new Fl_Button(w() - 80, h() - 30, 30, 30); color_button_->image(new Fl_Bitmap(eyedropper_bits, eyedropper_width, eyedropper_height)); color_button_->box(FL_FLAT_BOX); color_button_->tooltip("Click to Show Color Values"); color_button_->type(FL_RADIO_BUTTON); color_button_->selection_color(FL_BLACK); color_button_->align((Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER)); color_button_->callback((Fl_Callback *)mode_cb); color_button_->shortcut('c'); sub_group->end(); attrs_button_ = new Fl_Button(w() - 30, h() - 30, 30, 30); attrs_button_->image(new Fl_Bitmap(list_bits, list_width, list_height)); attrs_button_->box(FL_FLAT_BOX); attrs_button_->tooltip("Hide/Show Page Attributes"); attrs_button_->type(FL_TOGGLE_BUTTON); attrs_button_->selection_color(FL_BLACK); attrs_button_->align((Fl_Align)(FL_ALIGN_INSIDE | FL_ALIGN_CENTER)); attrs_button_->callback((Fl_Callback *)attrs_cb); attrs_button_->shortcut(FL_COMMAND + 'a'); buttons_->resizable(status_); buttons_->end(); attributes_ = new Fl_Group(w(), 0, ATTRS_WIDTH, h()); header_ = new Fl_Text_Display(w(), 0, ATTRS_WIDTH, h() - DEVICEN_HEIGHT); header_buffer_ = new Fl_Text_Buffer(65536); header_->buffer(header_buffer_); header_->textfont(FL_COURIER); header_->textsize(12); header_->box(FL_DOWN_BOX); for (int i = 0; i < 15; i ++) { colors_[i] = new Fl_Button(w() + 5 + 20 * i, h() - DEVICEN_HEIGHT + 5, 20, 20, color_labels[i]); colors_[i]->callback(device_cb); } attributes_->resizable(header_); attributes_->end(); attributes_->hide(); end(); resizable(display_); callback((Fl_Callback *)close_cb, this); // Initialize the titlebar... filename_ = NULL; title_ = NULL; set_filename(NULL); // Add this window to the list of windows... #ifdef __APPLE__ if (!first_) fl_open_callback(apple_open_cb); #endif // __APPLE__ loading_ = 0; next_ = first_; first_ = this; Fl::focus(display_); } // // 'RasterView::load_attrs()' - Load attributes into the display. // void RasterView::load_attrs() { int i; // Looping var char s[1024]; // Line buffer cups_page_header2_t *header; // Header data static const char * const cspaces[] = // Colorspace strings { "CUPS_CSPACE_W", "CUPS_CSPACE_RGB", "CUPS_CSPACE_RGBA", "CUPS_CSPACE_K", "CUPS_CSPACE_CMY", "CUPS_CSPACE_YMC", "CUPS_CSPACE_CMYK", "CUPS_CSPACE_YMCK", "CUPS_CSPACE_KCMY", "CUPS_CSPACE_KCMYcm", "CUPS_CSPACE_GMCK", "CUPS_CSPACE_GMCS", "CUPS_CSPACE_WHITE", "CUPS_CSPACE_GOLD", "CUPS_CSPACE_SILVER", "CUPS_CSPACE_CIEXYZ", "CUPS_CSPACE_CIELab", "CUPS_CSPACE_RGBW", "CUPS_CSPACE_SW", "CUPS_CSPACE_SRGB", "CUPS_CSPACE_ADOBERGB", "UNKNOWN21", "UNKNOWN22", "UNKNOWN23", "UNKNOWN24", "UNKNOWN25", "UNKNOWN26", "UNKNOWN27", "UNKNOWN28", "UNKNOWN29", "UNKNOWN30", "UNKNOWN31", "CUPS_CSPACE_ICC1", "CUPS_CSPACE_ICC2", "CUPS_CSPACE_ICC3", "CUPS_CSPACE_ICC4", "CUPS_CSPACE_ICC5", "CUPS_CSPACE_ICC6", "CUPS_CSPACE_ICC7", "CUPS_CSPACE_ICC8", "CUPS_CSPACE_ICC9", "CUPS_CSPACE_ICCA", "CUPS_CSPACE_ICCB", "CUPS_CSPACE_ICCC", "CUPS_CSPACE_ICCD", "CUPS_CSPACE_ICCE", "CUPS_CSPACE_ICCF", "UNKNOWN47", "CUPS_CSPACE_DEVICE1", "CUPS_CSPACE_DEVICE2", "CUPS_CSPACE_DEVICE3", "CUPS_CSPACE_DEVICE4", "CUPS_CSPACE_DEVICE5", "CUPS_CSPACE_DEVICE6", "CUPS_CSPACE_DEVICE7", "CUPS_CSPACE_DEVICE8", "CUPS_CSPACE_DEVICE9", "CUPS_CSPACE_DEVICEA", "CUPS_CSPACE_DEVICEB", "CUPS_CSPACE_DEVICEC", "CUPS_CSPACE_DEVICED", "CUPS_CSPACE_DEVICEE", "CUPS_CSPACE_DEVICEF" }; header = display_->header(); if (!strcmp(header->MediaClass, "PwgRaster")) { header_buffer_->text("PWG Raster Page Attributes:\n\n"); snprintf(s, sizeof(s), "MediaColor = \"%s\"\n", header->MediaColor); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaType = \"%s\"\n", header->MediaType); header_buffer_->append(s); snprintf(s, sizeof(s), "PrintContentOptimize = \"%s\"\n", header->OutputType); header_buffer_->append(s); snprintf(s, sizeof(s), "CutMedia = %d\n", header->CutMedia); header_buffer_->append(s); snprintf(s, sizeof(s), "Duplex = %d\n", header->Duplex); header_buffer_->append(s); snprintf(s, sizeof(s), "HWResolution = [ %d %d ]\n", header->HWResolution[0], header->HWResolution[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "InsertSheet = %d\n", header->InsertSheet); header_buffer_->append(s); snprintf(s, sizeof(s), "Jog = %d\n", header->Jog); header_buffer_->append(s); snprintf(s, sizeof(s), "LeadingEdge = %d\n", header->LeadingEdge); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaPosition = %d\n", header->MediaPosition); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaWeightMetric = %d\n", header->MediaWeight); header_buffer_->append(s); snprintf(s, sizeof(s), "NumCopies = %d\n", header->NumCopies); header_buffer_->append(s); snprintf(s, sizeof(s), "Orientation = %d\n", header->Orientation); header_buffer_->append(s); snprintf(s, sizeof(s), "PageSize = [ %d %d ]\n", header->PageSize[0], header->PageSize[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "Tumble = %d\n", header->Tumble); header_buffer_->append(s); snprintf(s, sizeof(s), "Width = %d\n", header->cupsWidth); header_buffer_->append(s); snprintf(s, sizeof(s), "Height = %d\n", header->cupsHeight); header_buffer_->append(s); snprintf(s, sizeof(s), "BitsPerColor = %d\n", header->cupsBitsPerColor); header_buffer_->append(s); snprintf(s, sizeof(s), "BitsPerPixel = %d\n", header->cupsBitsPerPixel); header_buffer_->append(s); snprintf(s, sizeof(s), "BytesPerLine = %d\n", header->cupsBytesPerLine); header_buffer_->append(s); snprintf(s, sizeof(s), "ColorOrder = %s\n", header->cupsColorOrder == CUPS_ORDER_CHUNKED ? "CUPS_ORDER_CHUNKED" : header->cupsColorOrder == CUPS_ORDER_BANDED ? "CUPS_ORDER_BANDED" : header->cupsColorOrder == CUPS_ORDER_PLANAR ? "CUPS_ORDER_PLANAR" : "UNKNOWN"); header_buffer_->append(s); snprintf(s, sizeof(s), "ColorSpace = %s\n", header->cupsColorSpace < (int)(sizeof(cspaces) / sizeof(cspaces[0])) ? cspaces[header->cupsColorSpace] : "UNKNOWN"); header_buffer_->append(s); snprintf(s, sizeof(s), "NumColors = %d\n", header->cupsNumColors); header_buffer_->append(s); snprintf(s, sizeof(s), "TotalPageCount = %u\n", header->cupsInteger[0]); header_buffer_->append(s); snprintf(s, sizeof(s), "CrossFeedTransform = %d\n", header->cupsInteger[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "FeedTransform = %d\n", header->cupsInteger[2]); header_buffer_->append(s); snprintf(s, sizeof(s), "ImageBoxLeft = %u\n", header->cupsInteger[3]); header_buffer_->append(s); snprintf(s, sizeof(s), "ImageBoxTop = %u\n", header->cupsInteger[4]); header_buffer_->append(s); snprintf(s, sizeof(s), "ImageBoxRight = %u\n", header->cupsInteger[5]); header_buffer_->append(s); snprintf(s, sizeof(s), "ImageBoxBottom = %u\n", header->cupsInteger[6]); header_buffer_->append(s); snprintf(s, sizeof(s), "AlternatePrimary = %06x (%u, %u, %u)\n", header->cupsInteger[7], (header->cupsInteger[7] >> 16) & 255, (header->cupsInteger[7] >> 8) & 255, header->cupsInteger[7] & 255); header_buffer_->append(s); snprintf(s, sizeof(s), "PrintQuality = %u\n", header->cupsInteger[8]); header_buffer_->append(s); snprintf(s, sizeof(s), "VendorIdentifier = %u\n", header->cupsInteger[14]); header_buffer_->append(s); snprintf(s, sizeof(s), "VendorLength = %u\n", header->cupsInteger[15]); header_buffer_->append(s); unsigned char *data = (unsigned char *)header->cupsReal; unsigned dataidx, datalen = header->cupsInteger[15]; header_buffer_->append("VendorData ="); for (dataidx = 0; dataidx < datalen; dataidx ++) { if ((dataidx & 7) == 0) header_buffer_->append("\n "); snprintf(s, sizeof(s), " %02X", *data++); header_buffer_->append(s); } header_buffer_->append("\n"); snprintf(s, sizeof(s), "RenderingIntent = \"%s\"\n", header->cupsRenderingIntent); header_buffer_->append(s); snprintf(s, sizeof(s), "PageSizeName = \"%s\"\n", header->cupsPageSizeName); header_buffer_->append(s); } else { header_buffer_->text("CUPS Raster Page Attributes:\n\n"); snprintf(s, sizeof(s), "MediaClass = \"%s\"\n", header->MediaClass); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaColor = \"%s\"\n", header->MediaColor); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaType = \"%s\"\n", header->MediaType); header_buffer_->append(s); snprintf(s, sizeof(s), "OutputType = \"%s\"\n", header->OutputType); header_buffer_->append(s); snprintf(s, sizeof(s), "AdvanceDistance = %d\n", header->AdvanceDistance); header_buffer_->append(s); snprintf(s, sizeof(s), "AdvanceMedia = %d\n", header->AdvanceMedia); header_buffer_->append(s); snprintf(s, sizeof(s), "Collate = %d\n", header->Collate); header_buffer_->append(s); snprintf(s, sizeof(s), "CutMedia = %d\n", header->CutMedia); header_buffer_->append(s); snprintf(s, sizeof(s), "Duplex = %d\n", header->Duplex); header_buffer_->append(s); snprintf(s, sizeof(s), "HWResolution = [ %d %d ]\n", header->HWResolution[0], header->HWResolution[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "ImagingBoundingBox = [ %d %d %d %d ]\n", header->ImagingBoundingBox[0], header->ImagingBoundingBox[1], header->ImagingBoundingBox[2], header->ImagingBoundingBox[3]); header_buffer_->append(s); snprintf(s, sizeof(s), "InsertSheet = %d\n", header->InsertSheet); header_buffer_->append(s); snprintf(s, sizeof(s), "Jog = %d\n", header->Jog); header_buffer_->append(s); snprintf(s, sizeof(s), "LeadingEdge = %d\n", header->LeadingEdge); header_buffer_->append(s); snprintf(s, sizeof(s), "Margins = [ %d %d ]\n", header->Margins[0], header->Margins[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "ManualFeed = %d\n", header->ManualFeed); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaPosition = %d\n", header->MediaPosition); header_buffer_->append(s); snprintf(s, sizeof(s), "MediaWeight = %d\n", header->MediaWeight); header_buffer_->append(s); snprintf(s, sizeof(s), "MirrorPrint = %d\n", header->MirrorPrint); header_buffer_->append(s); snprintf(s, sizeof(s), "NegativePrint = %d\n", header->NegativePrint); header_buffer_->append(s); snprintf(s, sizeof(s), "NumCopies = %d\n", header->NumCopies); header_buffer_->append(s); snprintf(s, sizeof(s), "Orientation = %d\n", header->Orientation); header_buffer_->append(s); snprintf(s, sizeof(s), "OutputFaceUp = %d\n", header->OutputFaceUp); header_buffer_->append(s); snprintf(s, sizeof(s), "PageSize = [ %d %d ]\n", header->PageSize[0], header->PageSize[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "Separations = %d\n", header->Separations); header_buffer_->append(s); snprintf(s, sizeof(s), "TraySwitch = %d\n", header->TraySwitch); header_buffer_->append(s); snprintf(s, sizeof(s), "Tumble = %d\n", header->Tumble); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsWidth = %d\n", header->cupsWidth); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsHeight = %d\n", header->cupsHeight); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsMediaType = %d\n", header->cupsMediaType); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsBitsPerColor = %d\n", header->cupsBitsPerColor); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsBitsPerPixel = %d\n", header->cupsBitsPerPixel); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsBytesPerLine = %d\n", header->cupsBytesPerLine); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsColorOrder = %s\n", header->cupsColorOrder == CUPS_ORDER_CHUNKED ? "CUPS_ORDER_CHUNKED" : header->cupsColorOrder == CUPS_ORDER_BANDED ? "CUPS_ORDER_BANDED" : header->cupsColorOrder == CUPS_ORDER_PLANAR ? "CUPS_ORDER_PLANAR" : "UNKNOWN"); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsColorSpace = %s\n", header->cupsColorSpace < (int)(sizeof(cspaces) / sizeof(cspaces[0])) ? cspaces[header->cupsColorSpace] : "UNKNOWN"); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsCompression = %d\n", header->cupsCompression); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsRowCount = %d\n", header->cupsRowCount); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsRowFeed = %d\n", header->cupsRowFeed); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsRowStep = %d\n", header->cupsRowStep); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsNumColors = %d\n", header->cupsNumColors); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsBorderlessScalingFactor = %f\n", header->cupsBorderlessScalingFactor); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsPageSize = [ %f %f ]\n", header->cupsPageSize[0], header->cupsPageSize[1]); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsImagingBBox = [ %f %f %f %f ]\n", header->cupsImagingBBox[0], header->cupsImagingBBox[1], header->cupsImagingBBox[2], header->cupsImagingBBox[3]); header_buffer_->append(s); for (i = 0; i < 16; i ++) { snprintf(s, sizeof(s), "cupsInteger%d = %d\n", i + 1, header->cupsInteger[i]); header_buffer_->append(s); } for (i = 0; i < 16; i ++) { snprintf(s, sizeof(s), "cupsReal%d = %f\n", i + 1, header->cupsReal[i]); header_buffer_->append(s); } for (i = 0; i < 16; i ++) { snprintf(s, sizeof(s), "cupsString%d = \"%s\"\n", i + 1, header->cupsString[i]); header_buffer_->append(s); } snprintf(s, sizeof(s), "cupsMarkerType = \"%s\"\n", header->cupsMarkerType); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsRenderingIntent = \"%s\"\n", header->cupsRenderingIntent); header_buffer_->append(s); snprintf(s, sizeof(s), "cupsPageSizeName = \"%s\"\n", header->cupsPageSizeName); header_buffer_->append(s); } /* * Set device colors for the given color space... */ for (i = 0; i < header->cupsNumColors; i ++) { Fl_Color c = display_->device_color(i); colors_[i]->show(); colors_[i]->color(c); colors_[i]->labelcolor(fl_contrast(FL_BLACK, c)); colors_[i]->redraw(); } for (; i < 15; i ++) colors_[i]->hide(); if (display_->is_subtractive() && header->cupsBitsPerColor >= 8) { for (i = 0; i < 15; i ++) colors_[i]->activate(); } else { for (i = 0; i < 15; i ++) colors_[i]->deactivate(); } header_->redraw(); // Update navigation controls... char val[255]; snprintf(val, sizeof(val), "%d", display_->page()); page_input_->value(val); if (display_->page() == 1) prev_button_->deactivate(); else prev_button_->activate(); if (display_->page() >= display_->num_pages()) next_button_->deactivate(); else next_button_->activate(); } // // 'mode_cb()' - Change mode. // void RasterView::mode_cb(Fl_Widget *widget) { RasterView *view = (RasterView *)widget->window(); if (widget == view->zoom_in_button_) view->display_->mode(RASTER_MODE_ZOOM_IN); else if (widget == view->zoom_out_button_) view->display_->mode(RASTER_MODE_ZOOM_OUT); else if (widget == view->pan_button_) view->display_->mode(RASTER_MODE_PAN); else view->display_->mode(RASTER_MODE_CLICK); } // // 'RasterView::next_cb()' - Show the next page. // void RasterView::next_cb(Fl_Widget *widget) // I - Next button { RasterView *view; // I - Window view = (RasterView *)(widget->window()); if (view->loading_) return; view->loading_ = 1; view->display_->load_page(); view->load_attrs(); view->loading_ = 0; } // // 'RasterView::open_file()' - Open a raster file in a new window. // RasterView * // O - New window RasterView::open_file(const char *f) // I - File to open { RasterView *view; // New window char *argv[1]; // Argument for (view = first_; view; view = view->next_) if (view->filename_ && !strcmp(f, view->filename_)) break; if (!view) { for (view = first_; view; view = view->next_) if (!view->filename_) break; } if (!view) view = new RasterView(600, 800); view->set_filename(f); argv[0] = (char *)"rasterview"; view->show(1, argv); view->reopen_cb(view); return (view); } // // 'RasterView::open_cb()' - Open a new file. // void RasterView::open_cb() { Fl_Native_File_Chooser fc; fc.title("Open?"); fc.type(Fl_Native_File_Chooser::BROWSE_FILE); fc.filter("Raster Files\t*.{apple,pwg,ras}{,.gz}\n"); if (!fc.show()) open_file(fc.filename()); } // // 'RasterView::prev_cb()' - Show the previous page. // void RasterView::prev_cb(Fl_Widget *widget) // I - Next button { RasterView *view; // I - Window view = (RasterView *)(widget->window()); if (view->loading_) return; view->loading_ = 1; view->display_->page(view->display_->page() - 1); view->load_attrs(); view->loading_ = 0; } // // 'RasterView::quit_cb()' - Quit the application. // void RasterView::quit_cb() { exit(0); } // // 'RasterView::reopen_cb()' - Re-open the current file. // void RasterView::reopen_cb(Fl_Widget *widget)// I - Menu or window { RasterView *view; // I - Window if (widget->window()) view = (RasterView *)(widget->window()); else view = (RasterView *)widget; if (view->loading_) return; view->loading_ = 1; view->header_buffer_->text("Loading..."); view->display_->open_file(view->filename_); view->load_attrs(); view->loading_ = 0; } // // 'RasterView::resize()' - Resize the window. // void RasterView::resize(int X, // I - New X position int Y, // I - New Y position int W, // I - New width int H) // I - New height { int base_W; // Base width Fl_Double_Window::resize(X, Y, W, H); if (attributes_->visible()) { base_W = W - ATTRS_WIDTH; attributes_->resize(base_W, 0, ATTRS_WIDTH, H); } else base_W = W; #ifndef __APPLE__ menubar_->resize(0, 0, base_W, 25); #endif /* !__APPLE__ */ display_->resize(0, MENU_OFFSET, base_W, H - MENU_OFFSET - 30); buttons_->resize(0, H - 30, base_W, 30); } // // 'RasterView::set_filename()' - Set the filename and window title. // void RasterView::set_filename(const char *f) // I - New filename { char s[1024]; // String const char *base; // Basename if (filename_) free(filename_); if (f) filename_ = strdup(f); else filename_ = NULL; if (title_) free(title_); if (f) { if ((base = strrchr(f, '/')) != NULL) base ++; else base = f; snprintf(s, sizeof(s), "%s - " VERSION, base); title_ = strdup(s); } else title_ = strdup(VERSION); label(title_); } // // 'RasterView::RasterView()' - Create a new window. // RasterView::RasterView(int X, int Y, int W, int H, const char *L) : Fl_Double_Window(X, Y, W, H, L) { init(); } // // 'RasterView::RasterView()' - Create a new window. // RasterView::RasterView(int W, int H, const char *L) : Fl_Double_Window(Fl::x() + (Fl::w() - W) / 2, Fl::y() + (Fl::h() - H) / 2, W, H, L) { init(); } // // 'RasterView::~RasterView()' - Destroy a window. // RasterView::~RasterView() { RasterView *current, *prev; for (prev = NULL, current = first_; current; prev = current, current = current->next_) if (current == this) break; if (current) { if (prev) prev->next_ = current->next_; else first_ = current->next_; } } RasterView.h000066400000000000000000000050031407457743100133340ustar00rootroot00000000000000// // CUPS raster file viewer application window header file. // // Copyright 2002-2015 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // #ifndef RasterView_h # define RasterView_h // // Include necessary headers... // # include "RasterDisplay.h" # include # include # include # include # include # include # include // // RasterView application class... // class RasterView : public Fl_Double_Window { RasterView *next_; // Next window in list char *filename_; // Filename char *title_; // Window title int loading_; // Non-zero if we are loading a page char pixel_[1024]; // Current pixel value Fl_Sys_Menu_Bar *menubar_; // Menubar RasterDisplay *display_; // Display widget Fl_Group *buttons_; // Button bar Fl_Box *status_; // Status box Fl_Button *prev_button_, // Previous page button *next_button_, // Next page button *zoom_in_button_, // Zoom-in mode button *zoom_out_button_, // Zoom-out mode button *pan_button_, // Pan mode button *color_button_, // Color inspector mode button *attrs_button_; // Toggle attributes button Fl_Int_Input *page_input_; // Page number control Fl_Group *attributes_; // Attributes pane Fl_Button *colors_[15]; // Color buttons Fl_Text_Display *header_; // Page header Fl_Text_Buffer *header_buffer_;// Attribute buffer static RasterView *first_; // First window in list static Fl_Help_Dialog *help_; // Help dialog # ifdef __APPLE__ static void apple_open_cb(const char *f); # endif // __APPLE__ static void attrs_cb(Fl_Widget *widget); static void close_cb(Fl_Widget *widget); static void color_cb(RasterDisplay *display); static void device_cb(Fl_Widget *widget); static void goto_cb(Fl_Widget *widget); static void help_cb(); void init(); void load_attrs(); static void mode_cb(Fl_Widget *widget); static void next_cb(Fl_Widget *widget); static void open_cb(); static void prev_cb(Fl_Widget *widget); static void quit_cb(); static void reopen_cb(Fl_Widget *widget); void set_filename(const char *f); public: RasterView(int X, int Y, int W, int H, const char *L = 0); RasterView(int W, int H, const char *L = 0); ~RasterView(); int handle(int event); static RasterView *open_file(const char *f); void resize(int X, int Y, int W, int H); }; #endif // !RasterView_h configure000077500000000000000000004575351407457743100130240ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.71 for RasterView 1.8. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, # Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="as_nop=: if test \${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else \$as_nop case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ) then : else \$as_nop exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 blah=\$(echo \$(echo blah)) test x\"\$blah\" = xblah || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1" if (eval "$as_required") 2>/dev/null then : as_have_required=yes else $as_nop as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null then : else $as_nop as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && as_run=a "$as_shell" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$as_shell as_have_required=yes if as_run=a "$as_shell" -c "$as_bourne_compatible""$as_suggested" 2>/dev/null then : break 2 fi fi done;; esac as_found=false done IFS=$as_save_IFS if $as_found then : else $as_nop if { test -f "$SHELL" || test -f "$SHELL.exe"; } && as_run=a "$SHELL" -c "$as_bourne_compatible""$as_required" 2>/dev/null then : CONFIG_SHELL=$SHELL as_have_required=yes fi fi if test "x$CONFIG_SHELL" != x then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. printf "%s\n" "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno then : printf "%s\n" "$0: This script requires a shell more modern than all" printf "%s\n" "$0: the shells that I found on your system." if test ${ZSH_VERSION+y} ; then printf "%s\n" "$0: In particular, zsh $ZSH_VERSION has bugs and should" printf "%s\n" "$0: be upgraded to zsh 4.3.4 or later." else printf "%s\n" "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/michaelrsweet/rasterview/issues $0: about your system, including any error possibly output $0: before this message. Then install a modern shell, or $0: manually run the script under such a shell if you do $0: have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_nop # --------- # Do nothing but, unlike ":", preserve the value of $?. as_fn_nop () { return $? } as_nop=as_fn_nop # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { printf "%s\n" "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='RasterView' PACKAGE_TARNAME='rasterview' PACKAGE_VERSION='1.8' PACKAGE_STRING='RasterView 1.8' PACKAGE_BUGREPORT='https://github.com/michaelrsweet/rasterview/issues' PACKAGE_URL='https://www.msweet.org/rasterview' ac_subst_vars='LTLIBOBJS LIBOBJS UNINSTALLDESKTOP INSTALLDESKTOP desktopdir ARCHFLAGS FLTKCONFIG RM MKDIR CP CODE_SIGN ac_ct_CXX CXX OBJEXT EXEEXT ac_ct_CC CC CSFLAGS OPTIM LDFLAGS CXXFLAGS CPPFLAGS CFLAGS VERSION target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_debug enable_largefile with_archflags ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CXX CXXFLAGS CCC' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: \`$ac_useropt'" ac_useropt_orig=$ac_useropt ac_useropt=`printf "%s\n" "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. printf "%s\n" "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && printf "%s\n" "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures RasterView 1.8 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/rasterview] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of RasterView 1.8:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-debug turn on debugging, default=no --disable-largefile omit support for large files Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-archflags=... Specify architecture options Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CXX C++ compiler command CXXFLAGS C++ compiler flags Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . RasterView home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for configure.gnu first; this name is used for a wrapper for # Metaconfig's "Configure" on case-insensitive file systems. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else printf "%s\n" "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF RasterView configure 1.8 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_cxx_try_compile LINENO # ---------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_cxx_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_cxx_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_cxx_try_compile # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest.beam conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext } then : ac_retval=0 else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link ac_configure_args_raw= for ac_arg do case $ac_arg in *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append ac_configure_args_raw " '$ac_arg'" done case $ac_configure_args_raw in *$as_nl*) ac_safe_unquote= ;; *) ac_unsafe_z='|&;<>()$`\\"*?[ '' ' # This string ends in space, tab. ac_unsafe_a="$ac_unsafe_z#~" ac_safe_unquote="s/ '\\([^$ac_unsafe_a][^$ac_unsafe_z]*\\)'/ \\1/g" ac_configure_args_raw=` printf "%s\n" "$ac_configure_args_raw" | sed "$ac_safe_unquote"`;; esac cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by RasterView $as_me 1.8, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac printf "%s\n" "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`printf "%s\n" "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Sanitize IFS. IFS=" "" $as_nl" # Save into config.log some information that might help in debugging. { echo printf "%s\n" "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo printf "%s\n" "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then printf "%s\n" "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`printf "%s\n" "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac printf "%s\n" "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then printf "%s\n" "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && printf "%s\n" "$as_me: caught signal $ac_signal" printf "%s\n" "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h printf "%s\n" "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. printf "%s\n" "#define PACKAGE_NAME \"$PACKAGE_NAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_TARNAME \"$PACKAGE_TARNAME\"" >>confdefs.h printf "%s\n" "#define PACKAGE_VERSION \"$PACKAGE_VERSION\"" >>confdefs.h printf "%s\n" "#define PACKAGE_STRING \"$PACKAGE_STRING\"" >>confdefs.h printf "%s\n" "#define PACKAGE_BUGREPORT \"$PACKAGE_BUGREPORT\"" >>confdefs.h printf "%s\n" "#define PACKAGE_URL \"$PACKAGE_URL\"" >>confdefs.h # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then ac_site_files="$CONFIG_SITE" elif test "x$prefix" != xNONE; then ac_site_files="$prefix/share/config.site $prefix/etc/config.site" else ac_site_files="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi for ac_site_file in $ac_site_files do case $ac_site_file in #( */*) : ;; #( *) : ac_site_file=./$ac_site_file ;; esac if test -f "$ac_site_file" && test -r "$ac_site_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 printf "%s\n" "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 printf "%s\n" "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 printf "%s\n" "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Test code for whether the C compiler supports C89 (global declarations) ac_c_conftest_c89_globals=' /* Does the compiler advertise C89 conformance? Do not test the value of __STDC__, because some compilers set it to 0 while being otherwise adequately conformant. */ #if !defined __STDC__ # error "Compiler does not advertise C89 conformance" #endif #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7 src/conf.sh. */ struct buf { int x; }; struct buf * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not \xHH hex character constants. These do not provoke an error unfortunately, instead are silently treated as an "x". The following induces an error, until -std is added to get proper ANSI mode. Curiously \x00 != x always comes out true, for an array size at least. It is necessary to write \x00 == 0 to get something that is true only with -std. */ int osf4_cc_array ['\''\x00'\'' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) '\''x'\'' int xlc6_cc_array[FOO(a) == '\''x'\'' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, int *(*)(struct buf *, struct stat *, int), int, int);' # Test code for whether the C compiler supports C89 (body of main). ac_c_conftest_c89_main=' ok |= (argc == 0 || f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]); ' # Test code for whether the C compiler supports C99 (global declarations) ac_c_conftest_c99_globals=' // Does the compiler advertise C99 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L # error "Compiler does not advertise C99 conformance" #endif #include extern int puts (const char *); extern int printf (const char *, ...); extern int dprintf (int, const char *, ...); extern void *malloc (size_t); // Check varargs macros. These examples are taken from C99 6.10.3.5. // dprintf is used instead of fprintf to avoid needing to declare // FILE and stderr. #define debug(...) dprintf (2, __VA_ARGS__) #define showlist(...) puts (#__VA_ARGS__) #define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__)) static void test_varargs_macros (void) { int x = 1234; int y = 5678; debug ("Flag"); debug ("X = %d\n", x); showlist (The first, second, and third items.); report (x>y, "x is %d but y is %d", x, y); } // Check long long types. #define BIG64 18446744073709551615ull #define BIG32 4294967295ul #define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0) #if !BIG_OK #error "your preprocessor is broken" #endif #if BIG_OK #else #error "your preprocessor is broken" #endif static long long int bignum = -9223372036854775807LL; static unsigned long long int ubignum = BIG64; struct incomplete_array { int datasize; double data[]; }; struct named_init { int number; const wchar_t *name; double average; }; typedef const char *ccp; static inline int test_restrict (ccp restrict text) { // See if C++-style comments work. // Iterate through items via the restricted pointer. // Also check for declarations in for loops. for (unsigned int i = 0; *(text+i) != '\''\0'\''; ++i) continue; return 0; } // Check varargs and va_copy. static bool test_varargs (const char *format, ...) { va_list args; va_start (args, format); va_list args_copy; va_copy (args_copy, args); const char *str = ""; int number = 0; float fnumber = 0; while (*format) { switch (*format++) { case '\''s'\'': // string str = va_arg (args_copy, const char *); break; case '\''d'\'': // int number = va_arg (args_copy, int); break; case '\''f'\'': // float fnumber = va_arg (args_copy, double); break; default: break; } } va_end (args_copy); va_end (args); return *str && number && fnumber; } ' # Test code for whether the C compiler supports C99 (body of main). ac_c_conftest_c99_main=' // Check bool. _Bool success = false; success |= (argc != 0); // Check restrict. if (test_restrict ("String literal") == 0) success = true; char *restrict newvar = "Another string"; // Check varargs. success &= test_varargs ("s, d'\'' f .", "string", 65, 34.234); test_varargs_macros (); // Check flexible array members. struct incomplete_array *ia = malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10)); ia->datasize = 10; for (int i = 0; i < ia->datasize; ++i) ia->data[i] = i * 1.234; // Check named initializers. struct named_init ni = { .number = 34, .name = L"Test wide string", .average = 543.34343, }; ni.number = 58; int dynamic_array[ni.number]; dynamic_array[0] = argv[0][0]; dynamic_array[ni.number - 1] = 543; // work around unused variable warnings ok |= (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == '\''x'\'' || dynamic_array[ni.number - 1] != 543); ' # Test code for whether the C compiler supports C11 (global declarations) ac_c_conftest_c11_globals=' // Does the compiler advertise C11 conformance? #if !defined __STDC_VERSION__ || __STDC_VERSION__ < 201112L # error "Compiler does not advertise C11 conformance" #endif // Check _Alignas. char _Alignas (double) aligned_as_double; char _Alignas (0) no_special_alignment; extern char aligned_as_int; char _Alignas (0) _Alignas (int) aligned_as_int; // Check _Alignof. enum { int_alignment = _Alignof (int), int_array_alignment = _Alignof (int[100]), char_alignment = _Alignof (char) }; _Static_assert (0 < -_Alignof (int), "_Alignof is signed"); // Check _Noreturn. int _Noreturn does_not_return (void) { for (;;) continue; } // Check _Static_assert. struct test_static_assert { int x; _Static_assert (sizeof (int) <= sizeof (long int), "_Static_assert does not work in struct"); long int y; }; // Check UTF-8 literals. #define u8 syntax error! char const utf8_literal[] = u8"happens to be ASCII" "another string"; // Check duplicate typedefs. typedef long *long_ptr; typedef long int *long_ptr; typedef long_ptr long_ptr; // Anonymous structures and unions -- taken from C11 6.7.2.1 Example 1. struct anonymous { union { struct { int i; int j; }; struct { int k; long int l; } w; }; int m; } v1; ' # Test code for whether the C compiler supports C11 (body of main). ac_c_conftest_c11_main=' _Static_assert ((offsetof (struct anonymous, i) == offsetof (struct anonymous, w.k)), "Anonymous union alignment botch"); v1.i = 2; v1.w.k = 5; ok |= v1.i != 5; ' # Test code for whether the C compiler supports C11 (complete). ac_c_conftest_c11_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} ${ac_c_conftest_c11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} ${ac_c_conftest_c11_main} return ok; } " # Test code for whether the C compiler supports C99 (complete). ac_c_conftest_c99_program="${ac_c_conftest_c89_globals} ${ac_c_conftest_c99_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} ${ac_c_conftest_c99_main} return ok; } " # Test code for whether the C compiler supports C89 (complete). ac_c_conftest_c89_program="${ac_c_conftest_c89_globals} int main (int argc, char **argv) { int ok = 0; ${ac_c_conftest_c89_main} return ok; } " # Test code for whether the C++ compiler supports C++98 (global declarations) ac_cxx_conftest_cxx98_globals=' // Does the compiler advertise C++98 conformance? #if !defined __cplusplus || __cplusplus < 199711L # error "Compiler does not advertise C++98 conformance" #endif // These inclusions are to reject old compilers that // lack the unsuffixed header files. #include #include // and are *not* freestanding headers in C++98. extern void assert (int); namespace std { extern int strcmp (const char *, const char *); } // Namespaces, exceptions, and templates were all added after "C++ 2.0". using std::exception; using std::strcmp; namespace { void test_exception_syntax() { try { throw "test"; } catch (const char *s) { // Extra parentheses suppress a warning when building autoconf itself, // due to lint rules shared with more typical C programs. assert (!(strcmp) (s, "test")); } } template struct test_template { T const val; explicit test_template(T t) : val(t) {} template T add(U u) { return static_cast(u) + val; } }; } // anonymous namespace ' # Test code for whether the C++ compiler supports C++98 (body of main) ac_cxx_conftest_cxx98_main=' assert (argc); assert (! argv[0]); { test_exception_syntax (); test_template tt (2.0); assert (tt.add (4) == 6.0); assert (true && !false); } ' # Test code for whether the C++ compiler supports C++11 (global declarations) ac_cxx_conftest_cxx11_globals=' // Does the compiler advertise C++ 2011 conformance? #if !defined __cplusplus || __cplusplus < 201103L # error "Compiler does not advertise C++11 conformance" #endif namespace cxx11test { constexpr int get_val() { return 20; } struct testinit { int i; double d; }; class delegate { public: delegate(int n) : n(n) {} delegate(): delegate(2354) {} virtual int getval() { return this->n; }; protected: int n; }; class overridden : public delegate { public: overridden(int n): delegate(n) {} virtual int getval() override final { return this->n * 2; } }; class nocopy { public: nocopy(int i): i(i) {} nocopy() = default; nocopy(const nocopy&) = delete; nocopy & operator=(const nocopy&) = delete; private: int i; }; // for testing lambda expressions template Ret eval(Fn f, Ret v) { return f(v); } // for testing variadic templates and trailing return types template auto sum(V first) -> V { return first; } template auto sum(V first, Args... rest) -> V { return first + sum(rest...); } } ' # Test code for whether the C++ compiler supports C++11 (body of main) ac_cxx_conftest_cxx11_main=' { // Test auto and decltype auto a1 = 6538; auto a2 = 48573953.4; auto a3 = "String literal"; int total = 0; for (auto i = a3; *i; ++i) { total += *i; } decltype(a2) a4 = 34895.034; } { // Test constexpr short sa[cxx11test::get_val()] = { 0 }; } { // Test initializer lists cxx11test::testinit il = { 4323, 435234.23544 }; } { // Test range-based for int array[] = {9, 7, 13, 15, 4, 18, 12, 10, 5, 3, 14, 19, 17, 8, 6, 20, 16, 2, 11, 1}; for (auto &x : array) { x += 23; } } { // Test lambda expressions using cxx11test::eval; assert (eval ([](int x) { return x*2; }, 21) == 42); double d = 2.0; assert (eval ([&](double x) { return d += x; }, 3.0) == 5.0); assert (d == 5.0); assert (eval ([=](double x) mutable { return d += x; }, 4.0) == 9.0); assert (d == 5.0); } { // Test use of variadic templates using cxx11test::sum; auto a = sum(1); auto b = sum(1, 2); auto c = sum(1.0, 2.0, 3.0); } { // Test constructor delegation cxx11test::delegate d1; cxx11test::delegate d2(); cxx11test::delegate d3(45); } { // Test override and final cxx11test::overridden o1(55464); } { // Test nullptr char *c = nullptr; } { // Test template brackets test_template<::test_template> v(test_template(12)); } { // Unicode literals char const *utf8 = u8"UTF-8 string \u2500"; char16_t const *utf16 = u"UTF-8 string \u2500"; char32_t const *utf32 = U"UTF-32 string \u2500"; } ' # Test code for whether the C compiler supports C++11 (complete). ac_cxx_conftest_cxx11_program="${ac_cxx_conftest_cxx98_globals} ${ac_cxx_conftest_cxx11_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} ${ac_cxx_conftest_cxx11_main} return ok; } " # Test code for whether the C compiler supports C++98 (complete). ac_cxx_conftest_cxx98_program="${ac_cxx_conftest_cxx98_globals} int main (int argc, char **argv) { int ok = 0; ${ac_cxx_conftest_cxx98_main} return ok; } " # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 printf "%s\n" "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 printf "%s\n" "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 printf "%s\n" "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 printf "%s\n" "$as_me: former value: \`$ac_old_val'" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 printf "%s\n" "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`printf "%s\n" "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 printf "%s\n" "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`${MAKE-make} distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu VERSION="1.8" printf "%s\n" "#define VERSION \"rasterview v$VERSION\"" >>confdefs.h uname=$(uname) uversion=$(uname -r | sed -e '1,$s/[^0-9]//g') if test "x$uname" = x then : # MingW doesn't provide any output when uname is run, even with "-s"... uname="CYGWIN" fi CFLAGS="${CFLAGS:=}" CXXFLAGS="${CPPFLAGS:=}" CXXFLAGS="${CXXFLAGS:=}" LDFLAGS="${LDFLAGS:=}" LIBS="${LIBS:=}" OPTIM="${OPTIM:=}" # Check whether --enable-debug was given. if test ${enable_debug+y} then : enableval=$enable_debug; fi if test x$enable_debug = xyes then : OPTIM="$OPTIM -g" CSFLAGS="" else $as_nop OPTIM="$OPTIM -g -Os" CSFLAGS="-o runtime" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then if test "$as_dir$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}clang", so it can be a program name with args. set dummy ${ac_tool_prefix}clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 printf "%s\n" "$CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "clang", so it can be a program name with args. set dummy clang; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CC+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="clang" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 printf "%s\n" "$ac_ct_CC" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi fi test -z "$CC" && { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion -version; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 printf %s "checking whether the C compiler works... " >&6; } ac_link_default=`printf "%s\n" "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test ${ac_cv_exeext+y} && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else $as_nop ac_file='' fi if test -z "$ac_file" then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 printf %s "checking for C compiler default output file name... " >&6; } { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 printf "%s\n" "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 printf %s "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else $as_nop { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 printf "%s\n" "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main (void) { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 printf %s "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 printf "%s\n" "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 printf %s "checking for suffix of object files... " >&6; } if test ${ac_cv_objext+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_nop printf "%s\n" "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 printf "%s\n" "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C" >&5 printf %s "checking whether the compiler supports GNU C... " >&6; } if test ${ac_cv_c_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 printf "%s\n" "$ac_cv_c_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_c_compiler_gnu if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+y} ac_save_CFLAGS=$CFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 printf %s "checking whether $CC accepts -g... " >&6; } if test ${ac_cv_prog_cc_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes else $as_nop CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : else $as_nop ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 printf "%s\n" "$ac_cv_prog_cc_g" >&6; } if test $ac_test_CFLAGS; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi ac_prog_cc_stdc=no if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C11 features" >&5 printf %s "checking for $CC option to enable C11 features... " >&6; } if test ${ac_cv_prog_cc_c11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c11=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c11_program _ACEOF for ac_arg in '' -std=gnu11 do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c11" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c11" >&5 printf "%s\n" "$ac_cv_prog_cc_c11" >&6; } CC="$CC $ac_cv_prog_cc_c11" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c11 ac_prog_cc_stdc=c11 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C99 features" >&5 printf %s "checking for $CC option to enable C99 features... " >&6; } if test ${ac_cv_prog_cc_c99+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c99=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c99_program _ACEOF for ac_arg in '' -std=gnu99 -std=c99 -c99 -qlanglvl=extc1x -qlanglvl=extc99 -AC99 -D_STDC_C99= do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c99=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c99" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c99" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c99" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5 printf "%s\n" "$ac_cv_prog_cc_c99" >&6; } CC="$CC $ac_cv_prog_cc_c99" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99 ac_prog_cc_stdc=c99 fi fi if test x$ac_prog_cc_stdc = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CC option to enable C89 features" >&5 printf %s "checking for $CC option to enable C89 features... " >&6; } if test ${ac_cv_prog_cc_c89+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_c_conftest_c89_program _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO" then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi if test "x$ac_cv_prog_cc_c89" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cc_c89" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 printf "%s\n" "$ac_cv_prog_cc_c89" >&6; } CC="$CC $ac_cv_prog_cc_c89" fi ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89 ac_prog_cc_stdc=c89 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test -z "$CXX"; then if test -n "$CCC"; then CXX=$CCC else if test -n "$ac_tool_prefix"; then for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$CXX"; then ac_cv_prog_CXX="$CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CXX" >&5 printf "%s\n" "$CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CXX" && break done fi if test -z "$CXX"; then ac_ct_CXX=$CXX for ac_prog in g++ c++ gpp aCC CC cxx cc++ cl.exe FCC KCC RCC xlC_r xlC clang++ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_prog_ac_ct_CXX+y} then : printf %s "(cached) " >&6 else $as_nop if test -n "$ac_ct_CXX"; then ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CXX" >&5 printf "%s\n" "$ac_ct_CXX" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$ac_ct_CXX" && break done if test "x$ac_ct_CXX" = x; then CXX="g++" else case $cross_compiling:$ac_tool_warned in yes:) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 printf "%s\n" "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CXX=$ac_ct_CXX fi fi fi fi # Provide some information about the compiler. printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for C++ compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" printf "%s\n" "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err printf "%s\n" "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether the compiler supports GNU C++" >&5 printf %s "checking whether the compiler supports GNU C++... " >&6; } if test ${ac_cv_cxx_compiler_gnu+y} then : printf %s "(cached) " >&6 else $as_nop cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_compiler_gnu=yes else $as_nop ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_cxx_compiler_gnu" >&5 printf "%s\n" "$ac_cv_cxx_compiler_gnu" >&6; } ac_compiler_gnu=$ac_cv_cxx_compiler_gnu if test $ac_compiler_gnu = yes; then GXX=yes else GXX= fi ac_test_CXXFLAGS=${CXXFLAGS+y} ac_save_CXXFLAGS=$CXXFLAGS { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether $CXX accepts -g" >&5 printf %s "checking whether $CXX accepts -g... " >&6; } if test ${ac_cv_prog_cxx_g+y} then : printf %s "(cached) " >&6 else $as_nop ac_save_cxx_werror_flag=$ac_cxx_werror_flag ac_cxx_werror_flag=yes ac_cv_prog_cxx_g=no CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes else $as_nop CXXFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : else $as_nop ac_cxx_werror_flag=$ac_save_cxx_werror_flag CXXFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main (void) { ; return 0; } _ACEOF if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cxx_werror_flag=$ac_save_cxx_werror_flag fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_g" >&5 printf "%s\n" "$ac_cv_prog_cxx_g" >&6; } if test $ac_test_CXXFLAGS; then CXXFLAGS=$ac_save_CXXFLAGS elif test $ac_cv_prog_cxx_g = yes; then if test "$GXX" = yes; then CXXFLAGS="-g -O2" else CXXFLAGS="-g" fi else if test "$GXX" = yes; then CXXFLAGS="-O2" else CXXFLAGS= fi fi ac_prog_cxx_stdcxx=no if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5 printf %s "checking for $CXX option to enable C++11 features... " >&6; } if test ${ac_cv_prog_cxx_11+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_11=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx11_program _ACEOF for ac_arg in '' -std=gnu++11 -std=gnu++0x -std=c++11 -std=c++0x -qlanglvl=extended0x -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx11=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx11" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx11" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx11" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx11" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx11" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx11" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx11 ac_prog_cxx_stdcxx=cxx11 fi fi if test x$ac_prog_cxx_stdcxx = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5 printf %s "checking for $CXX option to enable C++98 features... " >&6; } if test ${ac_cv_prog_cxx_98+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_prog_cxx_98=no ac_save_CXX=$CXX cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_cxx_conftest_cxx98_program _ACEOF for ac_arg in '' -std=gnu++98 -std=c++98 -qlanglvl=extended -AA do CXX="$ac_save_CXX $ac_arg" if ac_fn_cxx_try_compile "$LINENO" then : ac_cv_prog_cxx_cxx98=$ac_arg fi rm -f core conftest.err conftest.$ac_objext conftest.beam test "x$ac_cv_prog_cxx_cxx98" != "xno" && break done rm -f conftest.$ac_ext CXX=$ac_save_CXX fi if test "x$ac_cv_prog_cxx_cxx98" = xno then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 printf "%s\n" "unsupported" >&6; } else $as_nop if test "x$ac_cv_prog_cxx_cxx98" = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 printf "%s\n" "none needed" >&6; } else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cxx_cxx98" >&5 printf "%s\n" "$ac_cv_prog_cxx_cxx98" >&6; } CXX="$CXX $ac_cv_prog_cxx_cxx98" fi ac_cv_prog_cxx_stdcxx=$ac_cv_prog_cxx_cxx98 ac_prog_cxx_stdcxx=cxx98 fi fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu for ac_prog in codesign true do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CODE_SIGN+y} then : printf %s "(cached) " >&6 else $as_nop case $CODE_SIGN in [\\/]* | ?:[\\/]*) ac_cv_path_CODE_SIGN="$CODE_SIGN" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_CODE_SIGN="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CODE_SIGN=$ac_cv_path_CODE_SIGN if test -n "$CODE_SIGN"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CODE_SIGN" >&5 printf "%s\n" "$CODE_SIGN" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi test -n "$CODE_SIGN" && break done # Extract the first word of "cp", so it can be a program name with args. set dummy cp; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_CP+y} then : printf %s "(cached) " >&6 else $as_nop case $CP in [\\/]* | ?:[\\/]*) ac_cv_path_CP="$CP" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_CP="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi CP=$ac_cv_path_CP if test -n "$CP"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $CP" >&5 printf "%s\n" "$CP" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "mkdir", so it can be a program name with args. set dummy mkdir; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_MKDIR+y} then : printf %s "(cached) " >&6 else $as_nop case $MKDIR in [\\/]* | ?:[\\/]*) ac_cv_path_MKDIR="$MKDIR" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_MKDIR="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi MKDIR=$ac_cv_path_MKDIR if test -n "$MKDIR"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $MKDIR" >&5 printf "%s\n" "$MKDIR" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "rm", so it can be a program name with args. set dummy rm; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_RM+y} then : printf %s "(cached) " >&6 else $as_nop case $RM in [\\/]* | ?:[\\/]*) ac_cv_path_RM="$RM" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_RM="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi RM=$ac_cv_path_RM if test -n "$RM"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $RM" >&5 printf "%s\n" "$RM" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi # Extract the first word of "fltk-config", so it can be a program name with args. set dummy fltk-config; ac_word=$2 { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 printf %s "checking for $ac_word... " >&6; } if test ${ac_cv_path_FLTKCONFIG+y} then : printf %s "(cached) " >&6 else $as_nop case $FLTKCONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_FLTKCONFIG="$FLTKCONFIG" # Let the user override the test with a path. ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir$ac_word$ac_exec_ext"; then ac_cv_path_FLTKCONFIG="$as_dir$ac_word$ac_exec_ext" printf "%s\n" "$as_me:${as_lineno-$LINENO}: found $as_dir$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS ;; esac fi FLTKCONFIG=$ac_cv_path_FLTKCONFIG if test -n "$FLTKCONFIG"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $FLTKCONFIG" >&5 printf "%s\n" "$FLTKCONFIG" >&6; } else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } fi if test "x$FLTKCONFIG" = x then : as_fn_error $? "Sorry, rasterview requires FLTK 1.1.x or later." "$LINENO" 5 else $as_nop CXXFLAGS="$($FLTKCONFIG --use-images --cflags) $CXXFLAGS" LIBS="$($FLTKCONFIG --use-images --ldflags) $LIBS" fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing gzopen" >&5 printf %s "checking for library containing gzopen... " >&6; } if test ${ac_cv_search_gzopen+y} then : printf %s "(cached) " >&6 else $as_nop ac_func_search_save_LIBS=$LIBS cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ char gzopen (); int main (void) { return gzopen (); ; return 0; } _ACEOF for ac_lib in '' z do if test -z "$ac_lib"; then ac_res="none required" else ac_res=-l$ac_lib LIBS="-l$ac_lib $ac_func_search_save_LIBS" fi if ac_fn_c_try_link "$LINENO" then : ac_cv_search_gzopen=$ac_res fi rm -f core conftest.err conftest.$ac_objext conftest.beam \ conftest$ac_exeext if test ${ac_cv_search_gzopen+y} then : break fi done if test ${ac_cv_search_gzopen+y} then : else $as_nop ac_cv_search_gzopen=no fi rm conftest.$ac_ext LIBS=$ac_func_search_save_LIBS fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_gzopen" >&5 printf "%s\n" "$ac_cv_search_gzopen" >&6; } ac_res=$ac_cv_search_gzopen if test "$ac_res" != no then : test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" fi # Check whether --enable-largefile was given. if test ${enable_largefile+y} then : enableval=$enable_largefile; fi if test "$enable_largefile" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for special C compiler options needed for large files" >&5 printf %s "checking for special C compiler options needed for large files... " >&6; } if test ${ac_cv_sys_largefile_CC+y} then : printf %s "(cached) " >&6 else $as_nop ac_cv_sys_largefile_CC=no if test "$GCC" != yes; then ac_save_CC=$CC while :; do # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : break fi rm -f core conftest.err conftest.$ac_objext conftest.beam CC="$CC -n32" if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_largefile_CC=' -n32'; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_largefile_CC" >&5 printf "%s\n" "$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _FILE_OFFSET_BITS value needed for large files" >&5 printf %s "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } if test ${ac_cv_sys_file_offset_bits+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _FILE_OFFSET_BITS 64 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_file_offset_bits=64; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_file_offset_bits=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_file_offset_bits" >&5 printf "%s\n" "$ac_cv_sys_file_offset_bits" >&6; } case $ac_cv_sys_file_offset_bits in #( no | unknown) ;; *) printf "%s\n" "#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits" >>confdefs.h ;; esac rm -rf conftest* if test $ac_cv_sys_file_offset_bits = unknown; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for _LARGE_FILES value needed for large files" >&5 printf %s "checking for _LARGE_FILES value needed for large files... " >&6; } if test ${ac_cv_sys_large_files+y} then : printf %s "(cached) " >&6 else $as_nop while :; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=no; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #define _LARGE_FILES 1 #include /* Check that off_t can represent 2**63 - 1 correctly. We can't simply define LARGE_OFF_T to be 9223372036854775807, since some C++ compilers masquerading as C compilers incorrectly reject 9223372036854775807. */ #define LARGE_OFF_T (((off_t) 1 << 31 << 31) - 1 + ((off_t) 1 << 31 << 31)) int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 && LARGE_OFF_T % 2147483647 == 1) ? 1 : -1]; int main (void) { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO" then : ac_cv_sys_large_files=1; break fi rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext ac_cv_sys_large_files=unknown break done fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sys_large_files" >&5 printf "%s\n" "$ac_cv_sys_large_files" >&6; } case $ac_cv_sys_large_files in #( no | unknown) ;; *) printf "%s\n" "#define _LARGE_FILES $ac_cv_sys_large_files" >>confdefs.h ;; esac rm -rf conftest* fi fi if test -n "$GCC" then : CPPFLAGS="-Wshadow -Winline $CPPFLAGS" CPPFLAGS="-Wall -Wunused -Wno-char-subscripts -Wno-format-y2k $CPPFLAGS" fi # Check whether --with-archflags was given. if test ${with_archflags+y} then : withval=$with_archflags; ARCHFLAGS="$withval" else $as_nop if test $uname = Darwin -a $uversion -ge 2000 -a x$enable_debug != xyes then : ARCHFLAGS="-mmacosx-version-min=10.14 -arch x86_64 -arch arm64" else $as_nop ARCHFLAGS="" fi fi { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking if GNOME/KDE desktop is in use" >&5 printf %s "checking if GNOME/KDE desktop is in use... " >&6; } desktopdir="" for dir in /usr/share/applications /usr/share/applnk /etc/X11/applnk; do if test -d $dir then : desktopdir=$dir break fi done if test x$desktopdir = x then : { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: no" >&5 printf "%s\n" "no" >&6; } INSTALLDESKTOP="" UNINSTALLDESKTOP="" else $as_nop { printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: yes" >&5 printf "%s\n" "yes" >&6; } INSTALLDESKTOP="install-desktop" UNINSTALLDESKTOP="uninstall-desktop" fi ac_config_files="$ac_config_files Makefile rasterview.list" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 printf "%s\n" "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test ${\1+y} || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 printf "%s\n" "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { printf "%s\n" "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 printf "%s\n" "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. # # If the first sed substitution is executed (which looks for macros that # take arguments), then branch to the quote section. Otherwise, # look for a macro that doesn't take arguments. ac_script=' :mline /\\$/{ N s,\\\n,, b mline } t clear :clear s/^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*([^)]*)\)[ ]*\(.*\)/-D\1=\2/g t quote s/^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)/-D\1=\2/g t quote b any :quote s/[ `~#$^&*(){}\\|;'\''"<>?]/\\&/g s/\[/\\&/g s/\]/\\&/g s/\$/$$/g H :any ${ g s/^\n// s/\n/ /g p } ' DEFS=`sed -n "$ac_script" confdefs.h` ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`printf "%s\n" "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 printf "%s\n" "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh as_nop=: if test ${ZSH_VERSION+y} && (emulate sh) >/dev/null 2>&1 then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else $as_nop case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi # Reset variables that may have inherited troublesome values from # the environment. # IFS needs to be set, to space, tab, and newline, in precisely that order. # (If _AS_PATH_WALK were called with IFS unset, it would have the # side effect of setting IFS to empty, thus disabling word splitting.) # Quoting is to prevent editors from complaining about space-tab. as_nl=' ' export as_nl IFS=" "" $as_nl" PS1='$ ' PS2='> ' PS4='+ ' # Ensure predictable behavior from utilities with locale-dependent output. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # We cannot yet rely on "unset" to work, but we need these variables # to be unset--not just set to an empty or harmless value--now, to # avoid bugs in old shells (e.g. pre-3.0 UWIN ksh). This construct # also avoids known problems related to "unset" and subshell syntax # in other old shells (e.g. bash 2.01 and pdksh 5.2.14). for as_var in BASH_ENV ENV MAIL MAILPATH CDPATH do eval test \${$as_var+y} \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done # Ensure that fds 0, 1, and 2 are open. if (exec 3>&0) 2>/dev/null; then :; else exec 0&1) 2>/dev/null; then :; else exec 1>/dev/null; fi if (exec 3>&2) ; then :; else exec 2>/dev/null; fi # The user is always right. if ${PATH_SEPARATOR+false} :; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS case $as_dir in #((( '') as_dir=./ ;; */) ;; *) as_dir=$as_dir/ ;; esac test -r "$as_dir$0" && as_myself=$as_dir$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then printf "%s\n" "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi printf "%s\n" "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null then : eval 'as_fn_append () { eval $1+=\$2 }' else $as_nop as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null then : eval 'as_fn_arith () { as_val=$(( $* )) }' else $as_nop as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits # Determine whether it's possible to make 'echo' print without a newline. # These variables are no longer used directly by Autoconf, but are AC_SUBSTed # for compatibility with existing Makefiles. ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac # For backward compatibility with old third-party macros, we provide # the shell variables $as_echo and $as_echo_n. New code should use # AS_ECHO(["message"]) and AS_ECHO_N(["message"]), respectively. as_echo='printf %s\n' as_echo_n='printf %s' rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`printf "%s\n" "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by RasterView $as_me 1.8, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE Configuration files: $config_files Report bugs to . RasterView home page: ." _ACEOF ac_cs_config=`printf "%s\n" "$ac_configure_args" | sed "$ac_safe_unquote"` ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\''/g"` cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ RasterView config.status 1.8 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" Copyright (C) 2021 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) printf "%s\n" "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) printf "%s\n" "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`printf "%s\n" "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --he | --h | --help | --hel | -h ) printf "%s\n" "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \printf "%s\n" "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX printf "%s\n" "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "rasterview.list") CONFIG_FILES="$CONFIG_FILES rasterview.list" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test ${CONFIG_FILES+y} || CONFIG_FILES=$config_files fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" eval set X " :F $CONFIG_FILES " shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`printf "%s\n" "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` printf "%s\n" "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { printf "%s\n" "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 printf "%s\n" "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`printf "%s\n" "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || printf "%s\n" X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`printf "%s\n" "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`printf "%s\n" "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 printf "%s\n" "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 printf "%s\n" "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { printf "%s\n" "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 printf "%s\n" "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi configure.ac000066400000000000000000000064101407457743100133610ustar00rootroot00000000000000# # Configure script for rasterview, a CUPS/PWG Raster viewing program. # # Copyright © 2002-2021 by Michael R Sweet # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. # dnl We need at least autoconf 2.50... AC_PREREQ(2.60) AC_INIT([RasterView], [1.8], [https://github.com/michaelrsweet/rasterview/issues], [rasterview], [https://www.msweet.org/rasterview]) dnl Version number... VERSION="AC_PACKAGE_VERSION" AC_SUBST(VERSION) AC_DEFINE_UNQUOTED(VERSION, "rasterview v$VERSION") dnl Get the operating system and version number... uname=$(uname) uversion=$(uname -r | sed -e '1,$s/[[^0-9]]//g') AS_IF([test "x$uname" = x], [ # MingW doesn't provide any output when uname is run, even with "-s"... uname="CYGWIN" ]) dnl Clear default debugging options and set normal optimization by dnl default unless the user asks for debugging specifically. CFLAGS="${CFLAGS:=}" AC_SUBST([CFLAGS]) CXXFLAGS="${CPPFLAGS:=}" AC_SUBST([CPPFLAGS]) CXXFLAGS="${CXXFLAGS:=}" AC_SUBST([CXXFLAGS]) LDFLAGS="${LDFLAGS:=}" AC_SUBST([LDFLAGS]) LIBS="${LIBS:=}" AC_SUBST([LIBS]) OPTIM="${OPTIM:=}" AC_SUBST([OPTIM]) AC_ARG_ENABLE([debug], AS_HELP_STRING([--enable-debug], [turn on debugging, default=no])) AS_IF([test x$enable_debug = xyes], [ OPTIM="$OPTIM -g" CSFLAGS="" ], [ OPTIM="$OPTIM -g -Os" CSFLAGS="-o runtime" ]) AC_SUBST([CSFLAGS]) dnl Checks for programs... AC_PROG_CC AC_PROG_CXX AC_PATH_PROGS([CODE_SIGN], [codesign true]) AC_PATH_PROG([CP], [cp]) AC_PATH_PROG([MKDIR], [mkdir]) AC_PATH_PROG([RM], [rm]) dnl Check for FLTK... AC_PATH_PROG([FLTKCONFIG], [fltk-config]) AS_IF([test "x$FLTKCONFIG" = x], [ AC_MSG_ERROR([Sorry, rasterview requires FLTK 1.1.x or later.]) ], [ CXXFLAGS="$($FLTKCONFIG --use-images --cflags) $CXXFLAGS" LIBS="$($FLTKCONFIG --use-images --ldflags) $LIBS" ]) AC_SUBST([FLTKCONFIG]) dnl Make sure we include zlib (always available via FLTK) AC_SEARCH_LIBS([gzopen], [z]) dnl Support large files. AC_SYS_LARGEFILE dnl Add -Wall for GCC... AS_IF([test -n "$GCC"], [ dnl Extended warnings... CPPFLAGS="-Wshadow -Winline $CPPFLAGS" dnl Standard warnings... CPPFLAGS="-Wall -Wunused -Wno-char-subscripts -Wno-format-y2k $CPPFLAGS" ]) dnl When doing a release build on current macOS, build fat for Intel and Apple dnl Silicon... AC_ARG_WITH([archflags], AS_HELP_STRING([--with-archflags=...], [Specify architecture options]), [ ARCHFLAGS="$withval" ], [ AS_IF([test $uname = Darwin -a $uversion -ge 2000 -a x$enable_debug != xyes], [ ARCHFLAGS="-mmacosx-version-min=10.14 -arch x86_64 -arch arm64" ], [ ARCHFLAGS="" ]) ]) AC_SUBST([ARCHFLAGS]) dnl See if we have the X11 desktop stuff used by GNOME and KDE... AC_MSG_CHECKING([if GNOME/KDE desktop is in use]) desktopdir="" for dir in /usr/share/applications /usr/share/applnk /etc/X11/applnk; do AS_IF([test -d $dir], [ desktopdir=$dir break ]) done AS_IF([test x$desktopdir = x], [ AC_MSG_RESULT([no]) INSTALLDESKTOP="" UNINSTALLDESKTOP="" ], [ AC_MSG_RESULT([yes]) INSTALLDESKTOP="install-desktop" UNINSTALLDESKTOP="uninstall-desktop" ]) AC_SUBST([desktopdir]) AC_SUBST([INSTALLDESKTOP]) AC_SUBST([UNINSTALLDESKTOP]) dnl Output the makefile... AC_CONFIG_FILES([Makefile rasterview.list]) AC_OUTPUT dmgbuild.png000066400000000000000000000257321407457743100134000ustar00rootroot00000000000000PNG  IHDR09iCCPkCGColorSpaceGenericRGB8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2s=+WQ+]L6O w[C{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5]kjRC%#x=4{mC}?>?y{:_#!' Ѧ{~vPAZꫯo1LJUSwq^=J!w{9 A :k}o& hxN]8Ds6>:s_5bSN)/VYc{k{;;h Q^UG|Y-;.m><bkg̘Q]tQ;F([lq{g_joz;lͰ_\_Zx̌ǽاSOmK/?x58?Wu]kߖsxlE9.b>O?t{G sۗ_~~wkQ E+SO=z=4նx\ѰF\O}%]Vqq1Z>FYK.gA/c߱>y\~ַ9/ulcz׾V#3{V}=s,m)@81"O:;g\pAǶ?Obuy䑍Eڦn:Z7Eo혢Ӛ=:^xb^$J{5:|*# ,c=Q] 4_LK)qE («:Csw󶷽m`>88F٦ckVǾw[WGJ1/nbytl+#w}w>mQ(#F|́}bX1ŶH~?O;{{я~beܱ=W g5hQp qJlULSr[/#'tR㊻aٍUledL%y3xJ+4px>awe]>^΍E:±\}~|;cg>rkln#HE Ol*V,Ƣ,7s̎cT)S_h?w~ܺv7woxGZ sJ{J;qlaCӔǺ};_qX=7p"#)])@8MEXȽ(#EV}[W]u~pE[J+ ŢsT⪭zjUV86{Ǣx;4W {H&QodM)@>sX`#FUGvmM_}y~g}q?_|fX ]Ģ 1"Hu~ 1=w]wm-K-K @P.Wsz?輳fSjۢj6O&M8_L~3gN{ z8gLp K.7~v h "/Vg=í{[7|e-/袎 H{5w^ǹ->E 1bjnVtڢ裏nrZV4BkeOӃ;[+X7h~quZyꫯ.󟷦>)natd{vYfntx8iFUzꩃ+ћQBFٴ(@w}r-7묳Π}o!1p9Fם}]W%wܱ52o(M`H[.=ЎVXay =\>{oa| ,})@Ql,b'\]1oۃ9#Ҫga뮻Yy1vƌƊ1*.Vƭk<]c5Z TŴ=3}b?ov=W,L ?C(g*/ #include "raster.h" #include #include #include #include #include #define DEBUG_printf(x) #define DEBUG_puts(x) /* * Local structures... */ typedef struct _cups_raster_error_s /**** Error buffer structure ****/ { char *start, /* Start of buffer */ *current, /* Current position in buffer */ *end; /* End of buffer */ } _cups_raster_error_t; /* * Local functions... */ static _cups_raster_error_t *get_error_buffer(void); /* * '_cupsRasterAddError()' - Add an error message to the error buffer. */ void _cupsRasterAddError(const char *f, /* I - Printf-style error message */ ...) /* I - Additional arguments as needed */ { _cups_raster_error_t *buf = get_error_buffer(); /* Error buffer */ va_list ap; /* Pointer to additional arguments */ char s[2048]; /* Message string */ ssize_t bytes; /* Bytes in message string */ DEBUG_printf(("_cupsRasterAddError(f=\"%s\", ...)", f)); va_start(ap, f); bytes = vsnprintf(s, sizeof(s), f, ap); va_end(ap); if (bytes <= 0) return; DEBUG_printf(("1_cupsRasterAddError: %s", s)); bytes ++; if ((size_t)bytes >= sizeof(s)) return; if (bytes > (ssize_t)(buf->end - buf->current)) { /* * Allocate more memory... */ char *temp; /* New buffer */ size_t size; /* Size of buffer */ size = (size_t)(buf->end - buf->start + 2 * bytes + 1024); if (buf->start) temp = realloc(buf->start, size); else temp = malloc(size); if (!temp) return; /* * Update pointers... */ buf->end = temp + size; buf->current = temp + (buf->current - buf->start); buf->start = temp; } /* * Append the message to the end of the current string... */ memcpy(buf->current, s, (size_t)bytes); buf->current += bytes - 1; } /* * '_cupsRasterClearError()' - Clear the error buffer. */ void _cupsRasterClearError(void) { _cups_raster_error_t *buf = get_error_buffer(); /* Error buffer */ buf->current = buf->start; if (buf->start) *(buf->start) = '\0'; } /* * 'cupsRasterErrorString()' - Return the last error from a raster function. * * If there are no recent errors, NULL is returned. * * @since CUPS 1.3/macOS 10.5@ */ const char * /* O - Last error */ cupsRasterErrorString(void) { _cups_raster_error_t *buf = get_error_buffer(); /* Error buffer */ if (buf->current == buf->start) return (NULL); else return (buf->start); } #ifdef HAVE_PTHREAD_H /* * Implement per-thread globals... */ # include /* * Local globals... */ static pthread_key_t raster_key = 0; /* Thread local storage key */ static pthread_once_t raster_key_once = PTHREAD_ONCE_INIT; /* One-time initialization object */ /* * Local functions... */ static void raster_init(void); static void raster_destructor(void *value); /* * 'get_error_buffer()' - Return a pointer to thread local storage. */ _cups_raster_error_t * /* O - Pointer to error buffer */ get_error_buffer(void) { _cups_raster_error_t *buf; /* Pointer to error buffer */ /* * Initialize the global data exactly once... */ DEBUG_puts("3get_error_buffer()"); pthread_once(&raster_key_once, raster_init); /* * See if we have allocated the data yet... */ if ((buf = (_cups_raster_error_t *)pthread_getspecific(raster_key)) == NULL) { DEBUG_puts("4get_error_buffer: allocating memory for thread."); /* * No, allocate memory as set the pointer for the key... */ buf = calloc(1, sizeof(_cups_raster_error_t)); pthread_setspecific(raster_key, buf); DEBUG_printf(("4get_error_buffer: buf=%p", (void *)buf)); } /* * Return the pointer to the data... */ return (buf); } /* * 'raster_init()' - Initialize error buffer once. */ static void raster_init(void) { pthread_key_create(&raster_key, raster_destructor); DEBUG_printf(("3raster_init(): raster_key=%x(%u)", (unsigned)raster_key, (unsigned)raster_key)); } /* * 'raster_destructor()' - Free memory allocated by get_error_buffer(). */ static void raster_destructor(void *value) /* I - Data to free */ { _cups_raster_error_t *buf = (_cups_raster_error_t *)value; /* Error buffer */ DEBUG_printf(("3raster_destructor(value=%p)", value)); if (buf->start) free(buf->start); free(value); } #else /* * Implement static globals... */ /* * 'get_error_buffer()' - Return a pointer to thread local storage. */ _cups_raster_error_t * /* O - Pointer to error buffer */ get_error_buffer(void) { static _cups_raster_error_t buf = { 0, 0, 0 }; /* Error buffer */ return (&buf); } #endif /* HAVE_PTHREAD_H */ eyedropper.xbm000066400000000000000000000004571407457743100137660ustar00rootroot00000000000000#define eyedropper_width 16 #define eyedropper_height 16 static unsigned char eyedropper_bits[] = { 0x00, 0x70, 0x00, 0xf8, 0x80, 0xfd, 0xc0, 0xff, 0xc0, 0x7f, 0xc0, 0x3f, 0x60, 0x1e, 0x30, 0x3c, 0x18, 0x3c, 0x0c, 0x1e, 0x06, 0x03, 0x83, 0x01, 0xc5, 0x00, 0x6b, 0x00, 0x35, 0x00, 0x1e, 0x00 }; left.xbm000066400000000000000000000004351407457743100125360ustar00rootroot00000000000000#define left_width 11 #define left_height 16 static unsigned char left_bits[] = { 0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x07, 0xf0, 0x03, 0xf8, 0x01, 0xfc, 0x00, 0x7e, 0x00, 0x7e, 0x00, 0xfc, 0x00, 0xf8, 0x01, 0xf0, 0x03, 0xe0, 0x07, 0xc0, 0x07, 0x80, 0x03, 0x00, 0x00 }; list.xbm000066400000000000000000000004351407457743100125570ustar00rootroot00000000000000#define list_width 16 #define list_height 16 static unsigned char list_bits[] = { 0xe7, 0xff, 0xe7, 0xff, 0xe7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xff, 0xe7, 0xff, 0xe7, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe7, 0xff, 0xe7, 0xff, 0xe7, 0xff, 0x00, 0x00 }; main.cxx000066400000000000000000000014621407457743100125450ustar00rootroot00000000000000// // Raster file viewer for CUPS. // // Copyright 1997-2018 by Michael R Sweet. // // Licensed under Apache License v2.0. See the file "LICENSE" for more // information. // // // Include necessary headers... // #include "RasterView.h" #include #include // // 'main()' - Main entry and processing... // int // O - Exit status main(int argc, // I - Number of command-line arguments char *argv[]) // I - Command-line arguments { int i; // Looping var RasterView *view; // View window Fl::scheme("gtk+"); for (i = 1, view = 0; i < argc; i ++) if (!strncmp(argv[i], "-psn", 4)) break; else view = RasterView::open_file(argv[i]); if (!view) { view = new RasterView(600, 800); view->show(1, argv); } Fl::run(); return (0); } move.xbm000066400000000000000000000004351407457743100125520ustar00rootroot00000000000000#define move_width 16 #define move_height 16 static unsigned char move_bits[] = { 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0x80, 0x01, 0x80, 0x01, 0x84, 0x21, 0x86, 0x61, 0xff, 0xff, 0xff, 0xff, 0x86, 0x61, 0x84, 0x21, 0x80, 0x01, 0x80, 0x01, 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01 }; pwg-raster.desktop000066400000000000000000000002271407457743100145610ustar00rootroot00000000000000[Desktop Entry] Type=MimeType MimeType=image/pwg-raster Icon=rasterview.png Patterns=*.pwg Name=PWG Raster File Comment=PWG Raster File Encoding=UTF-8 raster.c000066400000000000000000001744141407457743100125510ustar00rootroot00000000000000/* * Raster file routines for CUPS. * * Copyright 2007-2018 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * This file is part of the CUPS Imaging library. * * Licensed under Apache License v2.0. See the file "LICENSE" for more * information. */ /* * Include necessary headers... */ /*#include */ #include "raster.h" #include #include #include #include #include #define DEBUG_printf(x) #define DEBUG_puts(x) extern void _cupsRasterAddError(const char *f, ...); extern void _cupsRasterClearError(void); #if defined(WIN32) || defined(__EMX__) # include # include /* for htonl() definition */ #else # include #endif /* WIN32 || __EMX__ */ #ifdef HAVE_STDINT_H # include #endif /* HAVE_STDINT_H */ /* * Private structures... */ struct _cups_raster_s /**** Raster stream data ****/ { unsigned sync; /* Sync word from start of stream */ void *ctx; /* File descriptor */ cups_raster_iocb_t iocb; /* IO callback */ cups_mode_t mode; /* Read/write mode */ cups_page_header2_t header; /* Raster header for current page */ unsigned rowheight, /* Row height in lines */ count, /* Current row run-length count */ remaining, /* Remaining rows in page image */ bpp; /* Bytes per pixel/color */ unsigned char *pixels, /* Pixels for current row */ *pend, /* End of pixel buffer */ *pcurrent; /* Current byte in pixel buffer */ int compressed, /* Non-zero if data is compressed */ swapped; /* Non-zero if data is byte-swapped */ unsigned char *buffer, /* Read/write buffer */ *bufptr, /* Current (read) position in buffer */ *bufend; /* End of current (read) buffer */ size_t bufsize; /* Buffer size */ #ifdef DEBUG size_t iostart, /* Start of read/write buffer */ iocount; /* Number of bytes read/written */ #endif /* DEBUG */ unsigned apple_page_count;/* Apple raster page count */ }; typedef void (*_cups_copyfunc_t)(void *dst, const void *src, size_t bytes); /* * Local globals... */ #ifdef DEBUG static const char * const cups_color_spaces[] = { /* Color spaces */ "CUPS_CSPACE_W", "CUPS_CSPACE_RGB", "CUPS_CSPACE_RGBA", "CUPS_CSPACE_K", "CUPS_CSPACE_CMY", "CUPS_CSPACE_YMC", "CUPS_CSPACE_CMYK", "CUPS_CSPACE_YMCK", "CUPS_CSPACE_KCMY", "CUPS_CSPACE_KCMYcm", "CUPS_CSPACE_GMCK", "CUPS_CSPACE_GMCS", "CUPS_CSPACE_WHITE", "CUPS_CSPACE_GOLD", "CUPS_CSPACE_SILVER", "CUPS_CSPACE_CIEXYZ", "CUPS_CSPACE_CIELab", "CUPS_CSPACE_RGBW", "CUPS_CSPACE_SW", "CUPS_CSPACE_SRGB", "CUPS_CSPACE_ADOBERGB", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30", "31", "CUPS_CSPACE_ICC1", "CUPS_CSPACE_ICC2", "CUPS_CSPACE_ICC3", "CUPS_CSPACE_ICC4", "CUPS_CSPACE_ICC5", "CUPS_CSPACE_ICC6", "CUPS_CSPACE_ICC7", "CUPS_CSPACE_ICC8", "CUPS_CSPACE_ICC9", "CUPS_CSPACE_ICCA", "CUPS_CSPACE_ICCB", "CUPS_CSPACE_ICCC", "CUPS_CSPACE_ICCD", "CUPS_CSPACE_ICCE", "CUPS_CSPACE_ICCF", "47", "CUPS_CSPACE_DEVICE1", "CUPS_CSPACE_DEVICE2", "CUPS_CSPACE_DEVICE3", "CUPS_CSPACE_DEVICE4", "CUPS_CSPACE_DEVICE5", "CUPS_CSPACE_DEVICE6", "CUPS_CSPACE_DEVICE7", "CUPS_CSPACE_DEVICE8", "CUPS_CSPACE_DEVICE9", "CUPS_CSPACE_DEVICEA", "CUPS_CSPACE_DEVICEB", "CUPS_CSPACE_DEVICEC", "CUPS_CSPACE_DEVICED", "CUPS_CSPACE_DEVICEE", "CUPS_CSPACE_DEVICEF" }; static const char * const cups_modes[] = { /* Open modes */ "CUPS_RASTER_READ", "CUPS_RASTER_WRITE", "CUPS_RASTER_WRITE_COMPRESSED", "CUPS_RASTER_WRITE_PWG", "CUPS_RASTER_WRITE_APPLE" }; #endif /* DEBUG */ /* * Local functions... */ static ssize_t cups_raster_io(cups_raster_t *r, unsigned char *buf, size_t bytes); static unsigned cups_raster_read_header(cups_raster_t *r); static ssize_t cups_raster_read(cups_raster_t *r, unsigned char *buf, size_t bytes); static int cups_raster_update(cups_raster_t *r); static ssize_t cups_raster_write(cups_raster_t *r, const unsigned char *pixels); static ssize_t cups_read_fd(void *ctx, unsigned char *buf, size_t bytes); static void cups_swap(unsigned char *buf, size_t bytes); static void cups_swap_copy(unsigned char *dst, const unsigned char *src, size_t bytes); static ssize_t cups_write_fd(void *ctx, unsigned char *buf, size_t bytes); /* * 'rasterOffset()' - Return the offset in the read buffer. */ size_t /* O - Buffered bytes */ rasterOffset(cups_raster_t *r) /* I - Stream */ { return (r->compressed ? r->bufend - r->bufptr : 0); } /* * 'rasterReset()' - Reset the read buffer after a seek. */ void rasterReset(cups_raster_t *r) /* I - Stream to reset */ { r->bufptr = r->buffer; r->bufend = r->buffer; } /* * 'cupsRasterClose()' - Close a raster stream. * * The file descriptor associated with the raster stream must be closed * separately as needed. */ void cupsRasterClose(cups_raster_t *r) /* I - Stream to close */ { if (r != NULL) { if (r->buffer) free(r->buffer); if (r->pixels) free(r->pixels); free(r); } } #if 0 /* * 'cupsRasterInitPWGHeader()' - Initialize a page header for PWG Raster output. * * The "media" argument specifies the media to use. * * The "type" argument specifies a "pwg-raster-document-type-supported" value * that controls the color space and bit depth of the raster data. * * The "xres" and "yres" arguments specify the raster resolution in dots per * inch. * * The "sheet_back" argument specifies a "pwg-raster-document-sheet-back" value * to apply for the back side of a page. Pass @code NULL@ for the front side. * * @since CUPS 2.2/macOS 10.12@ */ int /* O - 1 on success, 0 on failure */ cupsRasterInitPWGHeader( cups_page_header2_t *h, /* I - Page header */ pwg_media_t *media, /* I - PWG media information */ const char *type, /* I - PWG raster type string */ int xdpi, /* I - Cross-feed direction (horizontal) resolution */ int ydpi, /* I - Feed direction (vertical) resolution */ const char *sides, /* I - IPP "sides" option value */ const char *sheet_back) /* I - Transform for back side or @code NULL@ for none */ { if (!h || !media || !type || xdpi <= 0 || ydpi <= 0) { _cupsRasterAddError("%s", strerror(EINVAL)); return (0); } /* * Initialize the page header... */ memset(h, 0, sizeof(cups_page_header2_t)); strlcpy(h->cupsPageSizeName, media->pwg, sizeof(h->cupsPageSizeName)); h->PageSize[0] = (unsigned)(72 * media->width / 2540); h->PageSize[1] = (unsigned)(72 * media->length / 2540); /* This never gets written but is needed for some applications */ h->cupsPageSize[0] = 72.0f * media->width / 2540.0f; h->cupsPageSize[1] = 72.0f * media->length / 2540.0f; h->ImagingBoundingBox[2] = h->PageSize[0]; h->ImagingBoundingBox[3] = h->PageSize[1]; h->HWResolution[0] = (unsigned)xdpi; h->HWResolution[1] = (unsigned)ydpi; h->cupsWidth = (unsigned)(media->width * xdpi / 2540); h->cupsHeight = (unsigned)(media->length * ydpi / 2540); if (h->cupsWidth > 0x00ffffff || h->cupsHeight > 0x00ffffff) { _cupsRasterAddError("Raster dimensions too large."); return (0); } h->cupsInteger[CUPS_RASTER_PWG_ImageBoxRight] = h->cupsWidth; h->cupsInteger[CUPS_RASTER_PWG_ImageBoxBottom] = h->cupsHeight; /* * Colorspace and bytes per line... */ if (!strcmp(type, "adobe-rgb_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 24; h->cupsColorSpace = CUPS_CSPACE_ADOBERGB; } else if (!strcmp(type, "adobe-rgb_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 48; h->cupsColorSpace = CUPS_CSPACE_ADOBERGB; } else if (!strcmp(type, "black_1")) { h->cupsBitsPerColor = 1; h->cupsBitsPerPixel = 1; h->cupsColorSpace = CUPS_CSPACE_K; } else if (!strcmp(type, "black_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 8; h->cupsColorSpace = CUPS_CSPACE_K; } else if (!strcmp(type, "black_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 16; h->cupsColorSpace = CUPS_CSPACE_K; } else if (!strcmp(type, "cmyk_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 32; h->cupsColorSpace = CUPS_CSPACE_CMYK; } else if (!strcmp(type, "cmyk_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 64; h->cupsColorSpace = CUPS_CSPACE_CMYK; } else if (!strncmp(type, "device", 6) && type[6] >= '1' && type[6] <= '9') { int ncolors, bits; /* Number of colors and bits */ if (sscanf(type, "device%d_%d", &ncolors, &bits) != 2 || ncolors > 15 || (bits != 8 && bits != 16)) { _cupsRasterAddError("Unsupported raster type \'%s\'.", type); return (0); } h->cupsBitsPerColor = (unsigned)bits; h->cupsBitsPerPixel = (unsigned)(ncolors * bits); h->cupsColorSpace = (cups_cspace_t)(CUPS_CSPACE_DEVICE1 + ncolors - 1); } else if (!strcmp(type, "rgb_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 24; h->cupsColorSpace = CUPS_CSPACE_RGB; } else if (!strcmp(type, "rgb_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 48; h->cupsColorSpace = CUPS_CSPACE_RGB; } else if (!strcmp(type, "sgray_1")) { h->cupsBitsPerColor = 1; h->cupsBitsPerPixel = 1; h->cupsColorSpace = CUPS_CSPACE_SW; } else if (!strcmp(type, "sgray_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 8; h->cupsColorSpace = CUPS_CSPACE_SW; } else if (!strcmp(type, "sgray_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 16; h->cupsColorSpace = CUPS_CSPACE_SW; } else if (!strcmp(type, "srgb_8")) { h->cupsBitsPerColor = 8; h->cupsBitsPerPixel = 24; h->cupsColorSpace = CUPS_CSPACE_SRGB; } else if (!strcmp(type, "srgb_16")) { h->cupsBitsPerColor = 16; h->cupsBitsPerPixel = 48; h->cupsColorSpace = CUPS_CSPACE_SRGB; } else { _cupsRasterAddError("Unsupported raster type \'%s\'.", type); return (0); } h->cupsColorOrder = CUPS_ORDER_CHUNKED; h->cupsNumColors = h->cupsBitsPerPixel / h->cupsBitsPerColor; h->cupsBytesPerLine = (h->cupsWidth * h->cupsBitsPerPixel + 7) / 8; /* * Duplex support... */ h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 1; h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 1; if (sides) { if (!strcmp(sides, "two-sided-long-edge")) { h->Duplex = 1; } else if (!strcmp(sides, "two-sided-short-edge")) { h->Duplex = 1; h->Tumble = 1; } else if (strcmp(sides, "one-sided")) { _cupsRasterAddError("Unsupported sides value \'%s\'.", sides); return (0); } if (sheet_back) { if (!strcmp(sheet_back, "flipped")) { if (h->Tumble) h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; else h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } else if (!strcmp(sheet_back, "manual-tumble")) { if (h->Tumble) { h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } } else if (!strcmp(sheet_back, "rotated")) { if (!h->Tumble) { h->cupsInteger[CUPS_RASTER_PWG_CrossFeedTransform] = 0xffffffffU; h->cupsInteger[CUPS_RASTER_PWG_FeedTransform] = 0xffffffffU; } } else if (strcmp(sheet_back, "normal")) { _cupsRasterAddError("Unsupported sheet_back value \'%s\'.", sheet_back); return (0); } } } return (1); } #endif /* 0 */ /* * 'cupsRasterOpen()' - Open a raster stream using a file descriptor. * * This function associates a raster stream with the given file descriptor. * For most printer driver filters, "fd" will be 0 (stdin). For most raster * image processor (RIP) filters that generate raster data, "fd" will be 1 * (stdout). * * When writing raster data, the @code CUPS_RASTER_WRITE@, * @code CUPS_RASTER_WRITE_COMPRESS@, or @code CUPS_RASTER_WRITE_PWG@ mode can * be used - compressed and PWG output is generally 25-50% smaller but adds a * 100-300% execution time overhead. */ cups_raster_t * /* O - New stream */ cupsRasterOpen(int fd, /* I - File descriptor */ cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@, @code CUPS_RASTER_WRITE@, @code CUPS_RASTER_WRITE_COMPRESSED@, or @code CUPS_RASTER_WRITE_PWG@ */ { DEBUG_printf(("cupsRasterOpen(fd=%d, mode=%s)", fd, cups_modes[mode])); if (mode == CUPS_RASTER_READ) return (cupsRasterOpenIO(cups_read_fd, (void *)((intptr_t)fd), mode)); else return (cupsRasterOpenIO(cups_write_fd, (void *)((intptr_t)fd), mode)); } /* * 'cupsRasterOpenIO()' - Open a raster stream using a callback function. * * This function associates a raster stream with the given callback function and * context pointer. * * When writing raster data, the @code CUPS_RASTER_WRITE@, * @code CUPS_RASTER_WRITE_COMPRESS@, or @code CUPS_RASTER_WRITE_PWG@ mode can * be used - compressed and PWG output is generally 25-50% smaller but adds a * 100-300% execution time overhead. */ cups_raster_t * /* O - New stream */ cupsRasterOpenIO( cups_raster_iocb_t iocb, /* I - Read/write callback */ void *ctx, /* I - Context pointer for callback */ cups_mode_t mode) /* I - Mode - @code CUPS_RASTER_READ@, @code CUPS_RASTER_WRITE@, @code CUPS_RASTER_WRITE_COMPRESSED@, or @code CUPS_RASTER_WRITE_PWG@ */ { cups_raster_t *r; /* New stream */ DEBUG_printf(("cupsRasterOpenIO(iocb=%p, ctx=%p, mode=%s)", (void *)iocb, ctx, cups_modes[mode])); _cupsRasterClearError(); if ((r = calloc(sizeof(cups_raster_t), 1)) == NULL) { _cupsRasterAddError("Unable to allocate memory for raster stream: %s\n", strerror(errno)); DEBUG_puts("1cupsRasterOpenIO: Returning NULL."); return (NULL); } r->ctx = ctx; r->iocb = iocb; r->mode = mode; if (mode == CUPS_RASTER_READ) { /* * Open for read - get sync word... */ if (cups_raster_io(r, (unsigned char *)&(r->sync), sizeof(r->sync)) != sizeof(r->sync)) { _cupsRasterAddError("Unable to read header from raster stream: %s\n", strerror(errno)); free(r); DEBUG_puts("1cupsRasterOpenIO: Unable to read header, returning NULL."); return (NULL); } if (r->sync != CUPS_RASTER_SYNC && r->sync != CUPS_RASTER_REVSYNC && r->sync != CUPS_RASTER_SYNCv1 && r->sync != CUPS_RASTER_REVSYNCv1 && r->sync != CUPS_RASTER_SYNCv2 && r->sync != CUPS_RASTER_REVSYNCv2 && r->sync != CUPS_RASTER_SYNCapple && r->sync != CUPS_RASTER_REVSYNCapple) { _cupsRasterAddError("Unknown raster format %08x!\n", r->sync); free(r); DEBUG_puts("1cupsRasterOpenIO: Unknown format, returning NULL."); return (NULL); } if (r->sync == CUPS_RASTER_SYNCv2 || r->sync == CUPS_RASTER_REVSYNCv2 || r->sync == CUPS_RASTER_SYNCapple || r->sync == CUPS_RASTER_REVSYNCapple) r->compressed = 1; DEBUG_printf(("1cupsRasterOpenIO: sync=%08x", r->sync)); if (r->sync == CUPS_RASTER_REVSYNC || r->sync == CUPS_RASTER_REVSYNCv1 || r->sync == CUPS_RASTER_REVSYNCv2 || r->sync == CUPS_RASTER_REVSYNCapple) r->swapped = 1; if (r->sync == CUPS_RASTER_SYNCapple || r->sync == CUPS_RASTER_REVSYNCapple) { unsigned char header[8]; /* File header */ if (cups_raster_io(r, (unsigned char *)header, sizeof(header)) != sizeof(header)) { _cupsRasterAddError("Unable to read header from raster stream: %s\n", strerror(errno)); free(r); DEBUG_puts("1cupsRasterOpenIO: Unable to read header, returning NULL."); return (NULL); } } #ifdef DEBUG r->iostart = r->iocount; #endif /* DEBUG */ } else { /* * Open for write - put sync word... */ switch (mode) { default : case CUPS_RASTER_WRITE : r->sync = CUPS_RASTER_SYNC; break; case CUPS_RASTER_WRITE_COMPRESSED : r->compressed = 1; r->sync = CUPS_RASTER_SYNCv2; break; case CUPS_RASTER_WRITE_PWG : r->compressed = 1; r->sync = htonl(CUPS_RASTER_SYNC_PWG); r->swapped = r->sync != CUPS_RASTER_SYNC_PWG; break; case CUPS_RASTER_WRITE_APPLE : r->compressed = 1; r->sync = htonl(CUPS_RASTER_SYNCapple); r->swapped = r->sync != CUPS_RASTER_SYNCapple; r->apple_page_count = 0xffffffffU; break; } if (cups_raster_io(r, (unsigned char *)&(r->sync), sizeof(r->sync)) < (ssize_t)sizeof(r->sync)) { _cupsRasterAddError("Unable to write raster stream header: %s\n", strerror(errno)); free(r); DEBUG_puts("1cupsRasterOpenIO: Unable to write header, returning NULL."); return (NULL); } } DEBUG_printf(("1cupsRasterOpenIO: compressed=%d, swapped=%d, returning %p", r->compressed, r->swapped, (void *)r)); return (r); } /* * 'cupsRasterReadHeader()' - Read a raster page header and store it in a * version 1 page header structure. * * This function is deprecated. Use @link cupsRasterReadHeader2@ instead. * * Version 1 page headers were used in CUPS 1.0 and 1.1 and contain a subset * of the version 2 page header data. This function handles reading version 2 * page headers and copying only the version 1 data into the provided buffer. * * @deprecated@ */ unsigned /* O - 1 on success, 0 on failure/end-of-file */ cupsRasterReadHeader( cups_raster_t *r, /* I - Raster stream */ cups_page_header_t *h) /* I - Pointer to header data */ { DEBUG_printf(("cupsRasterReadHeader(r=%p, h=%p)", (void *)r, (void *)h)); /* * Get the raster header... */ if (!cups_raster_read_header(r)) { memset(h, 0, sizeof(cups_page_header_t)); DEBUG_puts("1cupsRasterReadHeader: Unable to read page header, returning 0."); return (0); } /* * Copy the header to the user-supplied buffer... */ memcpy(h, &(r->header), sizeof(cups_page_header_t)); DEBUG_printf(("1cupsRasterReadHeader: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace])); DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerColor=%u", h->cupsBitsPerColor)); DEBUG_printf(("1cupsRasterReadHeader: cupsBitsPerPixel=%u", h->cupsBitsPerPixel)); DEBUG_printf(("1cupsRasterReadHeader: cupsBytesPerLine=%u", h->cupsBytesPerLine)); DEBUG_printf(("1cupsRasterReadHeader: cupsWidth=%u", h->cupsWidth)); DEBUG_printf(("1cupsRasterReadHeader: cupsHeight=%u", h->cupsHeight)); DEBUG_puts("1cupsRasterReadHeader: Returning 1."); return (1); } /* * 'cupsRasterReadHeader2()' - Read a raster page header and store it in a * version 2 page header structure. * * @since CUPS 1.2/macOS 10.5@ */ unsigned /* O - 1 on success, 0 on failure/end-of-file */ cupsRasterReadHeader2( cups_raster_t *r, /* I - Raster stream */ cups_page_header2_t *h) /* I - Pointer to header data */ { /* * Get the raster header... */ DEBUG_printf(("cupsRasterReadHeader2(r=%p, h=%p)", (void *)r, (void *)h)); if (!cups_raster_read_header(r)) { memset(h, 0, sizeof(cups_page_header2_t)); DEBUG_puts("1cupsRasterReadHeader2: Unable to read header, returning 0."); return (0); } /* * Copy the header to the user-supplied buffer... */ memcpy(h, &(r->header), sizeof(cups_page_header2_t)); DEBUG_printf(("1cupsRasterReadHeader2: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace])); DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerColor=%u", h->cupsBitsPerColor)); DEBUG_printf(("1cupsRasterReadHeader2: cupsBitsPerPixel=%u", h->cupsBitsPerPixel)); DEBUG_printf(("1cupsRasterReadHeader2: cupsBytesPerLine=%u", h->cupsBytesPerLine)); DEBUG_printf(("1cupsRasterReadHeader2: cupsWidth=%u", h->cupsWidth)); DEBUG_printf(("1cupsRasterReadHeader2: cupsHeight=%u", h->cupsHeight)); DEBUG_puts("1cupsRasterReadHeader2: Returning 1."); return (1); } /* * 'cupsRasterReadPixels()' - Read raster pixels. * * For best performance, filters should read one or more whole lines. * The "cupsBytesPerLine" value from the page header can be used to allocate * the line buffer and as the number of bytes to read. */ unsigned /* O - Number of bytes read */ cupsRasterReadPixels(cups_raster_t *r, /* I - Raster stream */ unsigned char *p, /* I - Pointer to pixel buffer */ unsigned len) /* I - Number of bytes to read */ { ssize_t bytes; /* Bytes read */ unsigned cupsBytesPerLine; /* cupsBytesPerLine value */ unsigned remaining; /* Bytes remaining */ unsigned char *ptr, /* Pointer to read buffer */ byte, /* Byte from file */ *temp; /* Pointer into buffer */ unsigned count; /* Repetition count */ DEBUG_printf(("cupsRasterReadPixels(r=%p, p=%p, len=%u)", (void *)r, (void *)p, len)); if (r == NULL || r->mode != CUPS_RASTER_READ || r->remaining == 0 || r->header.cupsBytesPerLine == 0) { DEBUG_puts("1cupsRasterReadPixels: Returning 0."); return (0); } DEBUG_printf(("1cupsRasterReadPixels: compressed=%d, remaining=%u", r->compressed, r->remaining)); if (!r->compressed) { /* * Read without compression... */ r->remaining -= len / r->header.cupsBytesPerLine; if (cups_raster_io(r, p, len) < (ssize_t)len) { DEBUG_puts("1cupsRasterReadPixels: Read error, returning 0."); return (0); } /* * Swap bytes as needed... */ if (r->swapped && (r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16)) cups_swap(p, len); /* * Return... */ DEBUG_printf(("1cupsRasterReadPixels: Returning %u", len)); return (len); } /* * Read compressed data... */ remaining = len; cupsBytesPerLine = r->header.cupsBytesPerLine; while (remaining > 0 && r->remaining > 0) { if (r->count == 0) { /* * Need to read a new row... */ if (remaining == cupsBytesPerLine) ptr = p; else ptr = r->pixels; /* * Read using a modified PackBits compression... */ if (!cups_raster_read(r, &byte, 1)) { DEBUG_puts("1cupsRasterReadPixels: Read error, returning 0."); return (0); } r->count = (unsigned)byte + 1; if (r->count > 1) ptr = r->pixels; temp = ptr; bytes = (ssize_t)cupsBytesPerLine; while (bytes > 0) { /* * Get a new repeat count... */ if (!cups_raster_read(r, &byte, 1)) { DEBUG_puts("1cupsRasterReadPixels: Read error, returning 0."); return (0); } if (byte == 128) { /* * Clear to end of line... */ switch (r->header.cupsColorSpace) { case CUPS_CSPACE_W : case CUPS_CSPACE_RGB : case CUPS_CSPACE_SW : case CUPS_CSPACE_SRGB : case CUPS_CSPACE_RGBW : case CUPS_CSPACE_ADOBERGB : memset(temp, 0xff, (size_t)bytes); break; default : memset(temp, 0x00, (size_t)bytes); break; } temp += bytes; bytes = 0; } else if (byte & 128) { /* * Copy N literal pixels... */ count = (unsigned)(257 - byte) * r->bpp; if (count > (unsigned)bytes) count = (unsigned)bytes; if (!cups_raster_read(r, temp, count)) { DEBUG_puts("1cupsRasterReadPixels: Read error, returning 0."); return (0); } temp += count; bytes -= (ssize_t)count; } else { /* * Repeat the next N bytes... */ count = ((unsigned)byte + 1) * r->bpp; if (count > (unsigned)bytes) count = (unsigned)bytes; if (count < r->bpp) break; bytes -= (ssize_t)count; if (!cups_raster_read(r, temp, r->bpp)) { DEBUG_puts("1cupsRasterReadPixels: Read error, returning 0."); return (0); } temp += r->bpp; count -= r->bpp; while (count > 0) { memcpy(temp, temp - r->bpp, r->bpp); temp += r->bpp; count -= r->bpp; } } } /* * Swap bytes as needed... */ if ((r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16) && r->swapped) { DEBUG_puts("1cupsRasterReadPixels: Swapping bytes."); cups_swap(ptr, (size_t)cupsBytesPerLine); } /* * Update pointers... */ if (remaining >= cupsBytesPerLine) { bytes = (ssize_t)cupsBytesPerLine; r->pcurrent = r->pixels; r->count --; r->remaining --; } else { bytes = (ssize_t)remaining; r->pcurrent = r->pixels + bytes; } /* * Copy data as needed... */ if (ptr != p) memcpy(p, ptr, (size_t)bytes); } else { /* * Copy fragment from buffer... */ if ((unsigned)(bytes = (int)(r->pend - r->pcurrent)) > remaining) bytes = (ssize_t)remaining; memcpy(p, r->pcurrent, (size_t)bytes); r->pcurrent += bytes; if (r->pcurrent >= r->pend) { r->pcurrent = r->pixels; r->count --; r->remaining --; } } remaining -= (unsigned)bytes; p += bytes; } DEBUG_printf(("1cupsRasterReadPixels: Returning %u", len)); return (len); } /* * 'cupsRasterWriteHeader()' - Write a raster page header from a version 1 page * header structure. * * This function is deprecated. Use @link cupsRasterWriteHeader2@ instead. * * @deprecated@ */ unsigned /* O - 1 on success, 0 on failure */ cupsRasterWriteHeader( cups_raster_t *r, /* I - Raster stream */ cups_page_header_t *h) /* I - Raster page header */ { DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h)); if (r == NULL || r->mode == CUPS_RASTER_READ) { DEBUG_puts("1cupsRasterWriteHeader: Returning 0."); return (0); } DEBUG_printf(("1cupsRasterWriteHeader: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace])); DEBUG_printf(("1cupsRasterWriteHeader: cupsBitsPerColor=%u", h->cupsBitsPerColor)); DEBUG_printf(("1cupsRasterWriteHeader: cupsBitsPerPixel=%u", h->cupsBitsPerPixel)); DEBUG_printf(("1cupsRasterWriteHeader: cupsBytesPerLine=%u", h->cupsBytesPerLine)); DEBUG_printf(("1cupsRasterWriteHeader: cupsWidth=%u", h->cupsWidth)); DEBUG_printf(("1cupsRasterWriteHeader: cupsHeight=%u", h->cupsHeight)); /* * Make a copy of the header, and compute the number of raster * lines in the page image... */ memset(&(r->header), 0, sizeof(r->header)); memcpy(&(r->header), h, sizeof(cups_page_header_t)); if (!cups_raster_update(r)) { DEBUG_puts("1cupsRasterWriteHeader: Unable to update parameters, returning 0."); return (0); } if (r->mode == CUPS_RASTER_WRITE_APPLE) { r->rowheight = h->HWResolution[0] / h->HWResolution[1]; if (h->HWResolution[0] != (r->rowheight * h->HWResolution[1])) return (0); } else r->rowheight = 1; /* * Write the raster header... */ if (r->mode == CUPS_RASTER_WRITE_PWG) { /* * PWG raster data is always network byte order with much of the page header * zeroed. */ cups_page_header2_t fh; /* File page header */ memset(&fh, 0, sizeof(fh)); strncpy(fh.MediaClass, "PwgRaster", sizeof(fh.MediaClass) - 1); /* PwgRaster */ strncpy(fh.MediaColor, r->header.MediaColor, sizeof(fh.MediaColor) - 1); strncpy(fh.MediaType, r->header.MediaType, sizeof(fh.MediaType) - 1); strncpy(fh.OutputType, r->header.OutputType, sizeof(fh.OutputType) - 1); /* PrintContentType */ fh.CutMedia = htonl(r->header.CutMedia); fh.Duplex = htonl(r->header.Duplex); fh.HWResolution[0] = htonl(r->header.HWResolution[0]); fh.HWResolution[1] = htonl(r->header.HWResolution[1]); fh.ImagingBoundingBox[0] = htonl(r->header.ImagingBoundingBox[0]); fh.ImagingBoundingBox[1] = htonl(r->header.ImagingBoundingBox[1]); fh.ImagingBoundingBox[2] = htonl(r->header.ImagingBoundingBox[2]); fh.ImagingBoundingBox[3] = htonl(r->header.ImagingBoundingBox[3]); fh.InsertSheet = htonl(r->header.InsertSheet); fh.Jog = htonl(r->header.Jog); fh.LeadingEdge = htonl(r->header.LeadingEdge); fh.ManualFeed = htonl(r->header.ManualFeed); fh.MediaPosition = htonl(r->header.MediaPosition); fh.MediaWeight = htonl(r->header.MediaWeight); fh.NumCopies = htonl(r->header.NumCopies); fh.Orientation = htonl(r->header.Orientation); fh.PageSize[0] = htonl(r->header.PageSize[0]); fh.PageSize[1] = htonl(r->header.PageSize[1]); fh.Tumble = htonl(r->header.Tumble); fh.cupsWidth = htonl(r->header.cupsWidth); fh.cupsHeight = htonl(r->header.cupsHeight); fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor); fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel); fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine); fh.cupsColorOrder = htonl(r->header.cupsColorOrder); fh.cupsColorSpace = htonl(r->header.cupsColorSpace); fh.cupsNumColors = htonl(r->header.cupsNumColors); fh.cupsInteger[0] = htonl(r->header.cupsInteger[0]); /* TotalPageCount */ fh.cupsInteger[1] = htonl(r->header.cupsInteger[1]); /* CrossFeedTransform */ fh.cupsInteger[2] = htonl(r->header.cupsInteger[2]); /* FeedTransform */ fh.cupsInteger[3] = htonl(r->header.cupsInteger[3]); /* ImageBoxLeft */ fh.cupsInteger[4] = htonl(r->header.cupsInteger[4]); /* ImageBoxTop */ fh.cupsInteger[5] = htonl(r->header.cupsInteger[5]); /* ImageBoxRight */ fh.cupsInteger[6] = htonl(r->header.cupsInteger[6]); /* ImageBoxBottom */ fh.cupsInteger[7] = htonl(r->header.cupsInteger[7]); /* BlackPrimary */ fh.cupsInteger[8] = htonl(r->header.cupsInteger[8]); /* PrintQuality */ fh.cupsInteger[14] = htonl(r->header.cupsInteger[14]); /* VendorIdentifier */ fh.cupsInteger[15] = htonl(r->header.cupsInteger[15]); /* VendorLength */ void *dst = fh.cupsReal; /* Bypass bogus compiler warning */ void *src = r->header.cupsReal; memcpy(dst, src, sizeof(fh.cupsReal) + sizeof(fh.cupsString)); /* VendorData */ strncpy(fh.cupsRenderingIntent, r->header.cupsRenderingIntent, sizeof(fh.cupsRenderingIntent) - 1); strncpy(fh.cupsPageSizeName, r->header.cupsPageSizeName, sizeof(fh.cupsPageSizeName) - 1); return (cups_raster_io(r, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh)); } else if (r->mode == CUPS_RASTER_WRITE_APPLE) { /* * Raw raster data is always network byte order with most of the page header * zeroed. */ unsigned char appleheader[32]; /* Raw page header */ if (r->apple_page_count == 0xffffffffU) { /* * Write raw page count from raster page header... */ r->apple_page_count = r->header.cupsInteger[0]; appleheader[0] = 'A'; appleheader[1] = 'S'; appleheader[2] = 'T'; appleheader[3] = 0; appleheader[4] = (unsigned char)(r->apple_page_count >> 24); appleheader[5] = (unsigned char)(r->apple_page_count >> 16); appleheader[6] = (unsigned char)(r->apple_page_count >> 8); appleheader[7] = (unsigned char)(r->apple_page_count); if (cups_raster_io(r, appleheader, 8) != 8) return (0); } memset(appleheader, 0, sizeof(appleheader)); appleheader[0] = (unsigned char)r->header.cupsBitsPerPixel; appleheader[1] = r->header.cupsColorSpace == CUPS_CSPACE_SRGB ? 1 : r->header.cupsColorSpace == CUPS_CSPACE_RGBW ? 2 : r->header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ? 3 : r->header.cupsColorSpace == CUPS_CSPACE_W ? 4 : r->header.cupsColorSpace == CUPS_CSPACE_RGB ? 5 : r->header.cupsColorSpace == CUPS_CSPACE_CMYK ? 6 : 0; appleheader[12] = (unsigned char)(r->header.cupsWidth >> 24); appleheader[13] = (unsigned char)(r->header.cupsWidth >> 16); appleheader[14] = (unsigned char)(r->header.cupsWidth >> 8); appleheader[15] = (unsigned char)(r->header.cupsWidth); appleheader[16] = (unsigned char)(r->header.cupsHeight >> 24); appleheader[17] = (unsigned char)(r->header.cupsHeight >> 16); appleheader[18] = (unsigned char)(r->header.cupsHeight >> 8); appleheader[19] = (unsigned char)(r->header.cupsHeight); appleheader[20] = (unsigned char)(r->header.HWResolution[0] >> 24); appleheader[21] = (unsigned char)(r->header.HWResolution[0] >> 16); appleheader[22] = (unsigned char)(r->header.HWResolution[0] >> 8); appleheader[23] = (unsigned char)(r->header.HWResolution[0]); return (cups_raster_io(r, appleheader, sizeof(appleheader)) == sizeof(appleheader)); } else return (cups_raster_io(r, (unsigned char *)&(r->header), sizeof(r->header)) == sizeof(r->header)); } /* * 'cupsRasterWriteHeader2()' - Write a raster page header from a version 2 * page header structure. * * The page header can be initialized using @link cupsRasterInitPWGHeader@. * * @since CUPS 1.2/macOS 10.5@ */ unsigned /* O - 1 on success, 0 on failure */ cupsRasterWriteHeader2( cups_raster_t *r, /* I - Raster stream */ cups_page_header2_t *h) /* I - Raster page header */ { DEBUG_printf(("cupsRasterWriteHeader(r=%p, h=%p)", (void *)r, (void *)h)); if (r == NULL || r->mode == CUPS_RASTER_READ) { DEBUG_puts("1cupsRasterWriteHeader2: Returning 0."); return (0); } DEBUG_printf(("1cupsRasterWriteHeader2: cupsColorSpace=%s", cups_color_spaces[h->cupsColorSpace])); DEBUG_printf(("1cupsRasterWriteHeader2: cupsBitsPerColor=%u", h->cupsBitsPerColor)); DEBUG_printf(("1cupsRasterWriteHeader2: cupsBitsPerPixel=%u", h->cupsBitsPerPixel)); DEBUG_printf(("1cupsRasterWriteHeader2: cupsBytesPerLine=%u", h->cupsBytesPerLine)); DEBUG_printf(("1cupsRasterWriteHeader2: cupsWidth=%u", h->cupsWidth)); DEBUG_printf(("1cupsRasterWriteHeader2: cupsHeight=%u", h->cupsHeight)); /* * Make a copy of the header, and compute the number of raster * lines in the page image... */ memcpy(&(r->header), h, sizeof(cups_page_header2_t)); if (!cups_raster_update(r)) { DEBUG_puts("1cupsRasterWriteHeader: Unable to update parameters, returning 0."); return (0); } if (r->mode == CUPS_RASTER_WRITE_APPLE) { r->rowheight = h->HWResolution[0] / h->HWResolution[1]; if (h->HWResolution[0] != (r->rowheight * h->HWResolution[1])) return (0); } else r->rowheight = 1; /* * Write the raster header... */ if (r->mode == CUPS_RASTER_WRITE_PWG) { /* * PWG raster data is always network byte order with most of the page header * zeroed. */ cups_page_header2_t fh; /* File page header */ memset(&fh, 0, sizeof(fh)); strncpy(fh.MediaClass, "PwgRaster", sizeof(fh.MediaClass) - 1); strncpy(fh.MediaColor, r->header.MediaColor, sizeof(fh.MediaColor) - 1); strncpy(fh.MediaType, r->header.MediaType, sizeof(fh.MediaType) - 1); strncpy(fh.OutputType, r->header.OutputType, sizeof(fh.OutputType) - 1); strncpy(fh.cupsRenderingIntent, r->header.cupsRenderingIntent, sizeof(fh.cupsRenderingIntent) - 1); strncpy(fh.cupsPageSizeName, r->header.cupsPageSizeName, sizeof(fh.cupsPageSizeName) - 1); fh.CutMedia = htonl(r->header.CutMedia); fh.Duplex = htonl(r->header.Duplex); fh.HWResolution[0] = htonl(r->header.HWResolution[0]); fh.HWResolution[1] = htonl(r->header.HWResolution[1]); fh.ImagingBoundingBox[0] = htonl(r->header.ImagingBoundingBox[0]); fh.ImagingBoundingBox[1] = htonl(r->header.ImagingBoundingBox[1]); fh.ImagingBoundingBox[2] = htonl(r->header.ImagingBoundingBox[2]); fh.ImagingBoundingBox[3] = htonl(r->header.ImagingBoundingBox[3]); fh.InsertSheet = htonl(r->header.InsertSheet); fh.Jog = htonl(r->header.Jog); fh.LeadingEdge = htonl(r->header.LeadingEdge); fh.ManualFeed = htonl(r->header.ManualFeed); fh.MediaPosition = htonl(r->header.MediaPosition); fh.MediaWeight = htonl(r->header.MediaWeight); fh.NumCopies = htonl(r->header.NumCopies); fh.Orientation = htonl(r->header.Orientation); fh.PageSize[0] = htonl(r->header.PageSize[0]); fh.PageSize[1] = htonl(r->header.PageSize[1]); fh.Tumble = htonl(r->header.Tumble); fh.cupsWidth = htonl(r->header.cupsWidth); fh.cupsHeight = htonl(r->header.cupsHeight); fh.cupsBitsPerColor = htonl(r->header.cupsBitsPerColor); fh.cupsBitsPerPixel = htonl(r->header.cupsBitsPerPixel); fh.cupsBytesPerLine = htonl(r->header.cupsBytesPerLine); fh.cupsColorOrder = htonl(r->header.cupsColorOrder); fh.cupsColorSpace = htonl(r->header.cupsColorSpace); fh.cupsNumColors = htonl(r->header.cupsNumColors); fh.cupsInteger[0] = htonl(r->header.cupsInteger[0]); fh.cupsInteger[1] = htonl(r->header.cupsInteger[1]); fh.cupsInteger[2] = htonl(r->header.cupsInteger[2]); fh.cupsInteger[3] = htonl((unsigned)(r->header.cupsImagingBBox[0] * r->header.HWResolution[0] / 72.0)); fh.cupsInteger[4] = htonl((unsigned)(r->header.cupsImagingBBox[1] * r->header.HWResolution[1] / 72.0)); fh.cupsInteger[5] = htonl((unsigned)(r->header.cupsImagingBBox[2] * r->header.HWResolution[0] / 72.0)); fh.cupsInteger[6] = htonl((unsigned)(r->header.cupsImagingBBox[3] * r->header.HWResolution[1] / 72.0)); fh.cupsInteger[7] = htonl(0xffffff); return (cups_raster_io(r, (unsigned char *)&fh, sizeof(fh)) == sizeof(fh)); } else if (r->mode == CUPS_RASTER_WRITE_APPLE) { /* * Raw raster data is always network byte order with most of the page header * zeroed. */ unsigned char appleheader[32]; /* Raw page header */ unsigned height = r->header.cupsHeight * r->rowheight; /* Computed page height */ if (r->apple_page_count == 0xffffffffU) { /* * Write raw page count from raster page header... */ r->apple_page_count = r->header.cupsInteger[0]; appleheader[0] = 'A'; appleheader[1] = 'S'; appleheader[2] = 'T'; appleheader[3] = 0; appleheader[4] = (unsigned char)(r->apple_page_count >> 24); appleheader[5] = (unsigned char)(r->apple_page_count >> 16); appleheader[6] = (unsigned char)(r->apple_page_count >> 8); appleheader[7] = (unsigned char)(r->apple_page_count); if (cups_raster_io(r, appleheader, 8) != 8) return (0); } memset(appleheader, 0, sizeof(appleheader)); appleheader[0] = (unsigned char)r->header.cupsBitsPerPixel; appleheader[1] = r->header.cupsColorSpace == CUPS_CSPACE_SRGB ? 1 : r->header.cupsColorSpace == CUPS_CSPACE_RGBW ? 2 : r->header.cupsColorSpace == CUPS_CSPACE_ADOBERGB ? 3 : r->header.cupsColorSpace == CUPS_CSPACE_W ? 4 : r->header.cupsColorSpace == CUPS_CSPACE_RGB ? 5 : r->header.cupsColorSpace == CUPS_CSPACE_CMYK ? 6 : 0; appleheader[12] = (unsigned char)(r->header.cupsWidth >> 24); appleheader[13] = (unsigned char)(r->header.cupsWidth >> 16); appleheader[14] = (unsigned char)(r->header.cupsWidth >> 8); appleheader[15] = (unsigned char)(r->header.cupsWidth); appleheader[16] = (unsigned char)(height >> 24); appleheader[17] = (unsigned char)(height >> 16); appleheader[18] = (unsigned char)(height >> 8); appleheader[19] = (unsigned char)(height); appleheader[20] = (unsigned char)(r->header.HWResolution[0] >> 24); appleheader[21] = (unsigned char)(r->header.HWResolution[0] >> 16); appleheader[22] = (unsigned char)(r->header.HWResolution[0] >> 8); appleheader[23] = (unsigned char)(r->header.HWResolution[0]); return (cups_raster_io(r, appleheader, sizeof(appleheader)) == sizeof(appleheader)); } else return (cups_raster_io(r, (unsigned char *)&(r->header), sizeof(r->header)) == sizeof(r->header)); } /* * 'cupsRasterWritePixels()' - Write raster pixels. * * For best performance, filters should write one or more whole lines. * The "cupsBytesPerLine" value from the page header can be used to allocate * the line buffer and as the number of bytes to write. */ unsigned /* O - Number of bytes written */ cupsRasterWritePixels(cups_raster_t *r, /* I - Raster stream */ unsigned char *p, /* I - Bytes to write */ unsigned len)/* I - Number of bytes to write */ { ssize_t bytes; /* Bytes read */ unsigned remaining; /* Bytes remaining */ DEBUG_printf(("cupsRasterWritePixels(r=%p, p=%p, len=%u), remaining=%u", (void *)r, (void *)p, len, r->remaining)); if (r == NULL || r->mode == CUPS_RASTER_READ || r->remaining == 0) return (0); if (!r->compressed) { /* * Without compression, just write the raster data raw unless the data needs * to be swapped... */ r->remaining -= len / r->header.cupsBytesPerLine; if (r->swapped && (r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16)) { unsigned char *bufptr; /* Pointer into write buffer */ /* * Allocate a write buffer as needed... */ if ((size_t)len > r->bufsize) { if (r->buffer) bufptr = realloc(r->buffer, len); else bufptr = malloc(len); if (!bufptr) return (0); r->buffer = bufptr; r->bufsize = len; } /* * Byte swap the pixels and write them... */ cups_swap_copy(r->buffer, p, len); bytes = cups_raster_io(r, r->buffer, len); } else bytes = cups_raster_io(r, p, len); if (bytes < len) return (0); else return (len); } /* * Otherwise, compress each line... */ for (remaining = len; remaining > 0; remaining -= (unsigned)bytes, p += bytes) { /* * Figure out the number of remaining bytes on the current line... */ if ((bytes = (ssize_t)remaining) > (ssize_t)(r->pend - r->pcurrent)) bytes = (ssize_t)(r->pend - r->pcurrent); if (r->count > 0) { /* * Check to see if this line is the same as the previous line... */ if (memcmp(p, r->pcurrent, (size_t)bytes)) { if (cups_raster_write(r, r->pixels) <= 0) return (0); r->count = 0; } else { /* * Mark more bytes as the same... */ r->pcurrent += bytes; if (r->pcurrent >= r->pend) { /* * Increase the repeat count... */ r->count += r->rowheight; r->pcurrent = r->pixels; /* * Flush out this line if it is the last one... */ r->remaining --; if (r->remaining == 0) { if (cups_raster_write(r, r->pixels) <= 0) return (0); else return (len); } else if (r->count > (256 - r->rowheight)) { if (cups_raster_write(r, r->pixels) <= 0) return (0); r->count = 0; } } continue; } } if (r->count == 0) { /* * Copy the raster data to the buffer... */ memcpy(r->pcurrent, p, (size_t)bytes); r->pcurrent += bytes; if (r->pcurrent >= r->pend) { /* * Increase the repeat count... */ r->count += r->rowheight; r->pcurrent = r->pixels; /* * Flush out this line if it is the last one... */ r->remaining --; if (r->remaining == 0) { if (cups_raster_write(r, r->pixels) <= 0) return (0); } } } } return (len); } /* * 'cups_raster_read_header()' - Read a raster page header. */ static unsigned /* O - 1 on success, 0 on fail */ cups_raster_read_header( cups_raster_t *r) /* I - Raster stream */ { size_t len; /* Length for read/swap */ DEBUG_printf(("3cups_raster_read_header(r=%p), r->mode=%s", (void *)r, r ? cups_modes[r->mode] : "")); if (r == NULL || r->mode != CUPS_RASTER_READ) return (0); DEBUG_printf(("4cups_raster_read_header: r->iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount)); memset(&(r->header), 0, sizeof(r->header)); /* * Read the header... */ switch (r->sync) { default : /* * Get the length of the raster header... */ if (r->sync == CUPS_RASTER_SYNCv1 || r->sync == CUPS_RASTER_REVSYNCv1) len = sizeof(cups_page_header_t); else len = sizeof(cups_page_header2_t); DEBUG_printf(("4cups_raster_read_header: len=%d", (int)len)); /* * Read it... */ if (cups_raster_read(r, (unsigned char *)&(r->header), len) < (ssize_t)len) { DEBUG_printf(("4cups_raster_read_header: EOF, r->iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount)); return (0); } /* * Swap bytes as needed... */ if (r->swapped) { unsigned *s, /* Current word */ temp; /* Temporary copy */ DEBUG_puts("4cups_raster_read_header: Swapping header bytes."); for (len = 81, s = &(r->header.AdvanceDistance); len > 0; len --, s ++) { temp = *s; *s = ((temp & 0xff) << 24) | ((temp & 0xff00) << 8) | ((temp & 0xff0000) >> 8) | ((temp & 0xff000000) >> 24); DEBUG_printf(("4cups_raster_read_header: %08x => %08x", temp, *s)); } } break; case CUPS_RASTER_SYNCapple : case CUPS_RASTER_REVSYNCapple : { unsigned char appleheader[32]; /* Raw header */ static const unsigned rawcspace[] = { CUPS_CSPACE_SW, CUPS_CSPACE_SRGB, CUPS_CSPACE_RGBW, CUPS_CSPACE_ADOBERGB, CUPS_CSPACE_W, CUPS_CSPACE_RGB, CUPS_CSPACE_CMYK }; static const unsigned rawnumcolors[] = { 1, 3, 4, 3, 1, 3, 4 }; if (cups_raster_read(r, appleheader, sizeof(appleheader)) < (ssize_t)sizeof(appleheader)) { DEBUG_printf(("4cups_raster_read_header: EOF, r->iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount)); return (0); } strncpy(r->header.MediaClass, "PwgRaster", sizeof(r->header.MediaClass) - 1); /* PwgRaster */ r->header.cupsBitsPerPixel = appleheader[0]; r->header.cupsColorSpace = appleheader[1] >= (sizeof(rawcspace) / sizeof(rawcspace[0])) ? CUPS_CSPACE_DEVICE1 : rawcspace[appleheader[1]]; r->header.cupsNumColors = appleheader[1] >= (sizeof(rawnumcolors) / sizeof(rawnumcolors[0])) ? 1 : rawnumcolors[appleheader[1]]; r->header.cupsBitsPerColor = r->header.cupsBitsPerPixel / r->header.cupsNumColors; r->header.cupsWidth = ((((((unsigned)appleheader[12] << 8) | (unsigned)appleheader[13]) << 8) | (unsigned)appleheader[14]) << 8) | (unsigned)appleheader[15]; r->header.cupsHeight = ((((((unsigned)appleheader[16] << 8) | (unsigned)appleheader[17]) << 8) | (unsigned)appleheader[18]) << 8) | (unsigned)appleheader[19]; r->header.cupsBytesPerLine = r->header.cupsWidth * r->header.cupsBitsPerPixel / 8; r->header.cupsColorOrder = CUPS_ORDER_CHUNKED; r->header.HWResolution[0] = r->header.HWResolution[1] = ((((((unsigned)appleheader[20] << 8) | (unsigned)appleheader[21]) << 8) | (unsigned)appleheader[22]) << 8) | (unsigned)appleheader[23]; if (r->header.HWResolution[0] > 0) { r->header.PageSize[0] = (unsigned)(r->header.cupsWidth * 72 / r->header.HWResolution[0]); r->header.PageSize[1] = (unsigned)(r->header.cupsHeight * 72 / r->header.HWResolution[1]); r->header.cupsPageSize[0] = (float)(r->header.cupsWidth * 72.0 / r->header.HWResolution[0]); r->header.cupsPageSize[1] = (float)(r->header.cupsHeight * 72.0 / r->header.HWResolution[1]); } r->header.cupsInteger[0] = r->apple_page_count; r->header.cupsInteger[7] = 0xffffff; } break; } /* * Update the header and row count... */ if (!cups_raster_update(r)) return (0); DEBUG_printf(("4cups_raster_read_header: cupsBitsPerPixel=%u, cupsBitsPerColor=%u, cupsBytesPerLine=%u, cupsWidth=%u, cupsHeight=%u, r->bpp=%d", r->header.cupsBitsPerPixel, r->header.cupsBitsPerColor, r->header.cupsBytesPerLine, r->header.cupsWidth, r->header.cupsHeight, r->bpp)); return (r->header.cupsBitsPerPixel > 0 && r->header.cupsBitsPerPixel <= 240 && r->header.cupsBitsPerColor > 0 && r->header.cupsBitsPerColor <= 16 && r->header.cupsBytesPerLine > 0 && r->header.cupsBytesPerLine <= 0x7fffffff && r->header.cupsHeight != 0 && (r->header.cupsBytesPerLine % r->bpp) == 0); } /* * 'cups_raster_io()' - Read/write bytes from a context, handling interruptions. */ static ssize_t /* O - Bytes read/write or -1 */ cups_raster_io(cups_raster_t *r, /* I - Raster stream */ unsigned char *buf, /* I - Buffer for read/write */ size_t bytes) /* I - Number of bytes to read/write */ { ssize_t count, /* Number of bytes read/written */ total; /* Total bytes read/written */ DEBUG_printf(("5cups_raster_io(r=%p, buf=%p, bytes=" CUPS_LLFMT ")", (void *)r, (void *)buf, CUPS_LLCAST bytes)); for (total = 0; total < (ssize_t)bytes; total += count, buf += count) { count = (*r->iocb)(r->ctx, buf, bytes - (size_t)total); DEBUG_printf(("6cups_raster_io: count=%d, total=%d", (int)count, (int)total)); if (count == 0) break; // { // DEBUG_puts("6cups_raster_io: Returning 0."); // return (0); // } else if (count < 0) { DEBUG_puts("6cups_raster_io: Returning -1 on error."); return (-1); } #ifdef DEBUG r->iocount += (size_t)count; #endif /* DEBUG */ } DEBUG_printf(("6cups_raster_io: iocount=" CUPS_LLFMT, CUPS_LLCAST r->iocount)); DEBUG_printf(("6cups_raster_io: Returning " CUPS_LLFMT ".", CUPS_LLCAST total)); return (total); } /* * 'cups_raster_read()' - Read through the raster buffer. */ static ssize_t /* O - Number of bytes read */ cups_raster_read(cups_raster_t *r, /* I - Raster stream */ unsigned char *buf, /* I - Buffer */ size_t bytes) /* I - Number of bytes to read */ { ssize_t count, /* Number of bytes read */ remaining, /* Remaining bytes in buffer */ total; /* Total bytes read */ DEBUG_printf(("4cups_raster_read(r=%p, buf=%p, bytes=" CUPS_LLFMT "), offset=" CUPS_LLFMT, (void *)r, (void *)buf, CUPS_LLCAST bytes, CUPS_LLCAST (r->iostart + r->bufptr - r->buffer))); if (!r->compressed) return (cups_raster_io(r, buf, bytes)); /* * Allocate a read buffer as needed... */ count = (ssize_t)(2 * r->header.cupsBytesPerLine); if (count < 65536) count = 65536; if ((size_t)count > r->bufsize) { ssize_t offset = r->bufptr - r->buffer; /* Offset to current start of buffer */ ssize_t end = r->bufend - r->buffer;/* Offset to current end of buffer */ unsigned char *rptr; /* Pointer in read buffer */ if (r->buffer) rptr = realloc(r->buffer, (size_t)count); else rptr = malloc((size_t)count); if (!rptr) return (0); r->buffer = rptr; r->bufptr = rptr + offset; r->bufend = rptr + end; r->bufsize = (size_t)count; } /* * Loop until we have read everything... */ for (total = 0, remaining = (int)(r->bufend - r->bufptr); total < (ssize_t)bytes; total += count, buf += count) { count = (ssize_t)bytes - total; DEBUG_printf(("5cups_raster_read: count=" CUPS_LLFMT ", remaining=" CUPS_LLFMT ", buf=%p, bufptr=%p, bufend=%p", CUPS_LLCAST count, CUPS_LLCAST remaining, (void *)buf, (void *)r->bufptr, (void *)r->bufend)); if (remaining == 0) { if (count < 16) { /* * Read into the raster buffer and then copy... */ #ifdef DEBUG r->iostart += (size_t)(r->bufend - r->buffer); #endif /* DEBUG */ remaining = (*r->iocb)(r->ctx, r->buffer, r->bufsize); if (remaining <= 0) return (0); r->bufptr = r->buffer; r->bufend = r->buffer + remaining; #ifdef DEBUG r->iocount += (size_t)remaining; #endif /* DEBUG */ } else { /* * Read directly into "buf"... */ count = (*r->iocb)(r->ctx, buf, (size_t)count); if (count <= 0) return (0); #ifdef DEBUG r->iostart += (size_t)count; r->iocount += (size_t)count; #endif /* DEBUG */ continue; } } /* * Copy bytes from raster buffer to "buf"... */ if (count > remaining) count = remaining; if (count == 1) { /* * Copy 1 byte... */ *buf = *(r->bufptr)++; remaining --; } else if (count < 128) { /* * Copy up to 127 bytes without using memcpy(); this is * faster because it avoids an extra function call and is * often further optimized by the compiler... */ unsigned char *bufptr; /* Temporary buffer pointer */ remaining -= count; for (bufptr = r->bufptr; count > 0; count --, total ++) *buf++ = *bufptr++; r->bufptr = bufptr; } else { /* * Use memcpy() for a large read... */ memcpy(buf, r->bufptr, (size_t)count); r->bufptr += count; remaining -= count; } } DEBUG_printf(("5cups_raster_read: Returning %ld", (long)total)); return (total); } /* * 'cups_raster_update()' - Update the raster header and row count for the * current page. */ static int /* O - 1 on success, 0 on failure */ cups_raster_update(cups_raster_t *r) /* I - Raster stream */ { if (r->sync == CUPS_RASTER_SYNCv1 || r->sync == CUPS_RASTER_REVSYNCv1 || r->header.cupsNumColors == 0) { /* * Set the "cupsNumColors" field according to the colorspace... */ switch (r->header.cupsColorSpace) { case CUPS_CSPACE_W : case CUPS_CSPACE_K : case CUPS_CSPACE_WHITE : case CUPS_CSPACE_GOLD : case CUPS_CSPACE_SILVER : case CUPS_CSPACE_SW : r->header.cupsNumColors = 1; break; case CUPS_CSPACE_RGB : case CUPS_CSPACE_CMY : case CUPS_CSPACE_YMC : case CUPS_CSPACE_CIEXYZ : case CUPS_CSPACE_CIELab : case CUPS_CSPACE_SRGB : case CUPS_CSPACE_ADOBERGB : case CUPS_CSPACE_ICC1 : case CUPS_CSPACE_ICC2 : case CUPS_CSPACE_ICC3 : case CUPS_CSPACE_ICC4 : case CUPS_CSPACE_ICC5 : case CUPS_CSPACE_ICC6 : case CUPS_CSPACE_ICC7 : case CUPS_CSPACE_ICC8 : case CUPS_CSPACE_ICC9 : case CUPS_CSPACE_ICCA : case CUPS_CSPACE_ICCB : case CUPS_CSPACE_ICCC : case CUPS_CSPACE_ICCD : case CUPS_CSPACE_ICCE : case CUPS_CSPACE_ICCF : r->header.cupsNumColors = 3; break; case CUPS_CSPACE_RGBA : case CUPS_CSPACE_RGBW : case CUPS_CSPACE_CMYK : case CUPS_CSPACE_YMCK : case CUPS_CSPACE_KCMY : case CUPS_CSPACE_GMCK : case CUPS_CSPACE_GMCS : r->header.cupsNumColors = 4; break; case CUPS_CSPACE_KCMYcm : if (r->header.cupsBitsPerPixel < 8) r->header.cupsNumColors = 6; else r->header.cupsNumColors = 4; break; case CUPS_CSPACE_DEVICE1 : case CUPS_CSPACE_DEVICE2 : case CUPS_CSPACE_DEVICE3 : case CUPS_CSPACE_DEVICE4 : case CUPS_CSPACE_DEVICE5 : case CUPS_CSPACE_DEVICE6 : case CUPS_CSPACE_DEVICE7 : case CUPS_CSPACE_DEVICE8 : case CUPS_CSPACE_DEVICE9 : case CUPS_CSPACE_DEVICEA : case CUPS_CSPACE_DEVICEB : case CUPS_CSPACE_DEVICEC : case CUPS_CSPACE_DEVICED : case CUPS_CSPACE_DEVICEE : case CUPS_CSPACE_DEVICEF : r->header.cupsNumColors = r->header.cupsColorSpace - CUPS_CSPACE_DEVICE1 + 1; break; default : /* Unknown color space */ return (0); } } /* * Set the number of bytes per pixel/color... */ if (r->header.cupsColorOrder == CUPS_ORDER_CHUNKED) r->bpp = (r->header.cupsBitsPerPixel + 7) / 8; else r->bpp = (r->header.cupsBitsPerColor + 7) / 8; if (r->bpp == 0) r->bpp = 1; /* * Set the number of remaining rows... */ if (r->header.cupsColorOrder == CUPS_ORDER_PLANAR) r->remaining = r->header.cupsHeight * r->header.cupsNumColors; else r->remaining = r->header.cupsHeight; /* * Allocate the compression buffer... */ if (r->compressed) { if (r->pixels != NULL) free(r->pixels); if ((r->pixels = calloc(r->header.cupsBytesPerLine, 1)) == NULL) { r->pcurrent = NULL; r->pend = NULL; r->count = 0; return (0); } r->pcurrent = r->pixels; r->pend = r->pixels + r->header.cupsBytesPerLine; r->count = 0; } return (1); } /* * 'cups_raster_write()' - Write a row of compressed raster data... */ static ssize_t /* O - Number of bytes written */ cups_raster_write( cups_raster_t *r, /* I - Raster stream */ const unsigned char *pixels) /* I - Pixel data to write */ { const unsigned char *start, /* Start of sequence */ *ptr, /* Current pointer in sequence */ *pend, /* End of raster buffer */ *plast; /* Pointer to last pixel */ unsigned char *wptr; /* Pointer into write buffer */ unsigned bpp, /* Bytes per pixel */ count; /* Count */ _cups_copyfunc_t cf; /* Copy function */ DEBUG_printf(("3cups_raster_write(r=%p, pixels=%p)", (void *)r, (void *)pixels)); /* * Determine whether we need to swap bytes... */ if (r->swapped && (r->header.cupsBitsPerColor == 16 || r->header.cupsBitsPerPixel == 12 || r->header.cupsBitsPerPixel == 16)) { DEBUG_puts("4cups_raster_write: Swapping bytes when writing."); cf = (_cups_copyfunc_t)cups_swap_copy; } else cf = (_cups_copyfunc_t)memcpy; /* * Allocate a write buffer as needed... */ count = r->header.cupsBytesPerLine * 2; if (count < 65536) count = 65536; if ((size_t)count > r->bufsize) { if (r->buffer) wptr = realloc(r->buffer, count); else wptr = malloc(count); if (!wptr) { DEBUG_printf(("4cups_raster_write: Unable to allocate " CUPS_LLFMT " bytes for raster buffer: %s", CUPS_LLCAST count, strerror(errno))); return (-1); } r->buffer = wptr; r->bufsize = count; } /* * Write the row repeat count... */ bpp = r->bpp; pend = pixels + r->header.cupsBytesPerLine; plast = pend - bpp; wptr = r->buffer; *wptr++ = (unsigned char)(r->count - 1); /* * Write using a modified PackBits compression... */ for (ptr = pixels; ptr < pend;) { start = ptr; ptr += bpp; if (ptr == pend) { /* * Encode a single pixel at the end... */ *wptr++ = 0; (*cf)(wptr, start, bpp); wptr += bpp; } else if (!memcmp(start, ptr, bpp)) { /* * Encode a sequence of repeating pixels... */ for (count = 2; count < 128 && ptr < plast; count ++, ptr += bpp) if (memcmp(ptr, ptr + bpp, bpp)) break; *wptr++ = (unsigned char)(count - 1); (*cf)(wptr, ptr, bpp); wptr += bpp; ptr += bpp; } else { /* * Encode a sequence of non-repeating pixels... */ for (count = 1; count < 128 && ptr < plast; count ++, ptr += bpp) if (!memcmp(ptr, ptr + bpp, bpp)) break; if (ptr >= plast && count < 128) { count ++; ptr += bpp; } *wptr++ = (unsigned char)(257 - count); count *= bpp; (*cf)(wptr, start, count); wptr += count; } } DEBUG_printf(("4cups_raster_write: Writing " CUPS_LLFMT " bytes.", CUPS_LLCAST (wptr - r->buffer))); return (cups_raster_io(r, r->buffer, (size_t)(wptr - r->buffer))); } /* * 'cups_read_fd()' - Read bytes from a file. */ static ssize_t /* O - Bytes read or -1 */ cups_read_fd(void *ctx, /* I - File descriptor as pointer */ unsigned char *buf, /* I - Buffer for read */ size_t bytes) /* I - Maximum number of bytes to read */ { int fd = (int)((intptr_t)ctx); /* File descriptor */ ssize_t count; /* Number of bytes read */ #ifdef WIN32 /* Sigh */ while ((count = read(fd, buf, (unsigned)bytes)) < 0) #else while ((count = read(fd, buf, bytes)) < 0) #endif /* WIN32 */ if (errno != EINTR && errno != EAGAIN) { DEBUG_printf(("8cups_read_fd: %s", strerror(errno))); return (-1); } DEBUG_printf(("8cups_read_fd: Returning %d bytes.", (int)count)); return (count); } /* * 'cups_swap()' - Swap bytes in raster data... */ static void cups_swap(unsigned char *buf, /* I - Buffer to swap */ size_t bytes) /* I - Number of bytes to swap */ { unsigned char even, odd; /* Temporary variables */ bytes /= 2; while (bytes > 0) { even = buf[0]; odd = buf[1]; buf[0] = odd; buf[1] = even; buf += 2; bytes --; } } /* * 'cups_swap_copy()' - Copy and swap bytes in raster data... */ static void cups_swap_copy( unsigned char *dst, /* I - Destination */ const unsigned char *src, /* I - Source */ size_t bytes) /* I - Number of bytes to swap */ { bytes /= 2; while (bytes > 0) { dst[0] = src[1]; dst[1] = src[0]; dst += 2; src += 2; bytes --; } } /* * 'cups_write_fd()' - Write bytes to a file. */ static ssize_t /* O - Bytes written or -1 */ cups_write_fd(void *ctx, /* I - File descriptor pointer */ unsigned char *buf, /* I - Bytes to write */ size_t bytes) /* I - Number of bytes to write */ { int fd = (int)((intptr_t)ctx); /* File descriptor */ ssize_t count; /* Number of bytes written */ #ifdef WIN32 /* Sigh */ while ((count = write(fd, buf, (unsigned)bytes)) < 0) #else while ((count = write(fd, buf, bytes)) < 0) #endif /* WIN32 */ if (errno != EINTR && errno != EAGAIN) { DEBUG_printf(("8cups_write_fd: %s", strerror(errno))); return (-1); } return (count); } raster.h000066400000000000000000000443601407457743100125520ustar00rootroot00000000000000/* * Raster file definitions for CUPS. * * Copyright 2007-2016 by Apple Inc. * Copyright 1997-2006 by Easy Software Products. * * This file is part of the CUPS Imaging library. * * Licensed under Apache License v2.0. See the file "LICENSE" for more information. */ #ifndef _CUPS_RASTER_H_ # define _CUPS_RASTER_H_ /* * Include necessary headers... */ /*# include "cups.h"*/ # include # define _CUPS_DEPRECATED # define _CUPS_DEPRECATED_MSG(x) # define _CUPS_API_1_2 # define _CUPS_API_1_3 # define _CUPS_API_1_5 # ifdef __cplusplus extern "C" { # endif /* __cplusplus */ /* * Every non-PostScript printer driver that supports raster images * should use the application/vnd.cups-raster image file format. * Since both the PostScript RIP (pstoraster, based on GNU/GPL * Ghostscript) and Image RIP (imagetoraster, located in the filter * directory) use it, using this format saves you a lot of work. * Also, the PostScript RIP passes any printer options that are in * a PS file to your driver this way as well... */ /* * Constants... */ # define CUPS_RASTER_SYNC 0x52615333 /* RaS3 */ # define CUPS_RASTER_REVSYNC 0x33536152 /* 3SaR */ # define CUPS_RASTER_SYNCv1 0x52615374 /* RaSt */ # define CUPS_RASTER_REVSYNCv1 0x74536152 /* tSaR */ # define CUPS_RASTER_SYNCv2 0x52615332 /* RaS2 */ # define CUPS_RASTER_REVSYNCv2 0x32536152 /* 2SaR */ # define CUPS_RASTER_SYNCapple 0x554E4952 /* UNIR */ # define CUPS_RASTER_REVSYNCapple 0x52494E55 /* RINU */ # define CUPS_RASTER_SYNC_PWG CUPS_RASTER_SYNCv2 /* * The following definition can be used to determine if the * colorimetric colorspaces (CIEXYZ, CIELAB, and ICCn) are * defined... */ # define CUPS_RASTER_HAVE_COLORIMETRIC 1 /* * The following definition can be used to determine if the * device colorspaces (DEVICEn) are defined... */ # define CUPS_RASTER_HAVE_DEVICE 1 /* * The following definition can be used to determine if PWG Raster is supported. */ # define CUPS_RASTER_HAVE_PWGRASTER 1 /* * The following definition can be used to determine if Apple Raster is * supported (beta). */ # define CUPS_RASTER_HAVE_APPLERASTER 1 /* * The following PWG 5102.4 definitions specify indices into the * cupsInteger[] array in the raster header. */ # define CUPS_RASTER_PWG_TotalPageCount 0 # define CUPS_RASTER_PWG_CrossFeedTransform 1 # define CUPS_RASTER_PWG_FeedTransform 2 # define CUPS_RASTER_PWG_ImageBoxLeft 3 # define CUPS_RASTER_PWG_ImageBoxTop 4 # define CUPS_RASTER_PWG_ImageBoxRight 5 # define CUPS_RASTER_PWG_ImageBoxBottom 6 # define CUPS_RASTER_PWG_AlternatePrimary 7 # define CUPS_RASTER_PWG_PrintQuality 8 # define CUPS_RASTER_PWG_VendorIdentifier 14 # define CUPS_RASTER_PWG_VendorLength 15 /* * Types... */ typedef enum cups_adv_e /**** AdvanceMedia attribute values ****/ { CUPS_ADVANCE_NONE = 0, /* Never advance the roll */ CUPS_ADVANCE_FILE = 1, /* Advance the roll after this file */ CUPS_ADVANCE_JOB = 2, /* Advance the roll after this job */ CUPS_ADVANCE_SET = 3, /* Advance the roll after this set */ CUPS_ADVANCE_PAGE = 4 /* Advance the roll after this page */ } cups_adv_t; typedef enum cups_bool_e /**** Boolean type ****/ { CUPS_FALSE = 0, /* Logical false */ CUPS_TRUE = 1 /* Logical true */ } cups_bool_t; typedef enum cups_cspace_e /**** cupsColorSpace attribute values ****/ { CUPS_CSPACE_W = 0, /* Luminance (DeviceGray, gamma 2.2 by default) */ CUPS_CSPACE_RGB = 1, /* Red, green, blue (DeviceRGB, sRGB by default) */ CUPS_CSPACE_RGBA = 2, /* Red, green, blue, alpha (DeviceRGB, sRGB by default) */ CUPS_CSPACE_K = 3, /* Black (DeviceK) */ CUPS_CSPACE_CMY = 4, /* Cyan, magenta, yellow (DeviceCMY) */ CUPS_CSPACE_YMC = 5, /* Yellow, magenta, cyan @deprecated@ */ CUPS_CSPACE_CMYK = 6, /* Cyan, magenta, yellow, black (DeviceCMYK) */ CUPS_CSPACE_YMCK = 7, /* Yellow, magenta, cyan, black @deprecated@ */ CUPS_CSPACE_KCMY = 8, /* Black, cyan, magenta, yellow @deprecated@ */ CUPS_CSPACE_KCMYcm = 9, /* Black, cyan, magenta, yellow, light-cyan, light-magenta @deprecated@ */ CUPS_CSPACE_GMCK = 10, /* Gold, magenta, yellow, black @deprecated@ */ CUPS_CSPACE_GMCS = 11, /* Gold, magenta, yellow, silver @deprecated@ */ CUPS_CSPACE_WHITE = 12, /* White ink (as black) @deprecated@ */ CUPS_CSPACE_GOLD = 13, /* Gold foil @deprecated@ */ CUPS_CSPACE_SILVER = 14, /* Silver foil @deprecated@ */ CUPS_CSPACE_CIEXYZ = 15, /* CIE XYZ @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_CIELab = 16, /* CIE Lab @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_RGBW = 17, /* Red, green, blue, white (DeviceRGB, sRGB by default) @since CUPS 1.2/macOS 10.5@ */ CUPS_CSPACE_SW = 18, /* Luminance (gamma 2.2) @since CUPS 1.4.5@ */ CUPS_CSPACE_SRGB = 19, /* Red, green, blue (sRGB) @since CUPS 1.4.5@ */ CUPS_CSPACE_ADOBERGB = 20, /* Red, green, blue (Adobe RGB) @since CUPS 1.4.5@ */ CUPS_CSPACE_ICC1 = 32, /* ICC-based, 1 color @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC2 = 33, /* ICC-based, 2 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC3 = 34, /* ICC-based, 3 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC4 = 35, /* ICC-based, 4 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC5 = 36, /* ICC-based, 5 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC6 = 37, /* ICC-based, 6 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC7 = 38, /* ICC-based, 7 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC8 = 39, /* ICC-based, 8 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICC9 = 40, /* ICC-based, 9 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCA = 41, /* ICC-based, 10 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCB = 42, /* ICC-based, 11 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCC = 43, /* ICC-based, 12 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCD = 44, /* ICC-based, 13 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCE = 45, /* ICC-based, 14 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_ICCF = 46, /* ICC-based, 15 colors @since CUPS 1.1.19/macOS 10.3@ */ CUPS_CSPACE_DEVICE1 = 48, /* DeviceN, 1 color @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE2 = 49, /* DeviceN, 2 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE3 = 50, /* DeviceN, 3 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE4 = 51, /* DeviceN, 4 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE5 = 52, /* DeviceN, 5 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE6 = 53, /* DeviceN, 6 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE7 = 54, /* DeviceN, 7 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE8 = 55, /* DeviceN, 8 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICE9 = 56, /* DeviceN, 9 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICEA = 57, /* DeviceN, 10 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICEB = 58, /* DeviceN, 11 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICEC = 59, /* DeviceN, 12 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICED = 60, /* DeviceN, 13 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICEE = 61, /* DeviceN, 14 colors @since CUPS 1.4.5@ */ CUPS_CSPACE_DEVICEF = 62 /* DeviceN, 15 colors @since CUPS 1.4.5@ */ } cups_cspace_t; typedef enum cups_cut_e /**** CutMedia attribute values ****/ { CUPS_CUT_NONE = 0, /* Never cut the roll */ CUPS_CUT_FILE = 1, /* Cut the roll after this file */ CUPS_CUT_JOB = 2, /* Cut the roll after this job */ CUPS_CUT_SET = 3, /* Cut the roll after this set */ CUPS_CUT_PAGE = 4 /* Cut the roll after this page */ } cups_cut_t; typedef enum cups_edge_e /**** LeadingEdge attribute values ****/ { CUPS_EDGE_TOP = 0, /* Leading edge is the top of the page */ CUPS_EDGE_RIGHT = 1, /* Leading edge is the right of the page */ CUPS_EDGE_BOTTOM = 2, /* Leading edge is the bottom of the page */ CUPS_EDGE_LEFT = 3 /* Leading edge is the left of the page */ } cups_edge_t; typedef enum cups_jog_e /**** Jog attribute values ****/ { CUPS_JOG_NONE = 0, /* Never move pages */ CUPS_JOG_FILE = 1, /* Move pages after this file */ CUPS_JOG_JOB = 2, /* Move pages after this job */ CUPS_JOG_SET = 3 /* Move pages after this set */ } cups_jog_t; enum cups_mode_e /**** cupsRasterOpen modes ****/ { CUPS_RASTER_READ = 0, /* Open stream for reading */ CUPS_RASTER_WRITE = 1, /* Open stream for writing */ CUPS_RASTER_WRITE_COMPRESSED = 2, /* Open stream for compressed writing @since CUPS 1.3/macOS 10.5@ */ CUPS_RASTER_WRITE_PWG = 3, /* Open stream for compressed writing in PWG Raster mode @since CUPS 1.5/macOS 10.7@ */ CUPS_RASTER_WRITE_APPLE = 4 /* Open stream for compressed writing in AppleRaster mode (beta) @private@ */ }; typedef enum cups_mode_e cups_mode_t; /**** cupsRasterOpen modes ****/ typedef enum cups_order_e /**** cupsColorOrder attribute values ****/ { CUPS_ORDER_CHUNKED = 0, /* CMYK CMYK CMYK ... */ CUPS_ORDER_BANDED = 1, /* CCC MMM YYY KKK ... */ CUPS_ORDER_PLANAR = 2 /* CCC ... MMM ... YYY ... KKK ... */ } cups_order_t; typedef enum cups_orient_e /**** Orientation attribute values ****/ { CUPS_ORIENT_0 = 0, /* Don't rotate the page */ CUPS_ORIENT_90 = 1, /* Rotate the page counter-clockwise */ CUPS_ORIENT_180 = 2, /* Turn the page upside down */ CUPS_ORIENT_270 = 3 /* Rotate the page clockwise */ } cups_orient_t; /* * The page header structure contains the standard PostScript page device * dictionary, along with some CUPS-specific parameters that are provided * by the RIPs... * * The API supports a "version 1" (from CUPS 1.0 and 1.1) and a "version 2" * (from CUPS 1.2 and higher) page header, for binary compatibility. */ typedef struct cups_page_header_s /**** Version 1 page header @deprecated@ ****/ { /**** Standard Page Device Dictionary String Values ****/ char MediaClass[64]; /* MediaClass string */ char MediaColor[64]; /* MediaColor string */ char MediaType[64]; /* MediaType string */ char OutputType[64]; /* OutputType string */ /**** Standard Page Device Dictionary Integer Values ****/ unsigned AdvanceDistance; /* AdvanceDistance value in points */ cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */ cups_bool_t Collate; /* Collated copies value */ cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */ cups_bool_t Duplex; /* Duplexed (double-sided) value */ unsigned HWResolution[2]; /* Resolution in dots-per-inch */ unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */ cups_bool_t InsertSheet; /* InsertSheet value */ cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */ cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */ unsigned Margins[2]; /* Lower-lefthand margins in points */ cups_bool_t ManualFeed; /* ManualFeed value */ unsigned MediaPosition; /* MediaPosition value */ unsigned MediaWeight; /* MediaWeight value in grams/m^2 */ cups_bool_t MirrorPrint; /* MirrorPrint value */ cups_bool_t NegativePrint; /* NegativePrint value */ unsigned NumCopies; /* Number of copies to produce */ cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */ cups_bool_t OutputFaceUp; /* OutputFaceUp value */ unsigned PageSize[2]; /* Width and length of page in points */ cups_bool_t Separations; /* Separations value */ cups_bool_t TraySwitch; /* TraySwitch value */ cups_bool_t Tumble; /* Tumble value */ /**** CUPS Page Device Dictionary Values ****/ unsigned cupsWidth; /* Width of page image in pixels */ unsigned cupsHeight; /* Height of page image in pixels */ unsigned cupsMediaType; /* Media type code */ unsigned cupsBitsPerColor; /* Number of bits for each color */ unsigned cupsBitsPerPixel; /* Number of bits for each pixel */ unsigned cupsBytesPerLine; /* Number of bytes per line */ cups_order_t cupsColorOrder; /* Order of colors */ cups_cspace_t cupsColorSpace; /* True colorspace */ unsigned cupsCompression; /* Device compression to use */ unsigned cupsRowCount; /* Rows per band */ unsigned cupsRowFeed; /* Feed between bands */ unsigned cupsRowStep; /* Spacing between lines */ } cups_page_header_t; /**** New in CUPS 1.2 ****/ typedef struct cups_page_header2_s /**** Version 2 page header @since CUPS 1.2/macOS 10.5@ ****/ { /**** Standard Page Device Dictionary String Values ****/ char MediaClass[64]; /* MediaClass string */ char MediaColor[64]; /* MediaColor string */ char MediaType[64]; /* MediaType string */ char OutputType[64]; /* OutputType string */ /**** Standard Page Device Dictionary Integer Values ****/ unsigned AdvanceDistance; /* AdvanceDistance value in points */ cups_adv_t AdvanceMedia; /* AdvanceMedia value (@link cups_adv_t@) */ cups_bool_t Collate; /* Collated copies value */ cups_cut_t CutMedia; /* CutMedia value (@link cups_cut_t@) */ cups_bool_t Duplex; /* Duplexed (double-sided) value */ unsigned HWResolution[2]; /* Resolution in dots-per-inch */ unsigned ImagingBoundingBox[4]; /* Pixel region that is painted (points, left, bottom, right, top) */ cups_bool_t InsertSheet; /* InsertSheet value */ cups_jog_t Jog; /* Jog value (@link cups_jog_t@) */ cups_edge_t LeadingEdge; /* LeadingEdge value (@link cups_edge_t@) */ unsigned Margins[2]; /* Lower-lefthand margins in points */ cups_bool_t ManualFeed; /* ManualFeed value */ unsigned MediaPosition; /* MediaPosition value */ unsigned MediaWeight; /* MediaWeight value in grams/m^2 */ cups_bool_t MirrorPrint; /* MirrorPrint value */ cups_bool_t NegativePrint; /* NegativePrint value */ unsigned NumCopies; /* Number of copies to produce */ cups_orient_t Orientation; /* Orientation value (@link cups_orient_t@) */ cups_bool_t OutputFaceUp; /* OutputFaceUp value */ unsigned PageSize[2]; /* Width and length of page in points */ cups_bool_t Separations; /* Separations value */ cups_bool_t TraySwitch; /* TraySwitch value */ cups_bool_t Tumble; /* Tumble value */ /**** CUPS Page Device Dictionary Values ****/ unsigned cupsWidth; /* Width of page image in pixels */ unsigned cupsHeight; /* Height of page image in pixels */ unsigned cupsMediaType; /* Media type code */ unsigned cupsBitsPerColor; /* Number of bits for each color */ unsigned cupsBitsPerPixel; /* Number of bits for each pixel */ unsigned cupsBytesPerLine; /* Number of bytes per line */ cups_order_t cupsColorOrder; /* Order of colors */ cups_cspace_t cupsColorSpace; /* True colorspace */ unsigned cupsCompression; /* Device compression to use */ unsigned cupsRowCount; /* Rows per band */ unsigned cupsRowFeed; /* Feed between bands */ unsigned cupsRowStep; /* Spacing between lines */ /**** Version 2 Dictionary Values ****/ unsigned cupsNumColors; /* Number of color compoents @since CUPS 1.2/macOS 10.5@ */ float cupsBorderlessScalingFactor; /* Scaling that was applied to page data @since CUPS 1.2/macOS 10.5@ */ float cupsPageSize[2]; /* Floating point PageSize (scaling * * factor not applied) @since CUPS 1.2/macOS 10.5@ */ float cupsImagingBBox[4]; /* Floating point ImagingBoundingBox * (scaling factor not applied, left, * bottom, right, top) @since CUPS 1.2/macOS 10.5@ */ unsigned cupsInteger[16]; /* User-defined integer values @since CUPS 1.2/macOS 10.5@ */ float cupsReal[16]; /* User-defined floating-point values @since CUPS 1.2/macOS 10.5@ */ char cupsString[16][64]; /* User-defined string values @since CUPS 1.2/macOS 10.5@ */ char cupsMarkerType[64]; /* Ink/toner type @since CUPS 1.2/macOS 10.5@ */ char cupsRenderingIntent[64];/* Color rendering intent @since CUPS 1.2/macOS 10.5@ */ char cupsPageSizeName[64]; /* PageSize name @since CUPS 1.2/macOS 10.5@ */ } cups_page_header2_t; typedef struct _cups_raster_s cups_raster_t; /**** Raster stream data ****/ typedef int (*cups_interpret_cb_t)(cups_page_header2_t *header, int preferred_bits); /**** cupsRasterInterpretPPD callback function * * This function is called by * @link cupsRasterInterpretPPD@ to * validate (and update, as needed) * the page header attributes. The * "preferred_bits" argument provides * the value of the * @code cupsPreferredBitsPerColor@ * key from the PostScript page device * dictionary and is 0 if undefined. ****/ /**** New in CUPS 1.5 ****/ typedef ssize_t (*cups_raster_iocb_t)(void *ctx, unsigned char *buffer, size_t length); /**** cupsRasterOpenIO callback function * * This function is specified when * creating a raster stream with * @link cupsRasterOpenIO@ and handles * generic reading and writing of raster * data. It must return -1 on error or * the number of bytes specified by * "length" on success. ****/ /* * Prototypes... */ extern void cupsRasterClose(cups_raster_t *r); extern cups_raster_t *cupsRasterOpen(int fd, cups_mode_t mode); extern unsigned cupsRasterReadHeader(cups_raster_t *r, cups_page_header_t *h) _CUPS_DEPRECATED_MSG("Use cupsRasterReadHeader2 instead."); extern unsigned cupsRasterReadPixels(cups_raster_t *r, unsigned char *p, unsigned len); extern unsigned cupsRasterWriteHeader(cups_raster_t *r, cups_page_header_t *h) _CUPS_DEPRECATED_MSG("Use cupsRasterWriteHeader2 instead."); extern unsigned cupsRasterWritePixels(cups_raster_t *r, unsigned char *p, unsigned len); /**** New in CUPS 1.2 ****/ extern unsigned cupsRasterReadHeader2(cups_raster_t *r, cups_page_header2_t *h) _CUPS_API_1_2; extern unsigned cupsRasterWriteHeader2(cups_raster_t *r, cups_page_header2_t *h) _CUPS_API_1_2; /**** New in CUPS 1.3 ****/ extern const char *cupsRasterErrorString(void) _CUPS_API_1_3; /**** New in CUPS 1.5 ****/ extern cups_raster_t *cupsRasterOpenIO(cups_raster_iocb_t iocb, void *ctx, cups_mode_t mode); /**** New in CUPS 2.2/macOS 10.12 ****/ /*extern int cupsRasterInitPWGHeader(cups_page_header2_t *h, pwg_media_t *media, const char *type, int xdpi, int ydpi, const char *sides, const char *sheet_back) _CUPS_API_2_2;*/ /**** RasterView-specific ****/ extern size_t rasterOffset(cups_raster_t *r); extern void rasterReset(cups_raster_t *r); # ifdef __cplusplus } # endif /* __cplusplus */ #endif /* !_CUPS_RASTER_H_ */ rasterview-128.png000066400000000000000000000060601407457743100143050ustar00rootroot00000000000000PNG  IHDRiCCPkCGColorSpaceGenericRGB8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2s=+WQ+]L6O w[C{_F qb Uvz?Zb1@/zcs>~if,ӈUSjF 1_Mjbuݠpamhmçϙ>a\+5%QKFkm}ۖ?ޚD\!~6,-7SثŜvķ5Z;[rmS5{yDyH}r9|-ăFAJjI.[/]mK 7KRDrYQO-Q||6 (0 MXd(@h2_f<:”_δ*d>e\c?~,7?& ك^2Iq2"y@g|U\ ciTXtXML:com.adobe.xmp Michael Sweet Copyright 2017 Michael Sweet New Icon New Icon VAPLTE<etRNS  !"')*+,-.138=@AFGJLMOPQVWY]_aehklnoqstwyz{~XIDATxiS@g"g&H"WGOTT?@_udwjkf;I0`=Wn3Ҿͻ_?{,/۷[KZq˩B͏_1?|ƮG:csZeD?=!ds h^.Ȅ0@d }3t#prr+1i$%2"DG)Po\ 540&0  N @|7D @5 5 ^ `shv^B {?8lVni$bDo!R~ %nN9aȰOe5 _RYrFèY1@TVN.ʴW|:U@rLa^V =~T&Tshݵե|f*졃CӹIw͕R.eʥ%FђT*k˥E# zlOKWTv!_,?Xr_Ȧtk]Zbzf֘{oIٙ鄦dD^jSR"I͢LF#Jq ~fk ^AVIENDB`rasterview-32.png000066400000000000000000000043451407457743100142230ustar00rootroot00000000000000PNG  IHDR DiCCPkCGColorSpaceGenericRGB8U]hU>sg#$Sl4t? % V46nI6"dΘ83OEP|1Ŀ (>/ % (>P苦;3ie|{g蹪X-2s=+WQ+]L6O w[C{_F qb Uvz?Zb1@/zcs>~if,ӈUSjF 1_Mjbuݠpamhmçϙ>a\+5%QKFkm}ۖ?ޚD\!~6,-7SثŜvķ5Z;[rmS5{yDyH}r9|-ăFAJjI.[/]mK 7KRDrYQO-Q||6 (0 MXd(@h2_f<:”_δ*d>e\c?~,7?& ك^2Iq2"y@g|U\ ciTXtXML:com.adobe.xmp Michael Sweet Copyright 2017 Michael Sweet New Icon New Icon VcPLTEtRNS FGOhjqr{~c}IDAT8@DkaXU6E+=a$S'ҕt6Q+1IP M # <]ǾxDNxnN[n^J(dC%6`"uIENDB`rasterview.desktop000066400000000000000000000003361407457743100146620ustar00rootroot00000000000000[Desktop Entry] Name=RasterView Comment=CUPS Raster Viewer TryExec=rasterview Exec=rasterview %F Icon=rasterview.png Terminal=false Type=Application MimeType=application/vnd.cups-raster Encoding=UTF-8 Categories=Graphics; rasterview.list.in000066400000000000000000000027561407457743100146010ustar00rootroot00000000000000# # EPM list file for rasterview, a CUPS/PWG Raster viewing program. # # Copyright © 2002-2021 by Michael R Sweet # # Licensed under Apache License v2.0. See the file "LICENSE" for more # information. # # Product information %product CUPS Raster Viewer %version @VERSION@ %copyright 2002-2021 by Michael R Sweet %vendor Michael R Sweet %license LICENSE %readme README %description < ? @ A B F J P Q R V W X \ _ ` a b x y z { | } ~  a @ : 9 !"*U$null0  !"#$%&'()*+,-./0123456789:;9<=>>@AB::CDEFGH:IJKL@N>PQRSI@UVWXYB[\]^>B9a9WpolySidWpixDTypSbmPUresUnTsecCUcolSpUoBgImSparVnPaStrWactLaysUsnShsWpenTTypSmodTzoomTallRVsavStDTmetaVspiDecVgenNamUorTypVpixRadTfrasUimSizUbgColVnPaFilV$classVactTraVsavPrDTtarsVcurFraSenVVlineThVautoBTUshLayXrectCRadUresiMTcurRWspiSegsTtrasWfilSensUmainCVtraTrgVcurObjVguiLinTvarsVlasModWpolyStaUbgTypY7 +#@@ (#@T#? mF #- +#@Ijl+cd"eimWNS.keysZNS.objectsfghjkl \kMDItemTitle^kMDItemAuthors_kMDItemCopyrightXNew Icond"sut ]Michael Sweetxyz{Z$classnameX$classesWNSArray|}WNSArrayXNSObject_Copyright 2017 Michael Sweetxy_NSMutableDictionary}\NSDictionaryd"uX  "SresSdel#?xy\PCResolution}\PCResolutionXPCObject"#?"#?"I"#@"#@"#@ "#?d"uR "ATlaysUanimTUlAcLs#?cd"mfghjl d"ut d"u܀={ "a:R:a@TisShUblendSnamWmaskTypTopacSfilWmaskLayUedMskSvis<-#@Y. ">BUalConTobjs+,cd"m !"#$&'()* #?#?" %xy_PCBitmapContext}_PCBitmapContextZPCDrawableXPCObject" #?%" %" #?%"I %" %d"&u xy)*]PCNormalLayer+,-.}]PCNormalLayerWPCLayerZPCDrawableXPCObject]Shadow Effect"12356TfilNTatts;/0_PCShadowEffectFiltercd"9>m:;<=1234?@A?56:5 [inputOffsetZinputColorZinputAngleYinputBlur#@JKL"MN=PUNSRGB\NSColorSpace_NSCustomColorSpaceJ0 0 0 0.579R"STTNSID8xyVW\NSColorSpaceX}\NSColorSpacexyZ[WNSColor\}WNSColor#Vxy_`XPCFilterabc}XPCFilterZPCDrawableXPCObjectxyef]PCFilterLayerghij}]PCFilterLayerWPCLayerZPCDrawableXPCObject"::amn@praRF> G,N">xB=?+,cd"|m# @"ABCDE #?"n >%"n >%"n >#?%"n >%"nI >%Xmini XMLcd"m# H"IJKLM #?" =%" =%" =#?%" =%"I =%d"ùOyӀ-Lkǁ!?] "a@V@aVVV@VaUdimLKTrectSisIWfilPropSshXTantiSflVVcornRXVcornRYUstrosSshYUalPixSangSflHPS T xh= cd"mQR ]cornerRadiusX]cornerRadiusY_{{34, 94}, {12, 12}}" a  : :>:N@VrelLP2SblHWgradAngUradGCTfilTWrelRadCVfilPosSaEqStypXrelLinP1VfilColVrelLP1UfilImVothColXrelLinP2SgEqUfilGrSrEqXgradStopUpgNumSbEqa#@V]^gf`U_VObdcWe JK"NPF1 0 09JK"!NPL0.6 0.6 0.69d"$'%&X[\)*+">V</ValtColSlocScolTYZ1K"29PWNSWhiteB19xy56^PCGradientStop789}^PCGradientStopZPCDrawableXPCObject)*+">/TVZxy@A^NSMutableArray@B}WNSArrayV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}Q0QtW100 - tS100xyNO_PCDrawVectorPropertiesPQR}_PCDrawVectorPropertiesZPCDrawableXPCObjectd"T'Ui\X"YZ[+\]a_ :`a:c>ef:aiI:\mNoTcapSSposUinvisSwidUdashSsopwfrqkOtdjcleu1K"q9PB09JK"tNPL0.4 0.4 0.49d"w'xymn\)*+">UV\/ijZ)*+">Uf/ikZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv xy_PCStrokeVectorProperties}_PCStrokeVectorProperties_PCDrawVectorPropertiesZPCDrawableXPCObjectxy\PCRectVector}\PCRectVector\PCPathVector_PCRectBasedVectorXPCVectorZPCDrawableXPCObject"a@V@aVVV@Vaz} ~ x= cd"m{| ]cornerRadiusX]cornerRadiusY_{{34, 82}, {12, 12}}"a ::>:N@gfUydc JK"NPL0.6 0.6 0.69d"'π\)*+">V</~YZ)*+">/~ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'䀋\X"YZ[+\a :a:>:aI:\NwfydjcJK"NPL0.4 0.4 0.49d"'\)*+">V\/jZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@V@aVV V@Va x= cd"%'m&( ]cornerRadiusX]cornerRadiusY_{{34, 70}, {12, 12}}".a 0:1:46>8::=N>@gfUdc JK"ANPL0.6 0.6 0.69d"D'EF\)*+">V</YZ)*+">8/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"Z'[\X"YZ[+\^a` :aa:d>fg:ajI:\nN>pwfdjcJK"rNPL0.4 0.4 0.49d"u'vw\)*+">[V\/jZ)*+">[g/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@V@aVVV@Va xƀ= cd"m ]cornerRadiusX]cornerRadiusY_{{34, 58}, {12, 12}}"a ::>:N@gf€UĀdc JK"NPL0.6 0.6 0.69d"'\)*+">V</YZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'Ҁǀ\X"YZ[+\a :a:>:aI:\Ǹ̀wfπ΀ȀрdjcɀŀJK"NPL0.4 0.4 0.49d"'ʀˀ\)*+">V\/ǀjZ)*+">/ǀȀZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@ V@aVVV@VaԀ x= cd"mար ]cornerRadiusX]cornerRadiusY_{{34, 46}, {12, 12}}"a ::"$>&(:+N,@݀ހgfU߀ـӀdcڀ JK"/NPL0.6 0.6 0.69d"2'34ۀ܀\)*+"> V</؀YZ)*+"> &/؀ـZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"H'I\X"YZ[+\LaN :Oa:R>TU:aXI:\\N,^wfdjcJK"`NPL0.4 0.4 0.49d"c'de\)*+">IV\/jZ)*+">IU/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"xuv "}~a@V@aVVV@Va x= cd"m ]cornerRadiusX]cornerRadiusY_{{34, 34}, {12, 12}}"a ::>:N@gfUdc JK"NPL0.6 0.6 0.69d"'\)*+">V</YZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'\X"YZ[+\a :a:>:aI:\NՁ  wf   djcJK"NPL0.4 0.4 0.49d"'܁\)*+">V\/jZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@V@aVVV@Va  x = cd"m ]cornerRadiusX]cornerRadiusY_{{34, 22}, {12, 12}}" a  : :>:N@gfUdc JK"NPL0.6 0.6 0.69d" '!"\)*+">V</YZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"6'7!\X"YZ[+\:a< :=a:@>BC:aFI:\JNL*&'wf)("+djc#,JK"NNPL0.4 0.4 0.49d"Q'RS$%\)*+">7V\/!jZ)*+">7C/!"ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"fuv "kla@oV@aVVsV@Va.1 2 x?= cd"xzmy/{0 ]cornerRadiusX]cornerRadiusY_{{46, 94}, {12, 12}}"a ::>:N@<89gf;3:4-=dc5> JK"NPF1 1 09JK"NPL0.6 0.6 0.69d"'67\)*+">oV</2YZ)*+">o/24ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'@\X"YZ[+\a :a:>:aI:\NƁIEFwfHGA-JdjcB>KJK"NPL0.4 0.4 0.49d"'́CD\)*+">V\/@jZ)*+">/@AZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@V@aVVV@VaMP Q x^= cd"mNO ]cornerRadiusX]cornerRadiusY_{{58, 94}, {12, 12}}"a ::>: N @[WXgfZRYSL\dcT] JK"NPF0 1 09JK"NPL0.6 0.6 0.69d"'UV\)*+">V</QYZ)*+">/QSZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"*'+_\X"YZ[+\.a0 :1a:4>67:a:I:\>N @hdewfgf`Lidjca]jJK"BNPL0.4 0.4 0.49d"E'FGbc\)*+">+V\/_jZ)*+">+7/_`ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"Zuv "_`a@cV@aVVgV@Valo p x}= cd"lnmmmon ]cornerRadiusX]cornerRadiusY_{{70, 94}, {12, 12}}"ua w:x:{|}>:N@zvwgfyqxrk{dcs| JK"NPF0 1 19JK"NPL0.6 0.6 0.69d"'tu\)*+">cV</pYZ)*+">c/prZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'~\X"YZ[+\a :a:>:aI:\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mOQ ]cornerRadiusX]cornerRadiusY_{{58, 58}, {12, 12}}"Wa Y:Z:]_>ac:fNg@gfRdc JK"jNPL0.6 0.6 0.69d"m'no\)*+">EV</YZ)*+">Ea/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'\X"YZ[+\a :a:>:aI:\NgwfdjcJK"NPL0.4 0.4 0.49d"'\)*+">V\/jZ)*+">/ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d"uv "a@V@aVVV@Va  x= cd"mƁȁ ]cornerRadiusX]cornerRadiusY_{{46, 58}, {12, 12}}"a ::>:N@ gf3 dc  JK"NPL0.6 0.6 0.69d"'  \)*+">V</YZ)*+">/ ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td"'\X"YZ[+\a  : a: >  :a I:\ N wfdjc JK" NPL0.4 0.4 0.49d" '  \)*+">V\/jZ)*+"> /ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d" *uv " / 0a@ 3V@aVV 7V@Va"% & x2= cd" < >m =# ?$ ]cornerRadiusX]cornerRadiusY_{{82, 46}, {12, 12}}" Ea G: H: K M> O Q: TN U@/+,gf.-'!0dc(1 JK" XNPL0.6 0.6 0.69d" [' \ ])*\)*+"> 3V</&YZ)*+"> 3 O/&'ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td" q' r3\X"YZ[+\ ua w : xa: {> } ~:a I:\ N U <89wf;:4!=djc51>JK" NPL0.4 0.4 0.49d" ' 67\)*+"> rV\/3jZ)*+"> r ~/34ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d" uv " a@ V@aVV V@Va@C D xP= cd" m A B ]cornerRadiusX]cornerRadiusY_{{82, 34}, {12, 12}}" a : :  >  : N @MIJgfLKE?NdcFO JK" NPL0.6 0.6 0.69d" ' ԁGH\)*+"> V</DYZ)*+"> /DEZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td" ' Q\X"YZ[+\ a  : a: > :a I:\ N ZVWwfYXR?[djcSO\JK" NPL0.4 0.4 0.49d" '  TU\)*+"> V\/QjZ)*+"> /QRZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d" uv "  a@ !V@aVV %V@Va^a b xn= cd" * ,m +_ -` ]cornerRadiusX]cornerRadiusY_{{82, 22}, {12, 12}}" 3a 5: 6: 9 ;> = ?: BN C@kghgfjic]ldcdm JK" FNPL0.6 0.6 0.69d" I' J Kef\)*+"> !V</bYZ)*+"> ! =/bcZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td" _' `o\X"YZ[+\ ca e : fa: i> k l:a oI:\ sN C uxtuwfwvp]ydjcqmzJK" wNPL0.4 0.4 0.49d" z' { |rs\)*+"> `V\/ojZ)*+"> ` l/opZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d" uv "::a @ aR| ,"> B{}+,cd" m ~ "  |%ZBackgroundcd" m  " {%d" u  " a@ V@a  V@Va  #@0x{ cd" m ʁ ́ ]cornerRadiusX]cornerRadiusY_{{4, 4}, {120, 120}}" a : : > : N @gfdc JK" NPF0 0 09JK" NPL0.6 0.6 0.69d" ' \)*+"> V</YZ)*+"> /ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}W100 - td" ' \X"YZ[+\ a  : a: >  :@ I:\ N wf djcJK" NPL0.4 0.4 0.49d" '  \)*+"> V\/jZ)*+">  /ZV{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}V{0, 0}d" 1uv d" 6uۀ= xy : ;WPCFrame < = > ?}WPCFrame_PCMetadataObjectZPCDrawableXPCObjectd" Au B C D E Fԁ  I J K L" M N O P Q R Saa> W X>: Z>@aa `BYauSizCropVnewFacUapIn1TpathTapIDUcropRUapIn2UisRelUisColTcropVvarVal +_{{0, 0}, {0, 0}}_rasterview-128.png e f g h i j k" l m n o p q r s t u@R x y z {> } ~ @ B UcodeSUprColVprShTiSfraVcodePlVcodeFrUcodeFTsnShVexPropTpropUgenCHUgrTypVanLooCVprLinCUcodeL  cd" m  < Y V{JFIF}U{GIF}_"kCGImageDestinationBackgroundColorU{PNG}V{TIFF}_*kCGImageDestinationLossyCompressionQualitycd" m cd" m cd" m cd" m #?Zpublic.png]public.foldercd" m JK" NPL0.5 0 0 0.59SiosUcocoaUtouchVMyViewVUIViewxy _PCBitmapProperties }_PCBitmapPropertiesXPCObjectxy YPCFactory }YPCFactoryZPCDrawableXPCObject I J K L" M N O P Q R Saa> X>: Z>@aa B €+_1RasterView.app/Contents/Resources/rasterview.icns e f g h i j k" l m n o p q r s u@R x y {> @ C X ҁЁÁ сcd" m āŁƁǁȁɦ < ʁˀÝ́΀ V{JFIF}U{GIF}_"kCGImageDestinationBackgroundColorU{PNG}V{TIFF}_*kCGImageDestinationLossyCompressionQualitycd" m cd"  m cd"  m cd" m #?^com.apple.icnscd"  m JK" NPL0.5 0 0 0.59VMyViewVUIView I J K L" M N O P Q R Saa>  X>: Z>@aa 'BՁ ր+_rasterview-32.png e f g h i j k" l m n o p q r s + u@R x y 0 {> 3 4 @ D 9  ׁ ԁcd" = Dm > ? @ A B C؁فځہ܁ݦ E F< H I Jށ߀Y V{JFIF}U{GIF}_"kCGImageDestinationBackgroundColorU{PNG}V{TIFF}_*kCGImageDestinationLossyCompressionQualitycd" S Tm cd" W Xm cd" [ \m cd" _ `m #?cd" d em JK" hNPL0.5 0 0 0.59VMyViewVUIView I J K L" M N O P Q R Saa> p X>: Z>@aa yB +_rasterview-160.png e f g h i j k" l m n o p q r s } u@R x y {> @ E   cd" m  < Y V{JFIF}U{GIF}_"kCGImageDestinationBackgroundColorU{PNG}V{TIFF}_*kCGImageDestinationLossyCompressionQualitycd" m cd" m cd" m cd" m #?cd" m JK" NPL0.5 0 0 0.59VMyViewVUIView I J K L" M N O P Q R Saa> X>: Z>@aa B +_rasterview-256.png e f g h i j k" l m n o p q r s u@R x y {> @ F       cd" m  < Y V{JFIF}U{GIF}_"kCGImageDestinationBackgroundColorU{PNG}V{TIFF}_*kCGImageDestinationLossyCompressionQualitycd" m cd" m cd" m cd"  m #?]public.foldercd" m JK" NPL0.5 0 0 0.59VMyViewVUIViewd" '\YselectionZ{128, 128}1K" 9PE0.759_CICheckerboardGenerator e f g h i j k" l m n o p q r s> u@R   {> # $ %@ )  %&'#" $&cd" - 4m . / 0 1 2 3< 6 7 8 9 :Y ! _"kCGImageDestinationBackgroundColorV{JFIF}U{GIF}V{TIFF}U{PNG}_*kCGImageDestinationLossyCompressionQualitycd" C Dm cd" G Hm cd" K Mm L N [Compressioncd" S Tm #?_com.likethought.opacity.opacitycd" Y Zm JK" ]NPJ1 0 0 0.59SmacVquartz_MyDrawingFunctioncd" c mm d e f g h i j k l)*+,-./01 n n p q n s t n n223425622 _framePickerVisibleZhideRulers[windowFrame_layerViewDimension]hideVariablesZexpansionsYprintInfo]toolbarHidden_editFrameMetadata_{{262, 335}, {626, 523}}#@i`cd" m " \NSAttributesE7cd" m 89:;<=>? @AABC@DD _NSHorizontallyCentered]NSRightMargin\NSLeftMargin_NSHorizonalPagination_NSVerticalPagination_NSVerticallyCentered[NSTopMargin^NSBottomMargin "B"Bxy [NSPrintInfo }[NSPrintInfocd" m GHIJKLM B NTX]Ga _"com.likethought.opacity.preview.ui_(com.likethought.opacity.preview.elementsWfactory_#com.likethought.opacity.preview.web_&com.likethought.opacity.preview.cursorTtype_&com.likethought.opacity.preview.iphonecd" m ́OLP< ЀYCQ Ucolor[resolutionsd" ' RS"#\#?#?cd" m UVW n n 22@ VstatusWtoolbarTdockcd" m YZ [\ WaddressUimage_#http://likethought.com/opacity/web/_,http://likethought.com/opacity/web/image.pngcd" m ʁ^L_O KMV[]_avxz|~ "$%&()*,.012?BDGIKYg~      ( - / 1 3 H J L N P e g i k m t { !"!$!%!'!)!+!-!/!1!3!5!7!8!:!!@!B!D!F!S!`!b!k!p!r!t!v!!!!!!!!!!!!!!!!!!!!!"5"7"9":";"=">"?"A"C"E"F"G"T"W"Y"\"^"`"n"|"""""""##### # # #######%#2#4#=#B#D#F#H#]#_#a#c#e#z#|#~#############$7$9$:$<$>$@$B$D$F$H$J$L$M$O$Q$S$U$W$Y$[$h$u$w$$$$$$$$$$$$$$$$$$$$$$$$%%%J%L%N%O%P%R%S%T%V%Y%[%\%]%j%m%o%r%t%v%%%& &&&&&&&&&&&!&#&&&(&*&,&/&0&=&J&L&U&Z&\&^&`&u&w&y&{&}&&&&&&&&&&&&&&&&'P'S'T'W'Z'\'^'a'c'f'i'k'l'o'q's'u'x'{'~''''''''''''''''''''(( ((( (%('()(+(r(u(x(y(z(}(~((((((((((((((()9)<)=)@)C)E)G)J)L)O)Q)T)W)Z)\)^)a)d)e)r)))))))))))))))))))))))*********************************+++++ ++ +#+&+(+/+6+=+D+K+R+[+`+b+d+f+++++++++++++++++++++,,t,w,x,{,~,,,,,,,,,,,,,,,,,,,,,,,,,,-------!-$-&---4-;-B-I-P-X-a-d-g-i---------------..... ..%.'.0.5.8.;.=.R.T.W.Y.[.p.r.u.x.z............///// / / //////"/%/(/+/./0/>/L/c///////////////////000 00#0%0.0306090;0P0R0U0W0Y0n0p0s0v0x000000000001.111215181:1<1?1A1D1G1J1K1N1P1R1T1W1Z1]1j1w1y11111111111111111111112222 2Q2T2W2X2Y2\2]2^2`2c2e2f2g2t2w2z2}2222233333"3$3&3)3,3/3134373:3<3>3A3D3E3R3Y3[3h3u3w3333333333333333333333444 4 444444444444444444444444444444444555555%5,535:5A5H5Q5V5X5Z5\55555555555555555555566j6m6n6q6t6v6x6{6~66666666666666666666666666777777#7*71787?7F7N7W7Z7]7_777777777777777777788888&8+8.81838H8J8M8O8Q8f8h8k8n8p8w8~88888888888888999999 9 9 9999!9$9&949B9Y99999999999999999999::::::::0:2:5:7:9:N:P:S:V:X:_:f:m:t:{::::::;;;;;;;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ffffffffffffffffggggg!g&g)g,g1g4g7g9gAgGgmgggggggggggggggghhhh hhhhhh+h.h0h3h6h9h #include /* * Define some math constants that are required... */ #ifndef M_PI # define M_PI 3.14159265358979323846 #endif /* !M_PI */ #ifndef M_SQRT2 # define M_SQRT2 1.41421356237309504880 #endif /* !M_SQRT2 */ #ifndef M_SQRT1_2 # define M_SQRT1_2 0.70710678118654752440 #endif /* !M_SQRT1_2 */ /* * CIE XYZ whitepoint... */ #define D65_X (0.412453 + 0.357580 + 0.180423) #define D65_Y (0.212671 + 0.715160 + 0.072169) #define D65_Z (0.019334 + 0.119193 + 0.950227) /* * 'cielab()' - Map CIE Lab transformation... */ static float /* O - Adjusted color value */ cielab(float x, /* I - Raw color value */ float xn) /* I - Whitepoint color value */ { float x_xn; /* Fraction of whitepoint */ x_xn = x / xn; if (x_xn > 0.008856) return (cbrt(x_xn)); else return (7.787 * x_xn + 16.0 / 116.0); } static void decode_lab(unsigned char *val, float *lab) { lab[0] = val[0] / 2.55f; lab[1] = val[1] - 128.0f; lab[2] = val[2] - 128.0f; printf(" Lab = %.3f %.3f %.3f\n", lab[0], lab[1], lab[2]); } static void decode_lab16(unsigned short *val, float *lab) { lab[0] = val[0] / 655.35f; lab[1] = val[1] / 256.0f - 128.0f; lab[2] = val[2] / 256.0f - 128.0f; printf(" Lab = %.3f %.3f %.3f\n", lab[0], lab[1], lab[2]); } static void decode_rgb(unsigned char *val, float *rgb) { rgb[0] = val[0] / 255.0f; rgb[1] = val[1] / 255.0f; rgb[2] = val[2] / 255.0f; printf(" RGB = %.3f %.3f %.3f\n", rgb[0], rgb[1], rgb[2]); } #if 0 static void decode_rgb16(unsigned short *val, float *rgb) { rgb[0] = val[0] / 65535.0f; rgb[1] = val[1] / 65535.0f; rgb[2] = val[2] / 65535.0f; printf(" RGB = %.3f %.3f %.3f\n", rgb[0], rgb[1], rgb[2]); } #endif /* 0 */ static void decode_xyz(unsigned char *val, float *xyz) { xyz[0] = val[0] / 231.8181f; xyz[1] = val[1] / 231.8181f; xyz[2] = val[2] / 231.8181f; printf(" XYZ = %.3f %.3f %.3f\n", xyz[0], xyz[1], xyz[2]); } static void decode_xyz16(unsigned short *val, float *xyz) { xyz[0] = val[0] / 59577.2727f; xyz[1] = val[1] / 59577.2727f; xyz[2] = val[2] / 59577.2727f; printf(" XYZ = %.3f %.3f %.3f\n", xyz[0], xyz[1], xyz[2]); } static void encode_lab(float *lab, unsigned char *val) { float ciel, /* CIE L value */ ciea, /* CIE a value */ cieb; /* CIE b value */ /* * Scale the L value and bias the a and b values by 128 so that all * numbers are from 0 to 255. */ ciel = lab[0] * 2.55 + 0.5; ciea = lab[1] + 128.5; cieb = lab[2] + 128.5; /* * Output 8-bit values... */ if (ciel < 0.0) val[0] = 0; else if (ciel < 255.0) val[0] = (int)ciel; else val[0] = 255; if (ciea < 0.0) val[1] = 0; else if (ciea < 255.0) val[1] = (int)ciea; else val[1] = 255; if (cieb < 0.0) val[2] = 0; else if (cieb < 255.0) val[2] = (int)cieb; else val[2] = 255; printf(" Lab = %d %d %d\n", val[0], val[1], val[2]); } static void encode_lab16(float *lab, unsigned short *val) { float ciel, /* CIE L value */ ciea, /* CIE a value */ cieb; /* CIE b value */ /* * Scale the L value and bias the a and b values by 128 so that all * numbers are from 0 to 65535. */ ciel = lab[0] * 655.35 + 0.5; ciea = (lab[1] + 128.0) * 256.0 + 0.5; cieb = (lab[2] + 128.0) * 256.0 + 0.5; /* * Output 16-bit values... */ if (ciel < 0.0) val[0] = 0; else if (ciel < 65535.0) val[0] = (int)ciel; else val[0] = 65535; if (ciea < 0.0) val[1] = 0; else if (ciea < 65535.0) val[1] = (int)ciea; else val[1] = 65535; if (cieb < 0.0) val[2] = 0; else if (cieb < 65535.0) val[2] = (int)cieb; else val[2] = 65535; printf(" Lab = %d %d %d\n", val[0], val[1], val[2]); } static void encode_rgb(float *rgb, unsigned char *val) { // Save it... if (rgb[0] < 0.0f) val[0] = 0; else if (rgb[0] < 1.0f) val[0] = (int)(255.0f * rgb[0] + 0.5); else val[0] = 255; if (rgb[1] < 0.0f) val[1] = 0; else if (rgb[1] < 1.0f) val[1] = (int)(255.0f * rgb[1] + 0.5); else val[1] = 255; if (rgb[2] < 0.0f) val[2] = 0; else if (rgb[2] < 1.0f) val[2] = (int)(255.0f * rgb[2] + 0.5); else val[2] = 255; printf(" RGB = %d %d %d\n", val[0], val[1], val[2]); } #if 0 static void encode_rgb16(float *rgb, unsigned short *val) { // Save it... if (rgb[0] < 0.0f) val[0] = 0; else if (rgb[0] < 1.0f) val[0] = (int)(65535.0f * rgb[0] + 0.5); else val[0] = 65535; if (rgb[1] < 0.0f) val[1] = 0; else if (rgb[1] < 1.0f) val[1] = (int)(65535.0f * rgb[1] + 0.5); else val[1] = 65535; if (rgb[2] < 0.0f) val[2] = 0; else if (rgb[2] < 1.0f) val[2] = (int)(65535.0f * rgb[2] + 0.5); else val[2] = 65535; printf(" RGB = %d %d %d\n", val[0], val[1], val[2]); } #endif /* 0 */ static void encode_xyz(float *xyz, unsigned char *val) { /* * Output 8-bit values... */ if (xyz[0] < 0.0f) val[0] = 0; else if (xyz[0] < 1.1f) val[0] = (int)(231.8181f * xyz[0] + 0.5); else val[0] = 255; if (xyz[1] < 0.0f) val[1] = 0; else if (xyz[1] < 1.1f) val[1] = (int)(231.8181f * xyz[1] + 0.5); else val[1] = 255; if (xyz[2] < 0.0f) val[2] = 0; else if (xyz[2] < 1.1f) val[2] = (int)(231.8181f * xyz[2] + 0.5); else val[2] = 255; printf(" XYZ = %d %d %d\n", val[0], val[1], val[2]); } static void encode_xyz16(float *xyz, unsigned short *val) { /* * Output 8-bit values... */ if (xyz[0] < 0.0f) val[0] = 0; else if (xyz[0] < 1.1f) val[0] = (int)(59577.2727f * xyz[0] + 0.5); else val[0] = 65535; if (xyz[1] < 0.0f) val[1] = 0; else if (xyz[1] < 1.1f) val[1] = (int)(59577.2727f * xyz[1] + 0.5); else val[1] = 65535; if (xyz[2] < 0.0f) val[2] = 0; else if (xyz[2] < 1.1f) val[2] = (int)(59577.2727f * xyz[2] + 0.5); else val[2] = 65535; printf(" XYZ = %d %d %d\n", val[0], val[1], val[2]); } static void lab_to_xyz(float *lab, float *xyz) { float p; // Convert Lab to XYZ... if (lab[0] < 8) p = lab[0] / 903.3; else p = (lab[0] + 16.0f) / 116.0f; xyz[0] = D65_X * pow(p + lab[1] * 0.002, 3.0); xyz[1] = D65_Y * pow(p, 3.0); xyz[2] = D65_Z * pow(p - lab[2] * 0.005, 3.0); printf(" XYZ = %.3f %.3f %.3f\n", xyz[0], xyz[1], xyz[2]); } static void xyz_to_lab(float *xyz, float *lab) { float ciex, /* CIE X value */ ciey, /* CIE Y value */ ciez, /* CIE Z value */ ciey_yn; /* Normalized luminance */ /* * Normalize and convert to CIE Lab... */ ciex = xyz[0]; ciey = xyz[1]; ciez = xyz[2]; ciey_yn = ciey / D65_Y; if (ciey_yn > 0.008856) lab[0] = 116 * cbrt(ciey_yn) - 16; else lab[0] = 903.3 * ciey_yn; lab[1] = 500 * (cielab(ciex, D65_X) - cielab(ciey, D65_Y)); lab[2] = 200 * (cielab(ciey, D65_Y) - cielab(ciez, D65_Z)); printf(" Lab = %.3f %.3f %.3f\n", lab[0], lab[1], lab[2]); } static void rgb_to_xyz(float *rgb, float *xyz) { float r, /* Red value */ g, /* Green value */ b; /* Blue value */ /* * Convert sRGB to linear RGB... */ r = pow((rgb[0] + 0.055) / 1.055, 2.4); g = pow((rgb[1] + 0.055) / 1.055, 2.4); b = pow((rgb[2] + 0.055) / 1.055, 2.4); printf(" lRGB = %.3f %.3f %.3f\n", r, g, b); /* * Convert to CIE XYZ... */ xyz[0] = 0.412453 * r + 0.357580 * g + 0.180423 * b; xyz[1] = 0.212671 * r + 0.715160 * g + 0.072169 * b; xyz[2] = 0.019334 * r + 0.119193 * g + 0.950227 * b; printf(" XYZ = %.3f %.3f %.3f\n", xyz[0], xyz[1], xyz[2]); } static void xyz_to_rgb(float *xyz, float *rgb) { // Convert XYZ to sRGB... rgb[0] = 3.240479f * xyz[0] - 1.537150f * xyz[1] - 0.498535f * xyz[2]; rgb[1] = -0.969256f * xyz[0] + 1.875992f * xyz[1] + 0.041556f * xyz[2]; rgb[2] = 0.055648f * xyz[0] - 0.204043f * xyz[1] + 1.057311f * xyz[2]; printf(" lRGB = %.3f %.3f %.3f\n", rgb[0], rgb[1], rgb[2]); rgb[0] = rgb[0] <= 0.0 ? 0.0 : 1.055f * pow(rgb[0], 0.41666) - 0.055f; rgb[1] = rgb[1] <= 0.0 ? 0.0 : 1.055f * pow(rgb[1], 0.41666) - 0.055f; rgb[2] = rgb[2] <= 0.0 ? 0.0 : 1.055f * pow(rgb[2], 0.41666) - 0.055f; printf(" RGB = %.3f %.3f %.3f\n", rgb[0], rgb[1], rgb[2]); } int main(void) { int i; float rgb[3], xyz[3], lab[3], rgb2[3], xyz2[3]; unsigned char rgbval[3], xyzval[3], labval[3]; unsigned short xyzval16[3], labval16[3]; static struct { const char *name; unsigned char rgb[3]; } colors[] = { { "BLACK", { 0, 0, 0 } }, { "RED", { 255, 0, 0 } }, { "GREEN", { 0, 255, 0 } }, { "YELLOW", { 255, 255, 0 } }, { "BLUE", { 0, 0, 255 } }, { "MAGENTA", { 255, 0, 255 } }, { "CYAN", { 0, 255, 255 } }, { "WHITE", { 255, 255, 255 } } }; for (i = 0; i < 8; i ++) { rgbval[0] = colors[i].rgb[0]; rgbval[1] = colors[i].rgb[1]; rgbval[2] = colors[i].rgb[2]; printf("%-8sRGB = %d %d %d\n", colors[i].name, rgbval[0], rgbval[1], rgbval[2]); decode_rgb(rgbval, rgb); rgb_to_xyz(rgb, xyz); encode_xyz(xyz, xyzval); encode_xyz16(xyz, xyzval16); xyz_to_lab(xyz, lab); encode_lab(lab, labval); encode_lab16(lab, labval16); putchar('\n'); decode_lab(labval, lab); lab_to_xyz(lab, xyz2); xyz_to_rgb(xyz2, rgb2); encode_rgb(rgb2, rgbval); putchar('\n'); decode_xyz(xyzval, xyz); xyz_to_rgb(xyz, rgb); encode_rgb(rgb, rgbval); putchar('\n'); decode_lab16(labval16, lab); lab_to_xyz(lab, xyz2); xyz_to_rgb(xyz2, rgb2); encode_rgb(rgb2, rgbval); putchar('\n'); decode_xyz16(xyzval16, xyz); xyz_to_rgb(xyz, rgb); encode_rgb(rgb, rgbval); putchar('\n'); } return (0); } urf.desktop000066400000000000000000000002261407457743100132610ustar00rootroot00000000000000[Desktop Entry] Type=MimeType MimeType=image/urf Icon=rasterview.png Patterns=*.apple Name=Apple Raster File Comment=Apple Raster File Encoding=UTF-8 vnd.cups-raster.desktop000066400000000000000000000002441407457743100155230ustar00rootroot00000000000000[Desktop Entry] Type=MimeType MimeType=application/vnd.cups-raster Icon=rasterview.png Patterns=*.ras Name=CUPS Raster File Comment=CUPS Raster File Encoding=UTF-8 zoom-in.xbm000066400000000000000000000004461407457743100131760ustar00rootroot00000000000000#define zoom_in_width 16 #define zoom_in_height 16 static unsigned char zoom_in_bits[] = { 0xf0, 0x01, 0xf8, 0x03, 0x1c, 0x07, 0x0e, 0x0e, 0x47, 0x1c, 0x43, 0x18, 0xf3, 0x19, 0x43, 0x18, 0x47, 0x1c, 0x0e, 0x0e, 0x1c, 0x1f, 0xf8, 0x3f, 0xf0, 0x7d, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0xe0 }; zoom-out.xbm000066400000000000000000000004511407457743100133730ustar00rootroot00000000000000#define zoom_out_width 16 #define zoom_out_height 16 static unsigned char zoom_out_bits[] = { 0xf0, 0x01, 0xf8, 0x03, 0x1c, 0x07, 0x0e, 0x0e, 0x07, 0x1c, 0x03, 0x18, 0xf3, 0x19, 0x03, 0x18, 0x07, 0x1c, 0x0e, 0x0e, 0x1c, 0x1f, 0xf8, 0x3f, 0xf0, 0x7d, 0x00, 0xf8, 0x00, 0xf0, 0x00, 0xe0 };