RMDLLProgrammersGuide PDF
RMDLLProgrammersGuide PDF
RMDLLProgrammersGuide PDF
Note:
An online version of this manual contains information on the latest updates to Raster-
Master. To find the most recent version of this manual, please visit the online version at
www.rastermaster.com or download the most recent version from our website at
www.snowbound.com/support/manuals.html.
DOC-0131-09
Copyright Information
While Snowbound® Software believes the information included in this publication is correct as of the publication date,
information in this document is subject to change without notice.
UNLESS EXPRESSLY SET FORTH IN A WRITTEN AGREEMENT SIGNED BY AN AUTHORIZED
REPRESENTATIVE OF SNOWBOUND SOFTWARE CORPORATION MAKES NO WARRANTY OR
REPRESENTATION OF ANY KIND WITH RESPECT TO THE INFORMATION CONTAINED HEREIN,
INCLUDING WARRANTY OF MERCHANTABILITY AND FITNESS FOR A PURPOSE. Snowbound Software Cor-
poration assumes no responsibility or obligation of any kind for any errors contained herein or in connection with the fur-
nishing, performance, or use of this document.
Software described in Snowbound documents (a) is the property of Snowbound Software Corporation or the third
party, (b) is furnished only under license, and (c) may be copied or used only as expressly permitted under the terms of
the license.
All contents of this manual are copyrighted by Snowbound Software Corporation. The information contained herein is
the exclusive property of Snowbound Software Corporation and shall not be copied, transferred, photocopied, trans-
lated on paper, film, electronic media, or computer-readable form, or otherwise reproduced in any way, without the
express written permission of Snowbound Software Corporation.
Microsoft, MS, MS-DOS, Windows, Windows NT, and SQL Server are either trademarks or registered trademarks of
Microsoft Corporation in the United States and/or other countries.
Adobe, the Adobe logo, Acrobat, and the Acrobat logo are trademarks of Adobe Systems Incorporated.
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc.
in the United States and other countries.
iText, the Initial Developers of the Original Code are Bruno Lowagie and Paolo Soares. Portions created by Bruno
Lowagie are Copyright (C) 1999-2009 by Bruno Lowagie.
Kakadu JPEG2000© , is copyrighted by Dr. David Taubman, and is proprietary to NewSouth Innovations, Pty. Ltd, Aus-
tralia.
Aspose™, Aspose.Cells© (copyrighted 2003), Aspose.Words© (copyrighted 2003), and Aspose.Slides© (copy-
righted 2004), are all proprietary to Aspose Software, Pty. Ltd, Australia.
United States Government Restricted Rights
The Software is provided with RESTRICTED RIGHTS. Use, duplication or disclosure by the United States Govern-
ment is subject to restrictions as set forth under subparagraph (c)(1)(ii) of The Rights in Technical Data and Computer
Software clause of DFARS 252.227 –19 or subparagraphs (c)(i) and (2) of the Commercial Computer Software-
Restricted Rights at 48 CFR 52.227 – 19 as applicable. The Manufacturer is Snowbound Software Corporation, 309
Waverley Oaks Rd., Suite 401, Waltham, MA 02452, USA.
All other trademarks and registered trademarks are the property of their respective holders.
Manual Title: Snowbound RasterMaster® for Dynamic Link Library (DLL), Windows and UNIX Programmer’s Refer-
ence Guide
Part Number: DOC-0131-09
Revision: 9
RasterMaster DLL Release Number: 18.4
RasterMaster® SDK Release Number: 18.4
Printing Date: January 2014
Published by Snowbound Software Corporation.
309 Waverley Oaks Road, Suite 401
Waltham, MA 02452 USA
phone: 617-607-2000
fax: 617-607-2002
©1996 - 2014 by Snowbound Software Corporation. All rights reserved.
Table of Contents
Chapter 1 - Additions and Improvements 35
New Features 35
Reading Images 39
Displaying an Image 40
System Overview 41
Multi-page Images 44
Overview of Callbacks 46
Decompressing Images 46
Saving Images 46
iii
Chapter 5 - Printing Images 47
Printing Overview 47
Printing Functions 47
Normal Printing 47
Fast Printing 47
Servers 48
Clients 48
Solution 48
Transparency Overview 49
Preferred Formats 55
iv
24-Bit Color Images 55
IMG_animate() 60
IMG_antique_effect() 61
IMG_autocrop_bitmap() 61
IMG_auto_orient() 62
IMG_bitmap_info() 62
IMG_bitmap_palette() 64
IMG_color_combine() 65
IMG_color_separate() 66
IMG_color_gray() 67
IMG_create_handle() 67
IMG_create_handle_keep() 67
IMG_create_handle_shell() 68
v
IMG_decompress_bitmap() 69
IMG_decompress_bitmap_display() 70
IMG_decompress_bitmap_fd() 71
IMG_decompress_bitmap_mem() 71
IMG_decompress_bitmap_page() 72
IMG_decompress_fax() 73
IMG_decompress_fax_mem() 74
IMG_decompress_tiled_bitmap() 74
IMG_delete_bitmap() 75
IMG_delete_bitmap_keep() 76
IMG_dib_to_ddb() 77
IMG_display_bitmap() 77
IMG_display_bitmap_aspect() 78
IMG_display_bitmap_dti() 80
IMG_display_bitmap_iac() 80
IMG_display_bitmap_transp() 81
IMG_display_ddb() 82
IMG_erase_rect() 83
IMG_init_lib() 83
IMG_print_bitmap() 84
IMG_print_bitmap_fast() 85
IMG_remove_red_eye() 86
IMG_save_bitmap() 86
IMG_save_bitmap_fd() 87
vi
IMG_save_bitmap_mem() 88
IMG_set_encrypt() 89
IMG_unload_lib() 90
IMG_unload_plugins() 90
Scanning Constants 92
IMG_scan_acquire() 93
IMG_scan_acquire_feeder() 93
IMG_scan_acquire_feeder_fast() 94
IMG_scan_feeder_close() 94
IMG_scan_open_source() 95
IMG_scan_pages() 95
IMG_scan_pages_fast() 96
IMG_scan_get_cap() 97
IMG_scan_set_cap() 97
IMG_scan_set_caps() 98
IMG_scan_setup() 98
IMG_create_handle_ddb() 101
IMG_display_ddb_effect() 101
IMG_get_bitmap_palette() 102
IMG_get_croprect() 103
IMG_ifl_version() 104
IMG_ifl_version_ext() 104
vii
IMG_merge_bitmap() 105
IMG_merge_bitmap_alpha() 107
IMG_merge_bitmap_handle() 108
IMG_promote_8() 109
IMG_promote_24() 109
IMG_promote_32() 110
IMG_repaint_scroll() 111
IMG_scroll_bitmap() 112
IMG_set_croprect() 113
IMG_set_croprect_scroll() 114
IMG_set_display_angle() 115
IMG_set_statusbar() 116
IMG_zoom_bitmap() 117
IMG_zoom_bitmap_rect() 117
IMG_zoom_bitmap_1_to_1() 118
IMGLOW_map_image_to_wnd() 119
IMGLOW_map_wnd_to_image() 119
IMGLOW_get_fileinfo() 120
IMGLOW_get_fileinfo_page() 121
IMGLOW_set_rop() 121
IMGLOW_set_fileio() 123
IMGLOW_set_wipedelay() 123
viii
Standard Page Sizes 126
IMG_import_ascii() 127
IMG_RECT() 127
IMGLOW_get_ascii_attributes() 128
IMGLOW_get_ascii_page_width() 128
IMGLOW_set_ascii_attributes() 129
IMGLOW_autocolor() 131
IMGLOW_decompress_bitmap() 132
IMGLOW_decompress_bitmap_mem() 134
IMGLOW_detect_color() 135
IMGLOW_extract_text() 137
IMGLOW_extract_text_mem() 139
IMGLOW_get_anim_delay() 139
IMGLOW_get_bitmap_header() 140
IMGLOW_get_bitmap_name() 140
IMGLOW_get_custstring() 141
IMGLOW_get_display_rect() 141
IMGLOW_get_filetype() 142
IMGLOW_get_filetype_fd() 142
ix
IMGLOW_get_image_orientation() 143
IMGLOW_get_image_orientation_page() 143
IMGLOW_get_pages() 144
IMGLOW_get_pages_fd() 144
IMGLOW_get_pages_mem() 145
IMGLOW_get_tiff_tag() 146
IMGLOW_get_tiff_tag_page() 146
IMGLOW_get_tile_info() 147
IMGLOW_get_transp_color() 148
IMGLOW_is_tiled_image() 148
IMGLOW_save_bitmap() 149
IMGLOW_save_bitmap_mem() 150
IMGLOW_search_text() 151
IMGLOW_set_alias() 152
IMGLOW_set_alias_img() 154
IMGLOW_set_bitmap_name() 154
IMGLOW_set_comp_quality() 155
IMGLOW_set_dispfunc() 155
IMGLOW_set_document_input() 156
IMGLOW_set_document_page_size() 157
IMGLOW_set_image_orientation() 157
IMGLOW_set_jpeg_decompression 158
x
IMGLOW_set_jpeg2000_comp_ratio() 158
IMGLOW_set_jpg_interleave() 159
IMGLOW_set_msg_render_preferences() 160
IMGLOW_set_overlay_path() 160
IMGLOW_set_pdf_input() 161
IMGLOW_set_pdf_output() 162
IMGLOW_set_pdf_password() 162
IMGLOW_set_tiff_save_strips 163
IMGLOW_set_tiff_tag() 163
IMGLOW_set_transp_color() 164
IMGLOW_write_tiff_stream() 165
IMGLOW_set_cad_background() 167
IMGLOW_set_cad_input() 167
IMGLOW_set_cad_size() 168
IMGLOW_set_html_capabilities() 169
IMGLOW_set_html_home_dir() 170
IMGLOW_set_html_image_capability() 171
IMGLOW_set_html_input() 171
IMGLOW_set_html_javascript_capability() 172
IMGLOW_set_html_page_size() 172
IMGLOW_set_html_page_size_ratio() 173
xi
IMGLOW_set_html_page_size_ratio_capability() 173
IMGLOW_set_html_screen_dpi() 174
IMGLOW_set_html_use_page_breaks_exclusively() 174
IMGLOW_set_html_utf_bom() 175
IMGLOW_set_ooxml_license() 178
IMGLOW_ooxml_license_enable() 178
IMGLOW_set_ooxml_licenseW() 179
IMGLOW_get_ooxml_license_location() 180
IMGLOW_set_ooxml_license_filename() 180
IMGLOW_set_ooxml_license_filenameW() 181
IMGLOW_set_ooxml_license_path() 181
IMGLOW_set_ooxml_license_pathW() 182
IMG_auto_orient() 183
IMG_deskew_bitmap() 184
IMG_despeckle_bitmap() 184
IMGLOW_auto_invert() 185
IMGLOW_detect_blank_page() 186
IMGLOW_remove_halftone() 187
IMGLOW_remove_holepunch() 188
IMG_apply_profile() 191
xii
IMG_cmyk_to_rgb() 192
IMG_create_thumbnail() 192
IMG_deskew_bitmap() 193
IMG_despeckle_bitmap() 194
IMG_display_fit_to_height() 195
IMG_display_fit_to_width() 196
IMG_flip_bitmapx() 196
IMG_flip_bitmapy() 197
IMG_get_deskew_angle() 198
IMG_get_profile() 199
IMG_histogram_equalize() 199
IMG_invert_bitmap() 200
IMG_process_bitmap() 200
IMG_resize_bitmap() 201
IMG_resize_bitmap_bicubic() 202
IMG_resize_bitmap_interp() 203
IMG_resize_to_gray() 204
IMG_rgb_to_cmyk() 204
IMG_rotate_bitmap() 205
IMG_set_gamma() 206
IMG_set_lut() 207
IMG_sharpen_bitmap() 207
IMG_window_level() 208
IMGLOW_get_auto_detect() 209
xiii
IMGLOW_get_fileinfo_fd() 209
IMGLOW_get_palette() 210
IMGLOW_put_palette() 210
IMGLOW_read_pixel() 211
IMGLOW_set_auto_detect() 212
IMGLOW_set_decompsize() 212
IMGLOW_set_decomp_rect() 213
IMGLOW_set_decomp_reduction() 213
IMGLOW_set_dithermode() 214
IMGLOW_set_fast_convert() 214
IMGLOW_set_imnet_page_size() 215
IMGLOW_set_pcl_input() 216
IMGLOW_unset_auto_detect() 216
IMG_bayer_color() 218
IMG_bayer_mono() 219
IMG_color_gray() 220
IMG_dib_to_runs() 220
IMG_diffusion_color() 221
IMG_diffusion_mono() 221
IMG_halftone_mono() 222
IMG_mediancut_color() 223
IMG_octree_color() 223
IMG_popularity_color() 224
xiv
IMG_runs_to_dib() 225
IMG_thresh_mono() 226
IMGLOW_get_filetype_mem() 226
IMGLOW_get_raster() 227
IMGLOW_put_raster() 227
IMGLOW_set_alias_quality() 228
IMGLOW_extract_text() 229
IMGLOW_extract_text_mem() 231
IMG_save_document() 232
IMG_save_document_mem() 235
IMGLOW_set_fontmap_path() 238
IMGLOW_set_fontmap() 239
IMG_global_get_Xdisplay() 241
IMG_global_set_Xdisplay() 241
IMG_global_get_Xscreen 242
IMG_global_set_Xscreen 242
IMG_global_get_Xreserverd_colors() 243
xv
IMG_global_set_Xreserved_colors() 243
IMG_repaint_scroll() 243
IMG_scroll_bitmap() 244
IMG_zoom_bitmap() 246
IMG_zoom_bitmap_1_to_1() 246
IMG_zoom_bitmap_rect() 247
IMG_dib_to_GWorld() 249
IMG_dib_to_GWorld_bitDepth() 250
IMG_GWorld_to_dib() 250
IMG_display_bitmap_aspect() 251
IMG_repaint_scroll 252
IMG_scroll_bitmap() 253
IMG_set_croprect_scroll() 253
IMG_zoom_bitmap 254
IMG_zoom_bitmap_rect() 255
IMG_zoom_bitmap_1_to_1() 256
xvi
ANN_GRAPHIC_STRUCT Structure 261
Structure 261
Variables 262
SANN_activate_all_objects() 263
SANN_activate_object() 264
SANN_add_object() 264
SANN_choose_color() 265
SANN_choose_font() 265
SANN_choose_line_style() 265
SANN_choose_line_width() 266
SANN_create_ann() 266
SANN_deactivate_all_objects() 266
SANN_deactivate_object() 267
SANN_delete_all_objects() 267
SANN_delete_object() 268
SANN_display_annotations() 268
SANN_draw_object() 269
SANN_get_croprect() 269
SANN_get_object_bounds() 270
SANN_get_object_data() 270
SANN_get_object_info() 270
SANN_get_object_num() 271
SANN_highlight_object() 271
SANN_map_image_to_wnd() 272
xvii
SANN_map_wnd_to_image() 272
SANN_merge_ann() 272
SANN_mouse() 273
SANN_move_object() 274
SANN_print_annotations() 274
SANN_read_ann() 274
SANN_resize_object() 275
SANN_rotate() 275
SANN_set_bcolor() 276
SANN_set_croprect() 276
SANN_set_delete_flag() 276
SANN_set_fcolor() 277
SANN_set_font() 277
SANN_set_line_style() 278
SANN_set_line_width() 278
SANN_set_size() 279
SANN_write_ann() 279
Chapter 29 - Working with PDF and Other Document File Formats 281
Saving 282
xviii
Working with Black and White Images 283
Performance 283
Alpha 313
Animate 313
Annotate 314
xix
Aspect 314
Callback 315
Encrypt 315
Fit 316
Load 317
MFC_Sample 317
MFC_TextSearch_TextExtract_Sample 318
OCR 319
Page 321
Print 321
Scan 322
Tags 323
Transp 323
Vector_Convert 324
Zoom 324
xx
General Status/Error Codes 356
Output Document Has Much Larger File Size than the Original Document 358
Output Document Has Much Lower Quality than the Original Document 359
xxi
List of Tables
xxii
Table 12.19: IMG_decompress_tiled_bitmap Function Variables 75
xxiii
Table 13.7: IMG_scan_get_cap Function Variables 97
xxiv
Table 14.21: IMG_zoom_bitmap_1_to_1 Function Variables 118
xxv
Table 16.11: IMGLOW_get_anim_delay Function Variable 139
xxvi
Table 16.35: IMGLOW_set_comp_quality Function Variable 155
xxvii
Table 18.6: IMGLOW_set_html_page_size Function Variables 173
xxviii
Table 21.3: IMG_cmyk_to_rgb Function Variable 192
xxix
Table 21.27: IMGLOW_get_fileinfo_fd Function Variables 209
xxx
Table 22.12: IMG_thresh_mono Function Variables 226
xxxi
Table 26.4: IMG_display_bitmap_aspect Variables 251
xxxii
Table 28.18: SANN_get_object_data Function Variables 270
xxxiii
Table 29.2: IMGLOW_set_pdf_output Function Variables 282
Table A.3: File Type Constants listed by File Type Number 296
Table B.2: RasterMaster DLL Imaging SDK Docs Directory Files 308
Table E.2: General Error Define Values Retrieved from Status Property 356
xxxiv
Chapter 1 - Additions and Improvements
New Features
The following are the new features added to Version 18.4 of the product:
l Added the IMG_ifl_version_ext(int *major, int *minor, *update, *fix) method to return the
version number to all four digits.
l Added support for PDF portfolio packages. Previous versions of RasterMaster returned
a PDF_PACKAGE_NOT_SUPPORTED (-50) error when processing a PDF portfolio or
PDF package of documents. RasterMaster now supports this type of multi-document
package.
35
Chapter 1 - Additions and Improvements
Format Fixes
36
Chapter 2 - Quick Start
If you do not find the information that you are looking for in this manual, please open a support
ticket at http://support.snowbound.com to request a specific sample, for clarification of a
method description, or to help you find the information they need. We are dedicated to helping
our customers succeed and we are constantly enhancing our products based on feedback from
customers like you.
The Format Conversion sample uses three routines that are at the heart of RasterMaster:
The functions mentioned above are described in detail later in this manual. This manual also
covers the following topics:
1. How to read and save multi-page documents. For more information, please see Chapter
3, Saving and Reading Multi-page Images.
2. How to adjust the color, compression and resolution attributes of documents for per-
formance, better quality output, or smaller output.
3. How to extract text and search for text in documents. For more information, please see
Chapter 23, Document Conversion and Text Extraction Functions. Please note that
Snowbound Software does not yet support OCR (Optical Character Recognition). There-
fore, we can only extract text from documents that contain text. You can use Raster-
Master in conjunction with OCR tools from other companies if you need to extract text
from scanned document images.
37
Chapter 2 - Quick Start
We include a lot of code samples to help you get started. These samples are listed in Appendix
C, RasterMaster DLL Samples. We have also indexed our documentation and made it search-
able to help you find what you need quickly.
If you have any questions please do not hesitate to open a support ticket at http://sup-
port.snowbound.com .
The samples directory contains four subdirectories that contain the RasterMaster DLL
samples: MFC_Sample and C_Samples.
The MFC_Sample directory is described in Table 2-1. For more information, about each
sample, see Appendix C, RasterMaster DLL Samples.
Sample Description
Sample showing how to open, save, and zoom images.
MFC_Sample
See MFC_Sample for more information.
Sample showing how to search and extract text from
MFC_TextSearch_TextExtract_
MODCA:PTOCA and PDF files. See MFC_Tex-
Sample
tSearch_TextExtract_Sample for more information.
Sample showing how to use the command line to extract
TextSearch text from a MODCA:PTOCA and PDF files. See
Vector_Convert for more information.
The C_Samples are described in Table 2-2. For more information about each sample, see
Appendix C - RasterMaster DLL Samples.
Sample Description
Sample for merging in an alpha channel image. See
alpha
Alpha for more information.
Sample for animation test. See Animate for more inform-
animate
ation.
Sample showing how to use Image Library to:
Decompress an image
38
Chapter 2 - Quick Start
Sample Description
Use display with corrected aspect ratio
Decompress an image
Rotate to screen
Reading Images
39
Chapter 2 - Quick Start
Syntax
The input filename is a standard string pointing to an image file name. The RasterMaster DLL
always detects the format of an image (i.e. .TIF, .PCX, .GIF). The return value from the DLL is
simply a number by which to reference the image.
You may call this function as many times as desired. This is limited only by the amount of
memory available.
Displaying an Image
Syntax
This function displays the image referenced by imghandle at the xpos, ypos, xsize and ysize
coordinates in pixels.
Imghandle is the number used to reference the image to display. HDC is the Windows Device
Context which can be obtained from BeginPaint() in the WM_PAINT message.
Before your application exits or when the image is no longer needed, you should remove the
image from memory to free any memory used by the library internally. Use the function below to
accomplish this task.
Syntax
All negative values are errors. See Appendix E, Snowbound Error Codes for error descriptions.
40
Chapter 2 - Quick Start
System Overview
RasterMaster DLL includes the technical specifications described below.
l Supported Platforms:
l Intel x86
l Intel x64
l AMD
l AMD 64
l Development Environments:
l MSVC ++
l MFC
l Visual Studio
l Visual Basic
l Powersoft Powerbuilder
l Borland Delphi
l Minimum memory requirements are related to image size and necessary buffers. Buffers
may require multiple megabytes if images are large. For more information, please see
Determining Memory Requirements.
41
Chapter 2 - Quick Start
The amount of memory required to view documents varies depending on the size of the
documents you are processing and the number of documents you are processing at any
one time. The amount of memory needed increases as:
l You go from black and white, to grayscale, to color documents (bits per pixel
increases).
l You go from low resolution to high resolution documents (dots per inch / quality
increases).
l You go from small index card size images to large blueprint size images (number
of pixels increases).
The amount of memory required to display a document may be significantly larger than
the size of the document that is stored on disk. Just like a road map, the document is fol-
ded up and compressed when it is stored. In order to see the document, it must be unfol-
ded (decompressed) and spread out so you can see the whole map. The map takes up
much more room when open for viewing. The same is true of online documents. When a
document is open, a black and white letter size page at 300 dpi takes roughly 1MB of
memory to display and a color page takes 25MB.
Generally, higher quality documents require more memory to process. Snowbound Soft-
ware does not have a one-size-fits-all recommendation for memory because our cus-
tomers have such a variety of documents and different tolerances for the level of output
quality. However, you can try doubling the memory available to see if that resolves the
issue. Keep increasing memory until you stop getting out of memory errors. If you hit a
physical or financial limit on memory, then you can do the following:
l Decrease the quality of the images requested by decreasing bits per pixel, the res-
olution, or the size.
l Decrease the number of documents you have open at any one time.
To calculate the amount of memory required for an image, you will need to know the size
of the image in pixels and the number of bits per pixel in the image (black and white=1,
42
Chapter 2 - Quick Start
grayscale=8, color=24). If you do not know the height or width in pixels, but you do know
the size in inches and the dpi (dots per inch) of the image, then you can calculate the
size in pixels as (width_in_inches*dots_per_inch) = width_in_pixels.
To calculate the amount of memory (in bytes), multiply the height, width and number of
bits per pixel. Then, divide by 8 to convert from bits to bytes. See the following example:
43
Chapter 3 - Saving and Reading Multi-page Images
Multi-page Images
All Snowbound libraries decompress a single page at a time. This section describes the multi-
page formats and how to decompress, determine page count, and save multi-page images.
l TIFF
l DCX
l GIF
l MO:DCA/IOCA
l PDF
l MS Word - Reading
l MS Excel - Reading
l PowerPoint - Reading
l RTF - Reading
44
Chapter 3 - Saving and Reading Multi-page Images
Properties Description
Detects the number of pages in a file. See IMGLOW_get_
IMGLOW_get_pages()
pages() for more information.
Reads pages. Specify the specific page to import. See IMG_
IMG_decompress_bitmap() decompress_bitmap() for more information about this func-
tion.
Saves multi-page images.
For new files, new pages with the specified name are created
as necessary.
IMG_save_bitmap()
Note: Use a unique filename when saving to multi-page
formats; otherwise, images are automatically appended to
any file with the same name.
45
Chapter 4 - Callback Routines
Overview of Callbacks
Callback functions are useful for getting raw decompressed image data directly from a file
without using the library’s functions for displaying, printing, rotating, and more.
The low level functions for decompressing and saving images use function pointers passed in
as arguments. These are also called callback routines since they call back into the application.
These are mainly used to send image data (decompress) or retrieve image data (saving).
The format of the image data is always in Windows device independent bitmap (DIB) format.
This may be 1, 4, 8, or 24-bits per pixel. The data is always packed. That 1 byte will contain 8
pixels for a 1-bit per pixel image. Each raster is always on a long boundary or a multiple of 4
bytes. For 24-bit images, the data is stored as one byte each of blue, green, and red. The data is
a full 8-bits for each color.
Note:
If a negative value is returned from the callback, the save or decompress functions ter-
minate.
Decompressing Images
Use IMGLOW_decompress_bitmap() to decompress an image.
Syntax
Saving Images
Use IMGLOW_save_bitmap() to save an image.
Syntax
46
Chapter 5 - Printing Images
Printing Overview
All Snowbound products for Windows print to any device with a valid Windows printer driver
installed.
If a color or gray scale image is printed to a 1-bit or bi-level printer such as an HP-LASERJET
type printer, the image is dithered or reduced to 1-bit per pixel automatically.
The capabilities of the printer are detected by the Snowbound libraries to determine if the image
must be dithered. The technique employed is Stucky error diffusion. This technique simulates
grayscale by the placement of dots. The higher the resolution of the printer, the better the effect.
Note:
For color or grayscale images, IMG_print_bitmap_fast() command is the quick-
est.
Printing Functions
There are two printing functions available.
Normal Printing
Normally, to print an image, use the function below.
IMG_print_bitmap()
Fast Printing
To print an image using fast printing, use the function below.
IMG_print_bitmap_fast()
Fast printing is used with Postscript printers. It does a nice job of scaling and dithering images.
The whole image in its original size is sent to the printer with no preprocessing. A lot of pro-
cessing is done within the library when doing normal printing. See IMG_print_bitmap_fast() for
more information on fast printing.
Note:
This may not work with all printers.
47
Chapter 5 - Printing Images
Servers
Depending on the current Java Virtual Machine memory configuration for the Imaging server,
the need for additional resources may cause an out of memory error. Increasing the Java Virtual
Machine maximum heap size to the Imaging server during start up can help avoid memory
errors. Specify the minimum and maximum heap size by passing the parameter -Xms and -Xmx
to the Imaging server during start up, where the amount of memory is in megabytes or giga-
bytes you want to allocate to the Imaging server.
Clients
Each of the different browsers handles the increased resource demands uniquely. In some
cases, when printing documents that require additional resources, the document may print with
blank pages, fail to respond, or require the browser or computer to be restarted.
Solution
A workaround for this problem may be to download the document locally and then print it. If the
document does not have any annotations or the document is to be printed without annotations,
the original document can be downloaded and printed. However, if a document is to be printed
with annotations, a TIFF version of the document can be downloaded and printed.
48
Chapter 6 - Displaying and Saving Transparent Images
Transparency Overview
Transparency displays only the foreground colors of an image and ignores the specified back-
ground color when displaying the image. This is commonly used for icons in Internet HTML doc-
uments.
imghandle = IMG_decompress_bitmap(filename);
backcolor = IMGLOW_get_transp_color(imghandle);
3. Display the image as you would normally, but send in the transparent color with the state-
ment:
Note:
If the image does not contain transparent color information, you may receive the error
code NO_TCOLOR_FOUND
49
Chapter 6 - Displaying and Saving Transparent Images
50
Chapter 7 - Aspect Ratio Correction Functions
Function Description
Handles correction of aspect ratio but preserves the width
IMG_display_bitmap_aspect() and height of images when its window is resized. See
IMG_display_bitmap_aspect() for more information.
Maps screen coordinates to the image coordinates of a dis-
played image. Can be used for implementing a rubber band
IMGLOW_map_wnd_to_image()
zoom rectangle. See IMGLOW_map_wnd_to_image() for
more information.
Displays the area of the image specified by the passed-in
cropping rectangle. Also sets up the scroll bars to allow
IMG_set_croprect_scroll() scrolling.
51
Chapter 8 - RasterMaster Library
If the DPI information is present in the bitmap being compressed, then the information is
present in the DIB header. To change or look at the DPI information from an image use the fol-
lowing code:
change_dpi(void)
{
int image_handle;
HANDLE hdib;
LPBITMAPINFOHEADER lpbi;
int height,width,bit_pix;
image_handle = IMG_decompress_bitmap("filename.tif");
#ifdef PLATINUM
lpbi=(LPBITMAPINFOHEADER)IMG_get_bitmap_info
(image_handle,&width,&height,&bits_pix);
#else
hdib =IMG_bitmap_info(accu_handle,&width,&height,&bits_pix);
lpbi = (LPBITMAPINFOHEADER)GlobalLock(hdib);
#endif
/* set new value to 200 dots per inch */
lpbi->biXPelsPerMeter = 200;
lpbi->biYPelsPerMeter = 200;
#ifndef PLATINUM
GlobalUnlock(hdib);
#endif
return 0;
{
The structure elements are the biXPelsPerMeter and biYPelsPerMeter. The units are
always in DPI (dots per inch).
52
Chapter 9 - Display Quality
This will, however, take a little longer to display the image. By far, the best quality for 24-bit
images is obtained using the following call:
IMG_octree_color();
Use 256 for the number of colors to optimize to. This call permanently changes the image to an
8-bit image so you need only call the function once. The image contains an optimized palette;
allowing one quality image to be displayed at a time.
Large images at 200 DPI or larger must be scaled to fit on a standard resolution monitor. The
default scaling skips pixels so small lines or details may be ignored.
Aliasing
When the aliasing function is turned on, the scaling algorithm looks at neighboring pixels to pre-
serve details that might normally be lost.
Scale to Gray
The scale to gray function converts the neighboring pixels to an 8-bit gray scale value. Best res-
ults are obtained on text type documents.
53
Chapter 9 - Display Quality
Preserve Black
The preserve black function creates a 1-bit pixel based on neighboring pixels. This has been
found to work well on large engineering type drawings. It is suggested to try both to see which
yields the best results on the type of images you are using.
54
Chapter 10 - Image Compression
Preferred Formats
Most of the compression algorithms only compress a specific type of image data. Compression
techniques for 24-bit color images usually do not work well on 1-bit or bi-level images. Similarly,
compression for 1-bit images do not compress well for 24-bit color images.
55
Chapter 11 - File Format Conversion
All RasterMaster products import and convert file formats to Snowbound’s internal format at
decompress time. The format is a simple uncompressed DIB format stored in memory. This
format is decompressed or imported and can be saved out to any supported format. See
Appendix A, Supported File Formats for a complete list of supported file formats.
In general, RasterMaster handles details like file format, bit-depth, bit ordering and compression
formats automatically. You will need only a few RasterMaster calls to handle a wide variety of
input and output file types.
RasterMaster supports automatic promotion of images to destination files. For example, JPEG
images can only be written out at 8 and 24-bits per pixel. In order to save a 1-bit TIFF image as
JPEG, the developer must promote the TIFF to 8 or 24-bits per pixel.
In our other libraries, this is accomplished by calling one of the promote functions. In Raster-
Master, however, the library automatically determines the bits per pixel for the destination
format and promotes accordingly.
You can read in almost any type of image or document using the IMG_decompress_bitmap()
method. RasterMaster examines the content of the document and not the file type extension to
determine the file type. If a file does not have a file extension or has the wrong file name exten-
sion, RasterMaster will still identify the format correctly.
Before you read a document in, you have the option of adjusting the input quality. Reading in at
a high resolution DPI (dots per inch) will result in a higher quality document. This will give you
the option of producing higher quality output. However there is a trade-off. Higher quality doc-
uments take longer to process and take up more space in memory and when stored. You can
adjust the quality using one of the IMGLOW_set_document_input() methods.
56
Chapter 11 - File Format Conversion
RasterMaster will automatically read in black and white, grayscale, and color documents at the
appropriate bit-depth (1, 8 and 24 respectively). The bit-depths RasterMaster uses auto-
matically vary by input format. For more information on file formats, please see Appendix A,
Supported File Formats.
You can tell RasterMaster to read in color documents as black and white to increase per-
formance. You do this by calling IMGLOW_set_document_input() with a bit-depth of 1. You can
tell RasterMaster to read in black and white documents as color. However, that is not recom-
mended because it will hurt performance for no gain in quality.
Most of the time, the input that you read in will convert successfully to the output format you
select in either the IMG_save_bitmap() or IMG_save_document().
A Pixel_Depth_Unsupported error indicates that the bit-depths do not match. You can
look at the file formats you are using in Appendix A, Supported File Formats to compare the bit-
depths supported by your input and output file formats. The goal is to find a bit-depth that the file
formats have in common.
If you do not know the file format of the input file, you can use the IMGLOW_get_filetype() to
determine it. You can find the bit depth/bits per pixel of your image by calling IMG_bitmap_info()
and looking at the value in biBitCount.
In some cases, you will find you do not have enough bits-per-pixel to go to the desired output
format. If you are going from a black and white or grayscale to a color document that is color pro-
motion because the bit-depth is going from low to high. Please see the Chapter 14, Image Man-
agement Functions for information on RasterMaster functions that you can use to get to the bits
per pixel depth you need.
If you have too many bits per pixel for the desired output format, then you are going from color or
grayscale towards black and white. Going from a higher bits per pixel to a lower one is color
reduction. Please see the Chapter 22, Bit Depth Conversion Functions for information on
RasterMaster functions that you can use to adjust your image to a lower pixel depth.
The output quality is affected by several factors described in the sections below:
If you are reading in color documents and getting out black and white, then your bit-depth (color)
may be lower than that of your desired output. Try increasing bit-depth (color) of the input doc-
ument using IMGLOW_set_document_input().
If your output is coming out grainy, then check to see if your input is grainy too.
57
Chapter 11 - File Format Conversion
If the input document looks good, then increase the input DPI using IMGLOW_set_document_
input().
If the input is grainy, then you may need to do some image enhancement techniques. Contact
Snowbound Support at http://support.snowbound.com for help.
Color Reduction - Going from a Color Document to Black and White or Grayscale
RasterMaster will automatically handle color promotion and reduction. However there is no
excellent one-size-fits-all method for either of these. You can adjust the quality by using dif-
ferent color promotion or color reduction methods to fine tune your results. Please see the
Chapter 14, Image Management Functions and Chapter 22, Bit Depth Conversion Functions
chapters for more information.
Lossy Compression
If your output format is using a lossy compression, you may lose details. You may want to try a
different lossless output format.
In some rare cases, there may be an error during conversion. Please provide the input file and a
sample of the bad output to Snowbound Support at http://support.snowbound.com.
If you have selected high quality output and selected a high resolution (DPI) or a high bit-depth
(color), there will be a lot more data than for a lower quality image. The data takes longer to pro-
cess and takes more space. Please see Determining Memory Requirements for information on
determining your memory requirements. If you reduce the DPI or the bits per pixel in your input.
using IMGLOW_set_document_input() and/or in the output using color reduction, you should
see better performance and smaller files.
58
Chapter 12 - High Level Functions
IMG_animate()
IMG_antique_effect()
IMG_autocrop_bitmap()
IMG_auto_orient()
IMG_bitmap_info()
IMG_bitmap_palette()
IMG_color_combine()
IMG_color_separate()
IMG_color_gray()
IMG_create_handle()
IMG_create_handle_keep()
IMG_create_handle_shell()
IMG_decompress_bitmap()
IMG_decompress_bitmap_display()
IMG_decompress_bitmap_fd()
IMG_decompress_bitmap_mem()
IMG_decompress_bitmap_page()
IMG_decompress_fax()
IMG_decompress_fax_mem()
IMG_decompress_tiled_bitmap()
IMG_delete_bitmap()
IMG_delete_bitmap_keep()
IMG_dib_to_ddb()
IMG_display_bitmap()
IMG_display_bitmap_aspect()
IMG_display_bitmap_dti()
59
Chapter 12 - High Level Functions
IMG_display_bitmap_iac()
IMG_display_bitmap_transp()
IMG_display_ddb()
IMG_erase_rect()
IMG_init_lib()
IMG_print_bitmap()
IMG_print_bitmap_fast()
IMG_remove_red_eye()
IMG_save_bitmap()
IMG_save_bitmap_fd()
IMG_save_bitmap_mem()
IMG_set_encrypt()
IMG_unload_lib()
IMG_unload_plugins()
IMG_animate()
This function draws all frames of the animated GIF file passed in as bm_name once. Call repet-
itively for continuous display.
Use the delay time in the image for proper frame synchronization.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Animate sample.
Syntax
int SNBDAPI IMG_animate(IMGPORT hdc, char *bm_name, int xs, int ys,
int xsize, int ysize);
Remark
Variable Description
IMGPORT Device port (HDC) to draw images
bm_name Animated GIF filename to use
xs Starting x position to draw
ys Starting y position to draw
60
Chapter 12 - High Level Functions
Variable Description
xsize X size of image drawing rectangle
ysize Y size of image drawing rectangle
Returns
Returns the status of the animate operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_antique_effect()
This function converts color images to look as though they are antique photos. It replaces col-
ors with sepia tones, which are reddish brown monochrome tints. When applied to a photo, they
give the image a warm, antique feeling.
Note:
This function only works with 24-bit color images.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle
IMG_autocrop_bitmap()
This function finds and clips any white border around the image on every side. The border is dis-
carded and the image is resized to the new cropped rectangle plus the margin.
Note:
This function only works with 1-bit images. If you use this function with an image that is
not a 1-bit image, you will get a PIXEL_DEPTH_UNSUPPORTED (-21) error message.
See Appendix A, Supported File Formats for more information.
Syntax
61
Chapter 12 - High Level Functions
Remark
Variable Description
Standard image handle obtained from a decompress function
imghandle
such as IMG_decompress_bitmap()
margin Number of pixels to add to the autocrop rectangle
Returns
Returns the status of the autocrop bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_auto_orient()
This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you
may want to fix the image by using IMG_rotate_bitmap(). See IMG_rotate_bitmap() for
more information.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress function
imghandle
such as IMG_decompress_bitmap().
Angle returned as the current orientation. Number of pixels to
p_angle
add to the autocrop rectangle. Either 90 or 0 is returned.
Returns
Returns the status of the auto orient operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_bitmap_info()
This function gets information about the current image and returns a pointer to the DIB data in
memory.
All images decompressed or imported into the library are converted to a Windows DIB. It con-
tains a header BITMAPINFOHEADER, palette RGBQUAD, and the raw DIB data. See
Chapter 27 - Format for Decompressed Images for more information.
62
Chapter 12 - High Level Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Encrypt
l Fit
l Format Conversion
l Load
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l OCR
l Page
l Print
l Scan
l Tags
l Transp
l Zoom
Syntax
Remark
Variable Description
imghandle Standard image handle obtained from a decompress function
63
Chapter 12 - High Level Functions
Variable Description
such as IMG_decompress_bitmap()
width Pointer to an integer filled with the width of the image
height Pointer to an integer filled with the height of the image
bits_per_pixel Pointer to an integer filled with the bits per pixel of the image
Returns
Returns a memory handle for the DIB. Returns a pointer to an image in memory.
IMG_bitmap_palette()
This function loads the palette from the image specified by imghandle into the video adapter’s
lut. 4 and 8-bit images have palettes associated with them. For best display quality, the video
adapter’s lut or video dac must be loaded with this palette.
For a 24-bit image displaying on a 256-color adapter, the function loads a special rainbow
palette which the library creates internally. For 1-bit images with aliasing set to SCALE_TO_
GRAY, it loads a 256 gray scale palette.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Encrypt
l Fit
l Load
l Page
l Print
l Scan
64
Chapter 12 - High Level Functions
l Tags
l Transp
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows Device context to realize palette
Returns
Returns the status of the bitmap palette operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_bitmap_palette(nHandle, hdc);
IMG_color_combine()
This function combines 3 or 4 planes into a new 24 or 32-bit image. Each argument is a Raster-
Master image handle to an 8-bit gray scale image.
If the 4th argument is a valid handle, a 32-bit CMYK image is created. If the 4th argument is not
valid or -1, a 24-bit RGB image is created.
Syntax
Remark
Variable Description
Standard image handle for 8-bit gray-scale image which
blue_handle
represents the blue plane (cyan).
65
Chapter 12 - High Level Functions
Variable Description
Standard image handle for 8-bit gray-scale image which
green_handle
represents the green plane (magenta).
Standard image handle for 8-bit gray-scale image which
red_handle
represents the red plane (yellow).
Standard image handle for 8-bit gray-scale image which
k_handle represents the black plane (black). If negative, creates a
24-bit RGB image.
planes Number of planes for resulting image.
Returns
Returns the status of the color combine operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_color_separate()
This function gets an individual plane of color data and returns a new RasterMaster handle. The
new color plane is an 8-bit gray scale image.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
The plane can be one of the following:
Returns
Returns the status of the color separate operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
66
Chapter 12 - High Level Functions
IMG_color_gray()
This function converts a 24 or 32-bit image to an 8-bit grayscale image.
Syntax
Remark
Variable Description
hdib Handle of image to convert
Returns
Returns the status of the grayscale image operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_create_handle()
This function imports a Windows DIB created externally from the library. It returns a standard
image handle which is used for displaying, saving, or printing. This function makes a copy of
the image DIB and does not alter or delete the lpbih or the DIB data passed in.
Syntax
Remark
Variable Description
Pointer to a windows DIB in memory containing the
lpbih
header palette and raw image data
Returns
Returns the status of the create handle operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_create_handle_keep()
This function imports a Windows DIB created externally from the library. It returns a standard
image handle which can be used for displaying, saving, or printing.
67
Chapter 12 - High Level Functions
Note:
This function does not make a copy of the image DIB; it uses the pointer and data dir-
ectly. After a call to this function, do not delete the lpbih pointer or alter it in any way.
Syntax
Remark
Variable Description
Pointer to a windows DIB in memory containing the
lpbih
header palette and raw image data
Returns
Returns the status of the keep image handle operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_create_handle_shell()
This function sets up a blank image in the RasterMaster libraries so users can provide their own
image data. It is backwards compatible and is a replacement for IMG_create_handle_keep
(). This function is used in all Snowbound products.
A new RasterMaster image object is created with the specified width, height, and bits per pixel.
No image data is initialized.
Syntax
Remark
Variable Description
Pointer to a Windows DIB in memory containing only the
lpbih
header and palette.
Returns
Returns the status of the create handle shell operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
68
Chapter 12 - High Level Functions
IMG_decompress_bitmap()
This is the main function for loading a compressed or uncompressed image from disk. It con-
verts the data to a Windows DIB format in memory. It returns an image handle (integer) which
can be used to perform other operations on the image, such as print, rotate, display, and many
more.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Encrypt
l Fit
l Format Conversion
l Load
l Page
l Print
l Tags
l Transp
l Zoom
Syntax
Remark
Variable Description
filename File or path/filename of the image to load
69
Chapter 12 - High Level Functions
Returns
Returns the status of the decompress bitmap operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_decompress_bitmap_display()
This function is the same as IMG_decompress_bitmap() except the image is displayed
while being decompressed. The image is converted to a Windows DIB and stored in memory.
The return value is an integer for referencing the image for most other functions such as display,
print, rotate, and others.
Note:
This function is not recommended for 1-bit images. They decompress and display faster
using the normal IMG_decompress_bitmap() and IMG_display_bitmap() func-
tions. See IMG_decompress_bitmap() and IMG_display_bitmap() for more information.
Syntax
Remark
Variable Description
filename File or path/filename of the image to load.
hdc Windows device context in which to display.
xpos Starting X coordinate for display of image.
ypos Starting Y coordinate for display of image.
width Width for display of image.
height Height for display of image.
0 for no correction, 1 if you want the library to correct for
aspect ratio. The original image proportions will be
aspect
retained. This may make the height or width smaller than
expected but never larger.
Returns
Returns the status of the decompress bitmap display operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
70
Chapter 12 - High Level Functions
IMG_decompress_bitmap_fd()
This function decompresses from a file handle returned from Windows OpenFile() or _
lopen(). It returns an image handle (integer) which can perform other operations on the
image, such as print, rotate, display, and more.
The offset is usually set to 0, but may be any value for referencing images embedded within a
larger file. Data is converted to a Windows DIB in memory.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Format Conversion
l Page
Syntax
Remark
Variable Description
fd Handle returned from a Windows OpenFile() call
offset Offset into file for embedded images, usually 0
Page number starting at 0 for decompressing multi-page
page
files such as TIFF, DCX, or MODCA:IOCA
Returns
Returns the status of the decompress file handle operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_decompress_bitmap_mem()
This function decompresses from a memory pointer. It returns an image handle (integer) which
can be used to perform other operations on the image, such as print, rotate, display, and more.
Like all other decompress functions, the data is converted to a Windows DIB format in memory.
It is recommended that you use the GlobalAlloc() call for allocating memory.
71
Chapter 12 - High Level Functions
Note:
It is best to allocate an extra 30K of memory for the image buffer passed into the func-
tion.
Syntax
Remark
Variable Description
image_data Memory Pointer to compressed image data
Page number starting at 0 for decompressing multi-page
page
image files
Returns
Returns the status of the decompress bitmap memory operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_decompress_bitmap_page()
The function decompresses PDF images. It renders the image as a bitmap. This function is
used with the apdfplugin.dll. After decompress, all RasterMaster functions can be used such as
rotate, flip, zoom, etc.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l OCR
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
Note:
Only use this function when utilizing the optional Adobe PDF plugin.
72
Chapter 12 - High Level Functions
Syntax
Remark
Variable Description
Character string PDF file name to read. Must have .pdf
filename
extension.
page Desired page number starting at zero.
Returns
Returns the status of the decompress bitmap page operation. A value of 0 or 1 indicates suc-
cess. Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error
Codes for a list of error codes.
IMG_decompress_fax()
This function decompresses fax or proprietary image formats which uses the CCITT G3 or G4
compression algorithms. The programmer opens the file with OpenFile()or _lopen() then
reads any header information to get the height and width of the image and also maybe the fill
order. It then seeks to the beginning of the compressed data.
Call this function to decompress the data and convert it into a Windows DIB in memory. It
returns an image handle (integer) which can be used to perform other operations on the image,
such as print, rotate, display, and more.
Syntax
Remark
Variable Description
fd Handle returned from a Windows OpenFile() call
xsize Horizontal width of the image after decompression
ysize Vertical height of the image after decompression
type 2 for Group 3 2d images, 3 for Group 3, 4 for Group 4 fax
Bit order in each byte, may be 0 or 2
fill_order 0 = Normally for CALS
2 = Normally for G3 and G4
73
Chapter 12 - High Level Functions
Returns
Returns the status of the decompress fax operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_decompress_fax_mem()
This function decompresses fax or proprietary image formats which use the CCITT G3 or G4
compression algorithms. Using a memory pointer to the beginning of the compressed data, this
function decompresses the data and converts it into a Windows DIB in memory. It returns an
image handle (integer) which may perform other operations on the image, such as print, rotate,
display, and more.
Syntax
Remark
Variable Description
image_ptr Pointer to image data in memory
xsize Horizontal width of the image after decompression
ysize Vertical height of the image after decompression
2 = for group 3 2d images
type
3 = for group 3 and 4 for Group 4 images
Bit order in each byte, may be 0 or 2, normally:
fill_order 2 for G3 and G4
0 for CALS
Returns
Returns the status of the decompress fax memory operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_decompress_tiled_bitmap()
This function decompresses the tiled image/pathname specified by the filename and returns a
standard RasterMaster image handle. The tiled image is completely decompressed and all tiles
are assembled into one image.
74
Chapter 12 - High Level Functions
Syntax
Remark
Variable Description
bm_name Path/filename of tiled image to return information on
page Page number for multi-page files
Returns
Returns the status of the decompress tiled bitmap operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_delete_bitmap()
This function removes the image from memory when you are finished with it or when ter-
minating the application.
After a call to this function the image handle is no longer valid. This call should be used for each
image handle generated by the library.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Animate
l Annotate
l Aspect
l Encrypt
l Fit
l Load
l MFC_Sample
75
Chapter 12 - High Level Functions
l MFC_TextSearch_TextExtract_Sample
l OCR
l Page
l Print
l Scan
l Tags
l Transp
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
Returns
Returns the status of the delete bitmap operation. A value of 0 or 1 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMG_delete_bitmap_keep()
This function can be used in conjunction with IMG_create_handle_keep() to delete all
internal library structures and data. It will not delete the pointer passed to IMG_create_
handle_keep(). See IMG_create_handle_keep() for more information.
Syntax
76
Chapter 12 - High Level Functions
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
Returns
Returns the status of the delete bitmap keep operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_dib_to_ddb()
This function returns a DDB or old-style Windows bitmap (HBITMAP or Device Dependent Bit-
map). The original image is not altered.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
width Width of desired DDB
height Height of desired DDB
Returns
IMG_display_bitmap()
This function is a standard image display routine. It takes the standard image handle (returned
by a decompress function) and displays the image into the device context specified by hdc.
Hdc is normally obtained from BeginPaint() when handling the WM_PAINT message.
This function detects the video display adapter and may reduce the number of colors in the
image when displaying, such as when displaying a 24-bit image on a 256 color display adapter.
If display quality is poor, try some of the color reduction functions such as IMG_octree_
color(), IMG_mediancut_color() or IMG_bayer_color().
77
Chapter 12 - High Level Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Fit
l Load
l Page
l Print
l Scan
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows device context to display
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
Returns
Returns the status of the display bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_display_bitmap_aspect()
This function is an image display routine with corrected aspect ratio. It takes a standard image
handle and displays the image into the device context specified by hdc. Hdc is normally
obtained from BeginPaint() when handling the WM_PAINT message.
After displaying the image, it turns scroll bars on or off for correct scrolling. A zoom factor of 100
displays the image with a one to one pixel ratio. A zoom of 0 fits the image horizontally or ver-
tically into the window.
78
Chapter 12 - High Level Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows device context to display into
hwnd Handle to window in which to enable scroll bars
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
Zoom factor:
zoom 0 = fit to window
100 = display pixels one to one
Returns
Returns the status of the display bitmap aspect operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
79
Chapter 12 - High Level Functions
IMG_display_bitmap_dti()
This function is a special display function used with Document Technologies monitors. Since
this type of monitor can only scale images by 2, 3, or 4, it must first be scaled in memory before
being sent to the monitor using a value of 2, 3, or 4.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows device context in which to display
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
zoom Specify 2, 3, or 4 for display quality
Returns
Returns the status of the display bitmap Document Technologies operation. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMG_display_bitmap_iac()
This function is a special display function used with Cornerstone monitors. Since this monitor
can also rotate images, a rotate_angle value is specified.
Note:
This function allows the monitor to do anti-aliasing, so do not use IMGLOW_set_alias()
with this function.
80
Chapter 12 - High Level Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows device context in which to display
hwnd Windows handle in which to display
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
rotate_angle Specify 0, 90, 180, or 270
Returns
Returns the status of the display bitmap Cornerstone operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_display_bitmap_transp()
This function displays transparent GIF images. It only draws the foreground color when dis-
playing, not the background color.
This function compares each pixel to the background color passed in and does not draw fore-
ground pixels that are identical. To get the background color from an image, use the IMGLOW_
get_transp_color() function. See IMGLOW_get_transp_color() for more information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Encrypt
l Transp
Syntax
81
Chapter 12 - High Level Functions
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Windows device context to display
hwnd Handle of window within which to enable scroll bars
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
tcolor Background color of image to ignore
Returns
Returns the status of the display bitmap tranparent GIF operation. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_display_ddb()
This function displays a DDB obtained from IMG_dib_to_ddb() or any other DDB desired.
This may display 4 and 8-bit images faster on some display adapters. See IMG_dib_to_ddb()
for more information.
Syntax
Remark
Variable Description
hbitmap Old-style Windows DDB or HBITMAP
hdc Windows device context within which to display
xpos Starting X position to display image
ypos Starting Y position to display image
Returns
Returns the status of the device dependent bitmap (DDB) display operation. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
82
Chapter 12 - High Level Functions
IMG_erase_rect()
This function draws the specified color inside or outside the rectangle passed in. It is used for
black border erasing or to permanently fill a solid color inside an image.
Syntax
int SNBDAPI IMG_erase_rect(int hdib, int xs, int ys, int xsize, int
ysize, int color, int in_outflag);
Remark
Variable Description
hdib RasterMaster image handle to process
xs X start of rectangle in pixels
ys Y start of rectangle in pixels
xsize X size of rectangle in pixels
ysize Y size of rectangle in pixels
color Color to draw
1 = Draw inside rectangle
in_outflag
0 = Draw outside rectangle
Returns
Returns the status of the erase rectangle operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_init_lib()
This function loads the 32-bit DLL into memory and sets up the interface for calling functions.
Unload the library when finished to free resources. See IMG_unload_lib() for more information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Animate
83
Chapter 12 - High Level Functions
l Annotate
l Callback
l Encrypt
l Tags
Syntax
Returns
Returns the status of the initial library operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_print_bitmap()
This function is a standard image print routine. It takes a standard image handle and prints the
image into the device context specified by printerDC.
This function detects whether or not the printer is in color mode or black and white. If a black
and white printer is detected when printing a color or gray scale image, the image is reduced to
black and white using an error diffusion algorithm.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Annotate
l Print
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
printerDC Windows device context to printer
xpos Starting X coordinate for display of image
84
Chapter 12 - High Level Functions
Variable Description
ypos Starting Y coordinate for display of image
width Horizontal width to display image
height Vertical height to display image
Returns
Returns the status of the print bitmap operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_print_bitmap(
nHandle, hdc, (GetDeviceCaps(hdc, HORZRES) -
nHorRes) >> 1, (GetDeviceCaps(hdc, VERTRES) - nVertRes) >> 1,
nHorRes, nVertRes);
IMG_print_bitmap_fast()
This function is a special image print routine. It takes a standard image handle and prints the
image into the device context specified by printerDC.
This function is different from IMG_print_bitmap() because it sends the current Windows
DIB specified by the image handle directly to the printer using StretchDiBits(). The printer
is required to do the scaling and color reduction if necessary.
Note:
This call may fail on some printers. If you have any problems with this function, use the
standard IMG_print_bitmap(). See IMG_print_bitmap() for more information
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
printerDC Windows device context to printer
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
85
Chapter 12 - High Level Functions
Variable Description
width Horizontal width to display image
height Vertical height to display image
Returns
Returns the status of the print bitmap fast operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_remove_red_eye()
This function detects and converts very red eyes in photos to more natural colors.
Notes:
If xpos, ypos, xsize or ysize is set to -1, the entire photo is searched.
For best results, refine the search area.
Works only with 24-bit color images.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle
xpos Starting top left area for x coordinate
ypos Starting top left area for y coordinate
xsize Width of area to search
ysize Height of area to search
Returns
Returns the status of the remove red eye operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_save_bitmap()
This function saves an image to disk in any format desired. Once an image handle is obtained,
it may be saved out as almost any supported format.
One way to decrease the output file size is to use IMGLOW_set_document_input to specify a
lower DPI before opening the input file with IMG_decompress_bitmap. When saving to a JPEG
86
Chapter 12 - High Level Functions
file format, you can decrease the file size by decreasing the quality level of the compression
using the IMGLOW_set_comp_quality method.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Encrypt
l Format Conversion
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
Note:
If the type is -1, the library looks at the file extension for determining the output file type.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
filename File or path/filename for output image
See Appendix A, Supported File Formats for all image
type
types allowed and all files shipped with the product
Returns
Returns the status of the save bitmap operation. A value of 0 or 1 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMG_save_bitmap_fd()
This function saves an image to disk in any desired format. This allows saving anywhere into
an open file handle for embedded images.
87
Chapter 12 - High Level Functions
After calling OpenFile, the programmer may seek any position in the file. This save function
begins writing compressed data in the format specified by type at this location. Once an image
handle is obtained, it may be saved out as any supported format.
Note:
If the type is -1, the library looks at the file extension for determining the output file type.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
fd Windows file handle obtained from OpenFile or _lopen
See Appendix A, Supported File Formats for all image
type
types allowed
Returns
Returns the status of the save bitmap file handle operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_save_bitmap_mem()
This function saves an image to a memory pointer in the format specified by file type. After call-
ing GlobalAlloc() and GlobalLock(), the programmer sends the pointer to the saving
function. This function operates on only one page at a time. For multi-page saving, please use
IMG_save_bitmap().
The total size of the compressed image is returned in bytes. If using the same pointer more than
once, it is suggested that you clear the first 10 bytes to zero in order to avoid the library pre-
suming the memory location already contains an image.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the OCR sample.
Syntax
88
Chapter 12 - High Level Functions
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
memptr Windows memory pointer already allocated
See Appendix A, Supported File Formats for all image
type
types allowed
Returns
Returns the total size of the compressed image. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
Example 12.7:IMG_save_bitmap_mem
IMG_set_encrypt()
This function allows encrypting images while saving. The key passed in by the function is the
encryption key. The same key must be used before the image is read.
Syntax
Remark
Variable Description
on_off Turns encryption on or off for an image at save
key A long user defined key for encryption
Returns
Returns the set encryption. Any value less than zero is a Snowbound error code. See Appendix
E, Snowbound Error Codes for a list of error codes.
89
Chapter 12 - High Level Functions
IMG_unload_lib()
This function unloads the 32-bit DLL from memory. The programmer is free to load and unload
the library as many times as needed. Call this function after the library has been unloaded to
free resources. See IMG_init_lib() for more information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Animate
l Annotate
l Callback
l Encrypt
l Tags
l Transp
Note:
Any calls to the library fail after this call is made.
Syntax
Returns
Returns the unloaded library. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_unload_plugins()
This function unloads all RasterMaster plugins from memory. These include snbdpl1.dll (the
LZW plugin), pdfplug.dll (the PDF plugin), abic32.dll (the ABIC plugin), and more.
Syntax
90
Chapter 12 - High Level Functions
Returns
Returns the unloaded RasterMaster plugins from memory. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
91
Chapter 13 - Scanning Functions
Scanning Constants
IMG_scan_acquire()
IMG_scan_acquire_feeder()
IMG_scan_acquire_feeder_fast()
IMG_scan_feeder_close()
IMG_scan_open_source()
IMG_scan_pages()
IMG_scan_pages_fast()
IMG_scan_get_cap()
IMG_scan_set_cap()
IMG_scan_set_caps()
IMG_scan_setup()
Scanning Constants
Shown below is the structure for setting scanning parameters.
Syntax
Example 13.1:Scanning
92
Chapter 13 - Scanning Functions
IMG_scan_acquire()
This TWAIN scanning routine scans an image on the currently installed scanner or input device
and returns the standard library image handle.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Note:
IMG_scan_open_source() must be called first. See IMG_scan_open_source() for
more information.
Syntax
Remark
Variable Description
hwnd Current windows handle
0 = Do not display TWAIN dialog box.
showui
1 = Display TWAIN dialog box.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_acquire_feeder()
This TWAIN scanning function allows scanning from a scanner with an automatic document
feeder.
Call this function in a loop until the NO_MORE_PAGES error message is returned then close the
scanner with IMG_scan_feeder_close(). See IMG_scan_feeder_close() for more inform-
ation.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Note:
A negative value indicates (NO_MORE_PAGES) is returned when the feeder is empty.
93
Chapter 13 - Scanning Functions
Syntax
Remark
Variable Description
hwnd Current windows handle
0 = Do not display TWAIN dialog box
showui
1 = Display TWAIN dialog box
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_acquire_feeder_fast()
This function allows for new fast memory transfer scanning. A parameter can also be set to
duplex scanning if your scanner supports it.
Syntax
Remark
Variable Description
hwnd Current windows handle
0 = Do not display TWAIN dialog box
showui
1 = Display TWAIN dialog box
duplex 1 = set duplex scanning mode
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_feeder_close()
This TWAIN scanning function closes the scanner after calls to the IMG_scan_acquire_
feeder() function. Use this after receiving the NO_MORE_PAGES error message from the
IMG_scan_acquire_feeder() function. See IMG_scan_acquire() for more information.
94
Chapter 13 - Scanning Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Syntax
Returns
Returns the status of the close. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_open_source()
This TWAIN scanning function displays a dialog box which allows for setting available input
devices. It then displays a dialog box to select the available input devices.
Syntax
Remark
Variable Description
hwnd Handle of parent window for the source dialog
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_pages()
This TWAIN scanning routine scans all pages from the currently selected scanner or input
device and saves them to the path/filename specified by filename in the image format file type.
For multi-page formats, all pages are stored in a single multi-page file. For single page formats,
images are created with the following filenames: 00000000.img, 00000001.img, etc. for each
page.
For multi-page file types such as TIFF, DCX, or MO:DCA:OCA, you must specify a valid file-
name. For other file types, the filename can only contain a path.
Note:
Normally the showui will be turned off for multi-page scanning.
95
Chapter 13 - Scanning Functions
Syntax
Remark
Variable Description
hwnd Handle of parent window for the source dialog
filename Output file name to create as scanned image
See Appendix A, Supported File Formats for file type
filetype
formats in which to save compressed images
0 = Do not display TWAIN dialog box
showui
1 = Display TWAIN dialog box
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_pages_fast()
This function allows for new fast memory transfer scanning. A parameter can also be set to
allow duplex scanning if your scanner supports it.
It scans all pages from the currently installed scanner or input device and saves them to the spe-
cified path/filename. The file format is specified by the filetype parameter.
For multi-page formats, all pages are stored in a single multi-page file. For single page formats,
images are created with the following filenames: 0000000.img, 00000001.img, etc. for each
page.
For multi-page file types such as TIFF, DCX, or MO:DCA:IOCA you must specify a valid file-
name and all pages will be stored in a single multi-page image. For other file types, the filename
can only contain a path.
Syntax
Remark
Variable Description
hwnd Handle of parent window for the source dialog
96
Chapter 13 - Scanning Functions
Variable Description
filename Output file name
filetype File type (from imglib.h)
0 = Do not display TWAIN dialog box
showui
1 = Display TWAIN dialog box
duplex 1 = set duplex scanning mode
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_get_cap()
This function returns the value of the current specified TWAIN capability.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Syntax
Remark
Variable Description
hwnd Handle of parent window for the source dialog
cap TWAIN scanner capability to retrieve
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_set_cap()
This function sets the value of the specified TWAIN capability.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Syntax
97
Chapter 13 - Scanning Functions
Remark
Variable Descripition
hwnd Handle of parent window for the source dialog
cap Current TWAIN capability to set
value New setting for TWAIN capability
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_set_caps()
This function allows the user to set the scanning parameters such as height, width, and bits per
pixel for the current scanner.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Scan sample.
Syntax
Remark
Variable Description
new_caps Pointer to the SCAN_CAPS structure
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scan_setup()
This function TWAIN scanning routine allows the caller to bring up the TWAIN driver’s user
interface to set scanning parameters. After the parameters are set, they are saved. No scan-
ning occurs unless one of the other scan acquiring functions are called.
Syntax
98
Chapter 13 - Scanning Functions
Remark
Variable Description
hwnd Handle of parent window for the source dialog
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
99
Chapter 14 - Image Management Functions
IMG_create_handle_ddb()
IMG_display_ddb_effect()
IMG_get_bitmap_palette()
IMG_get_croprect()
IMG_ifl_version()
IMG_ifl_version_ext()
IMG_merge_bitmap()
IMG_merge_bitmap_alpha()
IMG_merge_bitmap_handle()
IMG_promote_8()
IMG_promote_24()
IMG_promote_32()
IMG_repaint_scroll()
IMG_scroll_bitmap()
IMG_set_croprect()
IMG_set_croprect_scroll()
IMG_set_display_angle()
IMG_set_statusbar()
IMG_zoom_bitmap()
IMG_zoom_bitmap_rect()
IMG_zoom_bitmap_1_to_1()
IMGLOW_map_image_to_wnd()
IMGLOW_map_wnd_to_image()
IMGLOW_get_fileinfo()
IMGLOW_get_fileinfo_page()
IMGLOW_set_rop()
100
Chapter 14 - Image Management Functions
IMGLOW_set_fileio()
IMGLOW_set_wipedelay()
IMG_create_handle_ddb()
This function allows importing of an old-style Windows HBITMAP or Device Dependent Bitmap
(DDB). It returns a standard library imghandle. This does not alter the original bitmap, but
simply copies and converts the data to the library’s internal DIB format.
Syntax
Remark
Variable Description
hbitmap Old-style Windows DDB or HBITMAP
hpalette Windows palette for the hbitmap image
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_display_ddb_effect()
This function displays the image, hbitmap, or DDB with the desired effect. These display
effects are also referred to as wipes.
Syntax
Remark
Variable Description
hbitmap Old-style Windows DDB or HBITMAP
hdc Windows device context in which to display
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
Display the following effect:
effect
1 - (Default) Display image with no image effects
101
Chapter 14 - Image Management Functions
Variable Description
2 - Displays image from the bottom to the top of the Window
3 - Displays image in the Window from the right to the left side in vertical
lines
4 - Displays image in the Window from the left to the right side using ver-
tical lines
7 - Displays image in the Window as blocks from the center of the Win-
dow
9 - Displays image in the Window as small blocks from the center of the
Window
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_get_bitmap_palette()
This function returns the palette of the image specified by imghandle in HPALETTE format.
The developer is responsible for releasing HPALETTE when finished with it.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
Returns
102
Chapter 14 - Image Management Functions
hPalette = (HPALETTE)::IMG_get_bitmap_palette(nHandle);
IMG_get_croprect()
This function returns the current crop rectangle for the imghandle. After decompression, the
default cropping rectangle is the height and width of the image.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Annotate
l Aspect
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l OCR
l Print
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
xpos Pointer to integer to receive the starting x coordinate
ypos Pointer to integer to receive the starting y coordinate
width Pointer to integer to receive the current crop width
height Pointer to integer to receive the current crop height
103
Chapter 14 - Image Management Functions
Returns
Returns the current crop rectangle for the image handle. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
if(pDC->IsPrinting())
{
hdc = pDC->GetSafeHdc();
::IMG_get_croprect(nHandle, &nOrgLeft, &nOrgTop, &nOrgWidth,
&nOrgHeight);
::IMG_set_croprect(nHandle, 0, 0, nWidth, nHeight);
IMG_ifl_version()
This function returns version information for your RasterMaster DLL.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Callback sample.
Syntax
Remark
Variable Description
Pointer to 8 bytes of memory to receive the major version
major
number
Pointer to 8 bytes of memory to receive the minor version
minor
number
Returns
Returns version information. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_ifl_version_ext()
This function returns version information for your RasterMaster DLL.
104
Chapter 14 - Image Management Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Callback sample.
Syntax
Remark
Variable Description
Pointer to 8 bytes of memory to receive the major version
major
number
Pointer to 8 bytes of memory to receive the minor version
minor
number
Pointer to 8 bytes of memory to receive the point release
update
or specific bug fix version number
Pointer to 8 bytes of memory to receive the EMR or other
fix
minor release version number
Returns
Returns version information. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_merge_bitmap()
This function permanently merges an image from disk with the image in memory using the
boolean function specified by raster_operation. This opcode allows ANDing and ORing over
the current image.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap().
Path/filename of disk image to merge onto the image in
filename
memory specified by imghandle.
raster_operation ROP opcode obtained from the list below or the Windows
105
Chapter 14 - Image Management Functions
Variable Description
SDK manual.
Note: These codes will not work in Unix. The valid Unix
OP Codes are:
GXclear
CXand
GXandReverse
GXcopy
GXandInverted
GXnoop
GXxor
GXor
GXequiv
GXinvert
GXorReverse
GXcopyInverted
GXorInverted
GXand
106
Chapter 14 - Image Management Functions
Variable Description
10 or PATPAINT = Combines the inverted source bitmap
with the pattern using the Boolean XOR operator. Com-
bines the result of this operation with the destination bit-
map using the Boolean OR operator.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_merge_bitmap_alpha()
This function merges a 32-bit alpha channel image onto a normal 24-bit DIB using the trans-
parency channel.
Syntax
Remark
Variable Description
Source alpha channel image to merge. Standard image
imghandle handle obtained from a decompress function such as
IMG_decompress_bitmap()
DIB_HEADER Pointer to 24-bit DIB to merge alpha channel image onto
xpos Starting x coordinate for which to merge image
ypos Starting y coordinate for which to merge image
1 = use transparency channel information to blend images
opaque
0 = do not draw any pixels with transparency channel
information pixels set
107
Chapter 14 - Image Management Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_merge_bitmap_handle()
This function merges two RasterMaster images specified by the source shdib and destination
dhdib image handles. The images merge at the coordinates’ xpos and ypos relating to the
upper left handle corner of the image.
Notes:
Both images must be 24, 8, or 1 bit(s) per pixel.
The pixel depth must be the same for the source and destination images.
You cannot merge an 8 bit image onto a 24 bit image. Use IMG_promote_8 or IMG_
promote_24 to match pixel depths.
Syntax
Remark
Variable Description
RasterMaster image handle for the destination image for
dhdib
which to be merged
RasterMaster image handle of source image being
shdib
merged into another image handle
Merging Raster operation
0= SRCCOPY - just copy pixels
rop 1 = SRCOR - Boolean Or of image pixels
2 = SRCAND - Boolean Anding of pixels; used for trans-
parent merging
xpos Starting x coordinate for which to merge image
ypos Starting y coordinate for which to merge image
Returns
Returns the source or destination image handle. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
108
Chapter 14 - Image Management Functions
IMG_promote_8()
This function permanently converts a 1 or 4-bit image to an 8-bit image in the current DIB spe-
cified by the imghandle.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvert8bitpromote()
{
SnowBndFuncCall(::IMG_promote_8);
}
IMG_promote_24()
This function permanently converts a 1, 4, or 8-bit image to a 24-bit image in the current DIB
specified by the imghandle.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
109
Chapter 14 - Image Management Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvert24bitpromote()
{
SnowBndFuncCall(::IMG_promote_24);
}
IMG_promote_32()
This function converts the 1, 4, 8, or 24-bit image to a 32-bit alpha channel image. 32-bit alpha
images contain 24 bits of red, green, and blue planes (8-bits each), and an extra (8-bits) alpha
channel plane for transparency.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress function such as
imghandle
IMG_decompress_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvert32bitpromote()
{
SnowBndFuncCall(::IMG_promote_32);
}
110
Chapter 14 - Image Management Functions
IMG_repaint_scroll()
This function should be called in the WM_PAINT message after a scroll message to repaint the
dirty scrolled area of the window.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Fit
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hdc Current windows device context
hwnd Current active window handle
scroll_dir Returned from IMG_scroll_bitmap()
Windows PAINTSTRUCT. Obtained from BeginPaint
ps
().
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
111
Chapter 14 - Image Management Functions
if(m_bRepaintScroll)
{
::IMG_repaint_scroll(nHandle,hdc,hwnd,m_nScrollDir,&((CPaintDC
*)pDC)->m_ps);
}
else
{
GetClientRect(rcClient);
IMG_scroll_bitmap()
This function is used in conjunction with IMG_repaint_scroll() for fast scrolling. Call this
function for handling the WM_HSCROLL and WM_VSCROLL Windows messages.
The value returned must be saved and passed to IMG_repaint_scroll(). The message,
wparam and lparam, are the arguments from the main windows handle procedure. See IMG_
repaint_scroll() for more information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Fit
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
112
Chapter 14 - Image Management Functions
Remark
Variable Descripton
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Current active window handle
wparam WPARAM from main windows procedure
lparam LPARAM from main windows procedure
message WM_HSCROLL or WM_VSCROLL
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
m_nScrollDir = ::IMG_scroll_bitmap
(GetDocument()->ImageHandle(), GetSafeHwnd(), uParam, nPos,
uMsg);
IMG_set_croprect()
This function sets the current crop rectangle for the imghandle. After decompression the default
cropping rectangle is the entire size of the image.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Print sample.
Note:
The cropping rectangle size cannot be bigger than the height or the width of the image.
Syntax
Remark
Variable Description
imghandle Standard image handle obtained from a decompress func-
113
Chapter 14 - Image Management Functions
Variable Description
tion such as IMG_decompress_bitmap()
xpos Integer to set the starting crop x value
ypos Integer to set the starting crop y value
width Integer to set the starting crop x width
height Integer to set the current crop y height
Returns
Returns the current crop rectangle for the image handle. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
if(pDC->IsPrinting())
{
hdc = pDC->GetSafeHdc();
::IMG_get_croprect(nHandle, &nOrgLeft, &nOrgTop, &nOrgWidth,
&nOrgHeight);
::IMG_set_croprect(nHandle, 0, 0, nWidth, nHeight)
IMG_set_croprect_scroll()
This function sets the cropping rectangle for the image represented by imghandle. It also turns
on or off the scrollbars to enable scrolling.
If aspect is set to 1 the aspect ratio is corrected. This slightly changes the cropping rectangle in
the X or Y direction.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Aspect
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
114
Chapter 14 - Image Management Functions
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Handle of window image is currently displayed in
xpos Starting X coordinate for cropping rectangle
ypos Starting Y coordinate for cropping rectangle
width Width of cropping rectangle
height Height of cropping rectangle
1 or True = aspect ratio on
aspect
0 = aspect ratio off
Returns
Returns the cropping rectangle for the image handle. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_set_display_angle()
This function rotates the angle of the image at display time when calling IMG_display_bit-
map_aspect(). The original image data is not affected. See IMG_display_bitmap_aspect()
for more information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Aspect
l Zoom
Syntax
Remark
Variable Description
imghandle Standard image handle obtained from a decompress func-
115
Chapter 14 - Image Management Functions
Variable Description
tion such as IMG_decompress_bitmap()
rotangle Rotates image by 0, 90, 180 or 270
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_set_statusbar()
This routine is called for each line processed when decompressing, saving, printing, or using
other functions. This allows the programmer to add a status bar or cancel the operation. To can-
cel, return a -1 in the statusbar callback routine.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Annotate
l Print
Syntax
Remark
Variable Description
Pointer allocated by the programmer. Use for data the programmer wants
private_data available when the callback routine is called. Helps avoid the use of
global variables.
statusbar Pointer to callback function.
116
Chapter 14 - Image Management Functions
Returns
Returns the scallback routine. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap()
This function is a standard library zoom function. A zoom value of 100 tells the function to dis-
play the whole image in the coordinates specified in the call to IMG_display_bitmap().
See IMG_display_bitmap() for more information.
Any value greater than 100 crops the image so only part of the image is displayed. If the entire
image does not fit into the current window, this function turns the scroll bars on or off.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Active window handle
zoom_factor Amount to zoom
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
Example 14.10:IMG_zoom_bitmap
IMG_zoom_bitmap_rect()
This function is most effective for resizing a window. It turns the scroll bars on or off to allow
scrolling.
Call this function after the WM_SIZE Windows message has been processed when repainting
the image with IMG_display_bitmap(). See IMG_display_bitmap() for more information.
117
Chapter 14 - Image Management Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Zoom sample.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Active window handle
lpzoom Rectangle in image to zoom about
lpclient Client rectangle of image
Used to specify image or screen coordinates
mode 0 = Screen Coordinates
1 = Image Coordinates
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap_1_to_1()
This function displays images with a one to one pixel ratio. A zoom value of 100 displays each
pixel of the image to one pixel on the screen.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Active window handle
zoom_level Amount to zoom
center_flag Recenters image if set to 1
118
Chapter 14 - Image Management Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_map_image_to_wnd()
This function translates the image coordinates passed in to reflect the window coordinates for
the displayed image. It takes into account scaling and cropping of the image on screen.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the MFC_TextSearch_TextExtract_Sample samples.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Handle of window image is displayed in
x Pointer to an integer of an X coordinate to convert
y Pointer to an integer of an Y coordinate to convert
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_map_wnd_to_image()
This function translates window coordinates to image coordinates for the displayed image. This
is useful for passing coordinates to the crop functions. Use IMG_set_croprect_scroll()
to display an area of the image and enable scrolling. See IMG_set_croprect_scroll() for more
information.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
119
Chapter 14 - Image Management Functions
l Aspect
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
hwnd Handle of window image is currently displayed in
x Pointer to an integer of an X coordinate to convert
y Pointer to an integer of an Y coordinate to convert
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_fileinfo()
This function gets image information by filling in the lpbih structure containing height, width and
bits per pixel for the image. This structure should be allocated large enough to fit the size of the
lpbih structure (40 bytes).
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Animate sample.
Syntax
Remark
Variable Description
filename Any valid existing image on the disk
lpbih Pointer to a BITMAPINFOHEADER structure
120
Chapter 14 - Image Management Functions
Returns
Returns the image information. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_fileinfo_page()
This function gets the file information such as width and height of a particular page from a multi-
page image or document.
Syntax
Remark
Variable Description
filepath Source file name to get information from
lpbih Structure of data to return with file information
page Page number within the document or image
Returns
Returns the file information. Any value less than zero is a Snowbound error code. See Appendix
E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_rop()
This function allows images to be displayed on the screen using ANDing, ORing or any other
legal Windows opcode.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap().
Boolean opcode to use when displaying the image. See
raster_op the list below for the available opcode or consult your
Windows SDK manual.
121
Chapter 14 - Image Management Functions
Variable Description
SRCCOPY = Copies the source bitmap to the des-
tination bitmap.
122
Chapter 14 - Image Management Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_fileio()
This function replaces the file I/O and calls the library when decompressing or saving an image.
These calls are called in place of the standard Windows file I/O function calls.
Use IMG_decompress_bitmap_fd() when using your own file I/O call routines. The para-
meters to these calls are the same as the normal Windows routines. See IMG_decompress_bit-
map_fd() for more information.
Syntax
Remark
Variable Description
newread_func Pointer read callback function
newwrite_func Pointer write callback function
newseek_func Pointer seek callback function
Returns
Returns the pointer callback function. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_wipedelay()
This function is used with IMG_display_ddb_effect() to speed up or slow down the
speed that the image is drawn on the screen.
Syntax
Remark
Variable Description
wipe_delay Delay time in seconds
123
Chapter 14 - Image Management Functions
Returns
Returns the delay time. Any value less than zero is a Snowbound error code. See Appendix E,
Snowbound Error Codes for a list of error codes.
124
Chapter 15 - ASCII Formats and Functions
The ASCII text format is not auto-detected by default. You may get a -7 FORMAT_NOT_
ALLOWED error when trying to convert the ASCII text format. To enable auto-detection of the
ASCII text format, call the IMGLOW_set_auto_detect() function with the file type number set to
38 for the ASCII file format before you get pages or decompress. Please see the example
below:
IMGLOW_set_auto_detect(38)
IMG_import_ascii()
IMG_RECT()
IMGLOW_get_ascii_attributes()
IMGLOW_get_ascii_page_width()
IMGLOW_set_ascii_attributes()
Syntax
125
Chapter 15 - ASCII Formats and Functions
Remark
1L << means shift a binary bit to the left by 1 position. Essentially this is 2 to the power of how-
ever many positions you shift.
Add up the values of all of the flags you want to turn on, then you end up with a hex number.
Flag Description
ASCIIXDPI (1L<<0) = 0
ASCIIYDPI (1L<<1) = 2
ASCIIMARGIN (1L<<2) = 4
ASCIITABSTOP (1L<<3) = 8
ASCIIPAGEWIDTH (1L<<4) = 16
ASCIIPAGEHEIGHT (1L<<5) = 32
ASCIIPOINTSIZE (1L<<6) = 64
ASCIICHARSPERLINE (1L<<7) = 128
ASCIILINESPERPAGE (1L<<8) = 256
ASCIIWEIGHT (1L<<9) = 512
ASCIIITALIC (1L<<10) = 1024
ASCIITYPEFACE (1L<<11) = 2048
Note:
To get the page count for ASCII files, use IMGLOW_set_auto_detect(38) before
getting the page count or decompressing. Please see IMGLOW_set_auto_detect for
more information,
126
Chapter 15 - ASCII Formats and Functions
IMG_import_ascii()
This function reads and converts ASCII data into a bitmap image. The value returned is a stand-
ard library image handle.
The ASCII text format is not auto-detected by default. You may get a -7 FORMAT_NOT_
ALLOWED error when trying to convert the ASCII text format. To enable auto-detection of the
ASCII text format, call the IMGLOW_set_auto_detect() function with the file type number set to
38 for the ASCII file format before you get pages or decompress. Please see the example
below:
IMGLOW_set_auto_detect(38)
Syntax
Remark
Variable Description
filename Path/filename of the ASCII file to convert
page Page number to start at
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_RECT()
This function implements serializable to convert an object into a format that can be stored in a
file or memory buffer. It provides four fields representing the four sides of a rectangle.
Syntax
int SNBDAPI IMG_RECT(int left, int top, int right, int bottom);
Remark
Variable Description
left Left edge (point on X axis).
top Top edge (point on Y axis).
right Right edge (point on X axis).
bottom Bottom edge (point on X axis).
127
Chapter 15 - ASCII Formats and Functions
Returns
Returns the field representing the four sides of a rectangle. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_ascii_attributes()
This function gets the current parameters for IMG_import_ascii(). It allows getting the font
margins and other parameters when converting the ASCII data to a bitmap. See IMG_import_
ascii() for more information.
Note:
Please note that this method is not thread safe.
Syntax
Remark
Variable Description
lpattributes Pointer to ASCIITEXTATTR structure
Returns
Returns the pointer to ASCIITEXTATTR structure. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_ascii_page_width()
This function calculates the minimum page width required to make a bitmap image from the
given ASCII file.
Syntax
Remark
Variable Description
filename Path/filename of the ASCII file to convert
128
Chapter 15 - ASCII Formats and Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_ascii_attributes()
This function sets the current parameters for IMG_import_ascii(). It allows setting the
font, margins, and other parameters when converting the ASCII data to a bitmap. See IMG_
import_ascii() for more information.
Note:
Please note that this method is not thread safe.
Syntax
Remark
Variable Description
lpattributes Pointer to ASCIITEXTATTR structure
Returns
Returns the pointer to ASCIITEXTATTR structure. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
129
Chapter 16 - Low Level Functions
IMGLOW_autocolor()
IMGLOW_decompress_bitmap()
IMGLOW_decompress_bitmap_mem()
IMGLOW_detect_color()
IMGLOW_extract_text()
IMGLOW_extract_text_mem()
IMGLOW_get_anim_delay()
IMGLOW_get_bitmap_header()
IMGLOW_get_bitmap_name()
IMGLOW_get_custstring()
IMGLOW_get_display_rect()
IMGLOW_get_filetype()
IMGLOW_get_filetype_fd()
IMGLOW_get_image_orientation()
IMGLOW_get_image_orientation_page()
IMGLOW_get_pages()
IMGLOW_get_pages_fd()
IMGLOW_get_pages_mem()
IMGLOW_get_tiff_tag()
IMGLOW_get_tiff_tag_page()
IMGLOW_get_tile_info()
IMGLOW_get_transp_color()
IMGLOW_is_tiled_image()
IMGLOW_save_bitmap()
IMGLOW_save_bitmap_mem()
IMGLOW_search_text()
130
Chapter 16 - Low Level Functions
IMGLOW_set_alias()
IMGLOW_set_alias_img()
IMGLOW_set_bitmap_name()
IMGLOW_set_comp_quality()
IMGLOW_set_dispfunc()
IMGLOW_set_document_input()
IMGLOW_set_document_page_size()
IMGLOW_set_image_orientation()
IMGLOW_set_jpeg_decompression
IMGLOW_set_jpeg2000_comp_ratio()
IMGLOW_set_jpg_interleave()
IMGLOW_set_msg_render_preferences()
IMGLOW_set_overlay_path()
IMGLOW_set_pdf_input()
IMGLOW_set_pdf_output()
IMGLOW_set_pdf_password()
IMGLOW_set_tiff_save_strips
IMGLOW_set_tiff_tag()
IMGLOW_set_transp_color()
IMGLOW_write_tiff_stream()
IMGLOW_autocolor()
This function displays multiple palette images at the same time. A single rainbow palette cre-
ated by the library is displayed when IMG_bitmap_palette() is called for any palette
image. See IMG_bitmap_palette() for more information.
This forces the library to dither all 8-bit images to this palette for best display quality when using
multiple palette images.
Syntax
131
Chapter 16 - Low Level Functions
Remark
Variable Description
0 = Off (default)
on_off
1 = On
Returns
Returns the multiple palette images. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_decompress_bitmap()
Use this routine if you are not interested in using the library’s high-level routines for displaying,
printing, or image processing. The low-level routine returns the image header and data in the
Windows DIB format.
The put_header routine is called from the library to return the header and palette information.
The put_dib_data is called for each raw raster.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Callback sample.
Syntax
Remark
Variable Description
File handle for the image obtained from OpenFile or _
fd
lopen.
offset File offset from which to begin decompression.
page Page number for multi-page files.
Pointer to "C" function to receive lines of image data. See
put_dib_data
put_dib_data for more information.
Pointer to private data passed into callbacks to be used
private_data
by the application.
Pointer to "C" function to receive header/palette inform-
set_header
ation. See set_header for more information.
132
Chapter 16 - Low Level Functions
Returns
Returns the image header and data in the Windows device-independent bitmap (DIB) format.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
Syntax
Remark
Variable Description
Same pointer as private_data (argument 5). Pointer
private_data that is passed to the set_header and put_dib_data
callback routine.
Buffer containing new raster data in DIB format. See
buffer
format for decompressed images.
Line number of raw data in buffer from image being decom-
ypos
pressed.
bytes Number of bytes in the buffer for one line of data.
Syntax
Remark
Variable Description
LPBITMAPINFOHEADER Standard image header information in DIB format. To be
133
Chapter 16 - Low Level Functions
Variable Description
followed by the palette data in RGBQUAD format. See
imglib.h for structures.
private_data Private data pointer for application use.
IMGLOW_decompress_bitmap_mem()
Use this low level decompress if you are not interested in using the library’s high level routines
for displaying, printing, or image processing. The low-level routine returns the image header and
data in the Windows DIB format.
The put_header routine is called from the library to return the header and palette information,
then the put_dib_data is called for each raw raster. The data is not retained by the library but
is sent to the callback routines only.
Syntax
Remark
Variable Description
imageptr Memory location from which to decompress.
page Page number for multi-page files.
Pointer to "C" function to receive lines of image data. See
put_dib_data
put_dib_data for more information.
Pointer to private data passed into callbacks to be used
private_data
by the application.
Pointer to "C" function to receive header/palette inform-
set_header
ation. See set_header for more information.
Returns
Returns the image header and data in the Windows device-independent bitmap (DIB) format.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes..
134
Chapter 16 - Low Level Functions
Syntax
Remark
Variable Description
Same pointer as private_data (argument 5). Pointer
private_data that is passed to the set_header and put_dib_data
callback routine.
Buffer containing new raster data in DIB format. See
buffer
format for decompressed images.
Line number of raw data in buffer from image being decom-
ypos
pressed.
bytes Number of bytes in the buffer for one line of data.
Syntax
Remark
Variable Description
Standard image header information in DIB format. To be
LPBITMAPINFOHEADER followed by the palette data in RGBQUAD format. See
imglib.h for structures.
private_data Private data pointer for application use.
IMGLOW_detect_color()
This function checks all pixels to determine if the image is color or gray scale. In documents
with a mix of black and white and color pages, you can improve performance and reduce the out-
put document size by ensuring the black and white pages are saved as 1-bit per pixel (mono-
chrome) rather than 24-bits per pixel (color). Use this function to detect the presence of
grayscale or color pixels on the current page. If the bit depth returned by this method is less
than the bit-depth returned by IMG_bitmap_info() in biBitCount, then you should consider
135
Chapter 16 - Low Level Functions
converting to a lower bit per pixel format. Snowbound Software recommends converting to
CCITT_TIFF_G4 format for black and white text images.
Notes:
The quality of the conversion to black and white or grayscale can be enhanced by spe-
cifying the alias and alias quality. We highly recommend the JPEG compression format
as the best compression available in our library for photo type images
Syntax
int IMGLOW_detect_color(void);
Returns
Returns the bits per pixel of the image. If this function returns 1, then this image contains only
black and white pixels. If this function returns 8, then this image contains grayscale data such
as black and white photo or shaded graphics. If this function returns 24, then this image con-
tains at least some content that uses full color. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
int x,bits_pix;
for (x = 0;x < pages; x++)
{
stat = tSimage.IMG_decompress_bitmap(st,x);
bits_pix = tSimage.IMGLOW_detect_color();
if (bits_pix == 24)
tSimage.IMG_save_bitmap("c:\\temp\\mix_java.-
tif",Snow.Defines.TIFF_LZW);
else
{
if (bits_pix == 8)
tSimage.IMG_thresh_mono();
tSimage.IMG_save_bitmap("c:\\temp\\mix_
136
Chapter 16 - Low Level Functions
java.tif",Snow.Defines.TIFF_G4_FAX);|
}
}
IMGLOW_extract_text()
This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files.
Returns the buffer of extracted text in ASCII format.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l MFC_TextSearch_TextExtract_Sample
l Vector_Convert
Syntax
Remarks
Variable Description
*bm_name Name of file from which to extract text
**ptr Pointer for buffer from which to receive extracted text
*length Pointer to an integer to return the length of the extracted buffer
page Page number of file from which to extract text
Returns
Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
Note:
Some PDF or PCL files may be in a format that will not allow text searching.
137
Chapter 16 - Low Level Functions
%%SOF
/Page=0
/Width=1700
/Height=2200
/FontName=TimesRoman
/FontHeight=44
/FontBold=1
/FontItalic=0
/Xpos=1300 /Ypos=240
%%SOT
Devadas
%%EOT
/Xpos=1253 /Ypos=240
%%SOT
S.
%%EOT
%%EOF
Variable Description
%%SOF Signals the start of the buffer
%%EOF Marks the end of extracted text
Specified once at the beginning of the file to indicate the
Page
page number
Specified once at the beginning of the file to indicate page
Width
width in pixels
Specified once at the beginning of the file to indicate page
Height
height in pixels
Font Name Name of font
FontHeight Font height in pixels
Font to be drawn plain or in bold
FontBold 1 = bold
0 = plain
Font to be drawn in normal or italic
FontItalic 1 = italic
0 = normal
Xpos X pos in pixels
Ypos Y pos in pixels
%%SOT Start of text block
%%EOT End of text block
138
Chapter 16 - Low Level Functions
IMGLOW_extract_text_mem()
This function extracts text from memory. It returns the buffer of extracted text in ASCII format.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the OCR sample.
Syntax
Remarks
Variable Description
*image_ptr Memory pointer to extract text from
**ptr Address of the pointer to the extracted text returned data
*length Pointer to the size of the extracted text buffer
page Page number of the input document/image to extract from
Returns
Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_anim_delay()
This function returns the animation delay time for GIF files which have a graphic extension
block containing the animation delay time parameter. If it is not found, the function returns the
error code NO_DELAY_TIME_FOUND.
Syntax
Remark
Variable Description
bm_name Path/filename of the file to return animation delay time
139
Chapter 16 - Low Level Functions
Returns
Returns the animation delay time for GIF files which have a graphic extension block containing
the animation delay time parameter. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_bitmap_header()
This function fills in the BITMAPINFOHEADER structure for the image referenced by
imghandle. It is used to get height, width, bits_pix and other information.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
header Pointer to BITMAPINFOHEADER structure
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_bitmap_name()
This function returns a text string from the image, if available. It is mainly used for TIFF images.
Each buffer should be at least 200 bytes.
Syntax
Remark
Variable Description
Pointer to memory to receive the name or author string
nameptr
from the last image decompressed
Pointer to memory to receive the date string from the last
dateptr
image decompressed
140
Chapter 16 - Low Level Functions
Returns
Returns the text string from the image. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_custstring()
This function returns a string stored in the RasterMaster product. The name of the corporation
licensed to use this product is embedded in the RasterMaster product by Snowbound Software.
This allows detection of the DLL or OCX to ensure that the user has the correct version.
Syntax
Remark
Variable Description
string Pointer in which to store custom string data
Returns
Returns the string stored in the RasterMaster product. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_display_rect()
This function returns the coordinates of the last displayed rectangle.
Syntax
Remark
Variable Description
hdib Handle to RasterMaster image
xs Starting x position (top)
xsize Height of display
ys Starting y position (left)
ysize Width of display
141
Chapter 16 - Low Level Functions
Returns
Returns the coordinates of the last displayed rectangle. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_filetype()
This function returns the filetype as defined in imglib.h.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Format Conversion
l MFC_Sample
Syntax
Remark
Variable Description
filename Path/filename of image to return file type
Returns
Returns the file type as defined in the image library (imgelib.h). For example, a Word file would
return the file type number 86. For a list of file type numbers, please see Appendix A, Supported
File Formats. Any value less than zero is a Snowbound error code. See Appendix E, Snow-
bound Error Codes for a list of error codes.
IMGLOW_get_filetype_fd()
This function returns the file types as defined in imglib.h for the file handle of the image currently
open.
The regular decompress bitmap starts at the beginning of the file, position zero. If the image you
want to open is embedded in a file, use IMG_ decompress_bitmap_fd to open the content at the
current position without rewinding to the beginning of the file.
Syntax
142
Chapter 16 - Low Level Functions
Remark
Variable Description
File handle obtained from OpenFile() or _lopen()
fd
Windows call
Returns
Returns the file type as defined in the image library (imgelib.h). For example, a Word file would
return the file type number 86. For a list of file type numbers, please see Appendix A, Supported
File Formats. Any value less than zero is a Snowbound error code. See Appendix E, Snow-
bound Error Codes for a list of error codes.
IMGLOW_get_image_orientation()
This function returns the orientation of TIFF, MO:DCA, and Kodak PCD images.
Syntax
Remark
Variable Description
filename Path/filename of image to return orientation information
Returns
Returns the orientation of TIFF, MO:DCA and Kodak PCD images. Any value less than zero is
a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_image_orientation_page()
This function returns the rotation angle for the file name and page specified. It is used to get the
orientation of images in multi-page file formats. It returns the same values as IMGLOW_get_
image_orientation().
Syntax
Remark
143
Chapter 16 - Low Level Functions
Variable Description
filename Path/filename of image to return orientation information
page Page number to return orientation
Returns
Returns the rotation angle for the file name and page specified. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_pages()
This function returns the number of pages for a multi-page file. If the file is not of the multi-page
variety (such as TIFF, .DCX, PDF, or MO:DCA:IOCA) the function returns 1.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Format Conversion
l MFC_TextSearch_TextExtract_Sample
l Vector_Convert
Syntax
Remark
Variable Description
filename Path/filename of image to return page information
Returns
Returns the number of pages for a multi-page file. A value of 0 or 1 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMGLOW_get_pages_fd()
This function returns the number of pages for a multi-page file. If the file is not of the multi-page
variety (such as TIFF or MO:DCA:IOCA), the function returns 1.
144
Chapter 16 - Low Level Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Multi-page Splitting and Saving samples.
Syntax
Remark
Variable Description
Integer file handle obtained from the low level file I/O “C”
fh
commands
Returns
Returns the number of pages for a multi-page file. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_pages_mem()
This function returns the number of pages from an image stored in the pointer passed as the
first argument. This is similar to IMGLOW_get_pages() but is used for an image stored in a
memory pointer.
It is recommended that you use the GlobalAlloc() call for allocating memory. After calling
GlobalAlloc() and GlobalLock(), send the pointer to the saving function.
Syntax
Remark
Variable Description
image_ptr Pointer to image data in memory
Returns
Returns the number of pages from an image stored in the pointer passed as the first argument.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
145
Chapter 16 - Low Level Functions
IMGLOW_get_tiff_tag()
This function reads a TIFF tag from the file specified by bm_name. The tag may be either a
string returned in buff or a long, int, or char returned in value.
If the return value is 1, the value returned is a string. A return value of 0 indicates a non-string
value.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Animate
l Tags
Syntax
Remark
Variable Description
tag TIFF tag number to return
max_bytes Maximum bytes to read for string tags
value Tag value returned
bm_name Filename to read tags from
buff String buffer for returning string tags
Returns
Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_tiff_tag_page()
This function reads a TIFF tag from the file specified by bm_name and page specified by page.
The tag may be either a string returned in buff or a long, int or char returned in value.
If the return value is 1, the value returned is a string. Return values of 0 indicate non-string val-
ues.
146
Chapter 16 - Low Level Functions
Syntax
Remark
Variable Description
tag TIFF tag number to return
max_bytes Maximum bytes to read for string tags
value Tag value returned
bm_name File name from which to read tags
buff String buffer for returning string tags
page Page number from which to read tags
Returns
Returns a string or a non-string value. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_tile_info()
This function fills in the tile structure information on width, height, tile width, and tile height.
Syntax
Remark
Variable Description
Path/file name of tiled image for which to return inform-
bm_name
ation
stile Pointer to the tile information structure to return
147
Chapter 16 - Low Level Functions
Long tile_height
Long num_tiles;
SNBDTILESTRUCT
Returns
Returns the filename of a tiled image. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_transp_color()
This function returns the background color for GIF images if this information is available in the
header. It returns 1 byte or NO_TCOLOR_FOUND error message if not available.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Encrypt
l Tags
l Transp
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_is_tiled_image()
This function returns 1 if the image passed as argument is a tiled image. Currently TIFF and
JEDMICS images can be tiled.
148
Chapter 16 - Low Level Functions
Syntax
Returns
Returns the value of the tiled image. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_save_bitmap()
This function is used when there is data from an external source not located in the library. For
instance, use this function when writing a scanner driver and the raw data needs to be saved to
disk as a TIFF file.
The low-level routines are called to receive each line of raw data from the application in Win-
dows DIB format.
Use lpbih to specify the height, width, bits_pixel, and palette of the output image.
Syntax
Remark
Variable Description
Windows file handle for image obtained from OpenFile
fd
() or _lopen().
Pointer to BITMAPINFOHEADER and palette of image to
lpbih
save.
type Image file type as which to save data.
Pointer to “C" function to retrieve lines of image data
get_dib_data get_dib_data(). See the get_dib_data for variable
descriptions.
Pointer to private data passed into callbacks to be used
private_data
by the application.
Returns
Returns the image header and data in the Windows device-independent bitmap (DIB) format.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
149
Chapter 16 - Low Level Functions
Syntax
Remark
Variable Description
Pointer for use by the application which is the same
private_data private pointer as passed into the get_dib_data call-
back
Buffer containing new raster data in DIB format. See
buffer
format for decompressed images
Line number of raw data in the buffer from image being
ypos
decompressed
bytes Number of bytes in the buffer for one line of data
IMGLOW_save_bitmap_mem()
This function saves any format to a memory location. The return value is the size in bytes of the
compressed image. Use lpbih to specify the height, width, bits_pixel, and palette of the out-
put image.
Syntax
Remark
Variable Description
imageptr Pointer to memory location to save data.
Pointer to BITMAPINFOHEADER and palette of image to
lpbih
save.
type Image file type for which to save data.
Pointer to "C" function to retrieve lines of image data. See
get_dib_data
get_dib_data for variable descriptions.
150
Chapter 16 - Low Level Functions
Variable Description
A pointer to private data passed into callbacks to be used
private_data
by the application.
Returns
Returns the status of the size in bytes of the compressed format. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
Syntax
Remark
Variable Description
Pointer for use by the application which is the same
private_data private pointer as passed into the get_dib_data call-
back.
Buffer containing new raster data in DIB format. See
buffer
format for decompressed images.
Line number of raw data in buffer from image being decom-
ypos
pressed.
bytes Number of bytes in the buffer for one line of data.
IMGLOW_search_text()
The function returns an array of structures of classes of the type, SNBD_SEARCH_RESULT.
For each class or structure there is an array of rectangles. This is to allow a search term to wrap
to a new line requiring more than two rectangles to highlight.
The nCount parameter will be set to the number of rectangles required for each instance of a
search term. The rectangles will be sorted from the top of the page to the bottom from the left
side to the right.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
151
Chapter 16 - Low Level Functions
l MFC_TextSearch_TextExtract_Sample
Note:
The following file formats are supported: AFP, PCL, PDF, Word and Excel.
Syntax
Remark
Variable Description
Character buffer to search. Returned from a call to
buffer
IMGLOW_extract_text().
search_string Search string
Determines if the search is case sensitive.
case_sensitive 0 = Not case sensitive
1 = case sensitive
error Error code
Returns
Returns the status of the array of structures of classes of the type, SNBD_SEARCH_
RESULT. Any value less than zero is a Snowbound error code. See Appendix E, Snowbound
Error Codes for a list of error codes.
IMGLOW_set_alias()
This function displays scaled-down (zoomed out) 1-bit (black and white) and color images.
Preserve Black checks neighboring pixels for any adjacent black values and literally inter-
polates (inserts) black pixels so that small black lines or objects are not lost when scaling a
large black and white image. It is recommended to use preserve black for large schematics and
engineering drawings.
Scale to Gray converts a black and white image to gray scale upon display when zooming out
on a large drawing or document. It is recommended for use with documents or other images that
contain text.
Scale to Color is used when scaling down color images and prevents loss of visual data, cre-
ating a smoother rendering of text and lines.
Alias All turns scale to gray and scale to color on and is the default setting.
152
Chapter 16 - Low Level Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Aspect
l Fit
l Load
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Page
l Print
l Scan
l Tags
l Zoom
Syntax
Remark
Variable Description
Sets the aliasing factor. Choose from:
0 = No aliasing
1 = Use the preserve black algorithm
alias_type
2 = Use the scale to gray algorithm
3 = Use the scale to color algorithm
4 = Alias all. Use scale to gray and scale to color
Returns
Returns the status of the aliasing factor. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
153
Chapter 16 - Low Level Functions
IMGLOW_set_alias_img()
This function sets the aliasing factor for the specified image. It is used to turn aliasing on or off
for a specific image when one or more images are loaded in memory. See IMGLOW_set_alias()
for more information.
Syntax
Remark
Variable Description
hdib Handle to RasterMaster image
Sets the aliasing factor. Choose from:
0 = No aliasing
1 = Use the preserve black algorithm
alias
2 = Use the scale to gray algorithm
3 = Use the scale to color algorithm
4 = Alias all. Use scale to gray and scale to color
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_bitmap_name()
This function sets a text string such as image name or author for the image, if the format sup-
ports it. Each buffer should be at least 200 bytes.
Syntax
Remark
Variable Description
Pointer to memory to set name or author string for any sub-
nameptr
sequent images to be saved
Pointer to memory to set date string for any subsequent
dateptr
images to be saved
154
Chapter 16 - Low Level Functions
Returns
Returns the pointer to memory. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_comp_quality()
This function sets the compression ratio to quality factor to use when saving JPEG images.
This is a global setting and affects all threads. The default value is 70. This is a write only set-
ting. There is no get method.
Syntax
Remark
Variable Description
Integer between 1 - 100
quality 0 = Smallest file size but least quality
100 = Best image quality and largest file size
Returns
Returns the compression ratio to quality factor. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_dispfunc()
This function calls the callback routine, before display, to allow the application to process data.
The Snowbound library will have already scaled, gamma corrected, brightened, contrasted and
color reduced the image.
Syntax
Remark
Variable Description
DISPLAYCB Pointer to a C callback routine
155
Chapter 16 - Low Level Functions
Returns
Returns the callback routine. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_document_input()
This function sets the level of color and resolution quality when reading in documents for the
specified document format. This function should be called before the input document is read in
using IMG_decompress_bitmap().
You can override RasterMaster’s default bits-per-pixel and DPI settings for the specified format
using this function.
l Set the input bits-per-pixel to 1 for black and white input to remove the extra overhead
and performance costs of processing color images.
l Increase your output image quality by increasing the input document DPI.
l Increase your processing throughput by decreasing the document DPI or bits per pixel.
Note:
The default is 200 DPI and 24 bits per pixel for PDF. The default is 300 dpi and 1 bit per
pixel for PCL, AFP, Word, and Excel.
Syntax
Remark
Variable Description
Sets the input resolution in dots per inch. A higher dpi
dpi yields a higher quality document that takes longer to pro-
cess and takes up more memory and storage space.
Sets the bits per pixel.
bits_pix
1 = black and white documents
156
Chapter 16 - Low Level Functions
Variable Description
24 = color images
Returns
Returns the status of the document input. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.,
IMGLOW_set_document_page_size()
This function sets the document's page size.
Note:
Currently, this method only supports .xls and .xlsx files.
Syntax
Remark
Variable Description
height Sets the page size height. Units in inches.
width Sets the page size width. Units in inches.
Sets the format parameter. A file format number as spe-
format cified in Appendix A, Supported File Formats i.e. Excel
(XLS) is 84.
Returns
Returns the status of the document page size. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_image_orientation()
This function sets the orientation for CALS or TIFF images. It orients the image in 45 degree
increments.
157
Chapter 16 - Low Level Functions
Syntax
Remark
Variable Description
orient Integer value between 0 and 8
Returns
Returns the status of the image orientation. A value of 0 or 1 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_set_jpeg_decompression
This function gets the frequency components in JPEG images after the Huffman decom-
pression. These values will also be de-quantized. They will replace the internal RGB data nor-
mally returned from decompressing a JPEG image.
The components will be in the exact same order as the uncompressed image, except they will
be 32-bit integer values for each plane.
Syntax
Remark
Variable Description
0 = normal JPEG decompression
mode 1 = returns the array of 8x8 blocks of frequency com-
ponents
Returns
Returns the status of the JPEG decompression. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_jpeg2000_comp_ratio()
This function specifies the amount of compression when saving a JPEG2000 file. The integer
value is the final desired compressed size in kilobytes.
158
Chapter 16 - Low Level Functions
Note:
JPEG2000 is available as an optional add on to the Windows DLL and ActiveX product.
Syntax
Remark
Variable Description
comp_ratio Compression ratio of JPEG2000 output file
Returns
Returns the status of the JPEG2000 compression ratio. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_jpg_interleave()
This function sets values for blue and red chroma decimation. This function should be used
before saving images to JPEG format.
A value of 2 for h and 2 for v will skip every other chroma pixel horizontally and vertically. This
may give better compression results for saving images as JPEG.
The default is 2:1, though the best quality will be at 1:1. Developers should experiment with a
value, to determine which will give the best image compression while maintaining acceptable
quality.
Syntax
Remark
Variable Description
h_int Horizontal interleaving factor
v_int Vertical interleaving factor
Returns
Returns the status of the JPEG interleave factor. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
159
Chapter 16 - Low Level Functions
IMGLOW_set_msg_render_preferences()
This function sets the rendering preferences for Microsoft’s .MSG files. This preference is loose
and may not actually take effect due to technical complications such as there is no data of that
type within the .MSG file.
Syntax
Remark
Variable Description
Rendering data source preference for email body data.
ASCII, Unicode, RTF, and HTML are recognized but may
preferences
not be all supported. Please see Appendix A, Supported
File Formats for the specific integer values.
Returns
Returns the status of rendering preferences for Microsoft’s .MSG files. Any value less than
zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error
codes.
IMGLOW_set_overlay_path()
This function sets the path for overlay files for PT:OCA images. The library searches this path
for overlay files required by PT:OCA images. If you pass in a NULL parameter, it toggles
between the two ways in which the overlay file is decompressed.
For example, you have a check overlay image file (the file has a check image on a larger white
background). If a null parameter is entered, toggling occurs, which lets you retrieve just the
check image itself without the extraneous white space. This way, you just get the check image.
Calling this method again retrieves the original image.
Note:
This function is only used with certain overlay files.
Syntax
160
Chapter 16 - Low Level Functions
Returns
Returns the status of overlay path. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_pdf_input()
This function converts PDF files into a raster image when being decompressed into Raster-
Master products. This function allows the type of bitmap created to be specified.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
Note:
PDF reading is an optional module available in the PDF plugin for Windows DLL and Act-
iveX products.
Syntax
Remark
Variable Description
Controls the width and height of the file. Set to 200 or 300
dpi for black and white images. Set to 100 or 200 for color
images.
Allows importing color or black and white images.
bits_pix 1 = black and white documents
24 = color images
Returns
Returns the status of PDF input. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
161
Chapter 16 - Low Level Functions
IMGLOW_set_pdf_output()
This function sets the destination size for saving PDF files. The xsize and ysize are the output
sizes in points. A point is 1/72 of an inch. Only PDF, PCL, and AFP file formats can be saved.
The PCL and APF file formats are saved as bitmap. The PDF file format can be saved as bit-
map or searchable text.
Syntax
Remark
Variable Description
double xsize Width of image in points
double ysize Height of image in points
Returns
Returns the status of PDF output. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_pdf_password()
This function allows passing a password string to allow for decompressing PDF files that are
password protected. You should make this call before calling any of the RasterMaster decom-
press calls such as IMG_decompress_bitmap().
Syntax
Remark
Variable Description
String represented password to use to open a password
filename
protecting PDF file
Returns
Returns the status of PDF password. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
162
Chapter 16 - Low Level Functions
IMGLOW_set_tiff_save_strips
This function saves data in strips, which is known as ‘stripped TIFFs’, when saving to TIFF file
formats with the following compression types:
l Uncompressed
l LZW
l Packbits
l Group 4
This breaks up the data into smaller segments instead of all lines of the image being saved in
the same offset.
Syntax
Remark
Variable Description
0 = Off
on_off
1 = On
Returns
Returns the status of stripped TIFFs. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_tiff_tag()
This function writes new tags as well as all current tags. This function can be called multiple
times for adding multiple tags.
Note:
If you read in a TIFF file, RasterMaster does not save any of the tags. None of the tag
data is saved except for the needed data such as bits per pix, height, and DPI. This is
saved in the LPBITMAPINFOHEADER struct in RasterMaster's internal format. Any
other tags are not preserved. You could read in the tags and data you need from a
source TIFF, then set new tags and data before saving.
Setting the tag ID to -1 clears out all extra tags from being written to the file. It stores
the previous values between calls. Then, set new tag values as shown in the following
example:
163
Chapter 16 - Low Level Functions
Simage.IMGLOW_set_tiff_tag(-1,0,0,null);
Syntax
Remark
Variable Description
tag ID of tag to write
max_bytes Total size of tag value or data in bytes
value Integer value for a tag size of 4 bytes
Data binary or ascii to write if tag size is greater than 4
buff
bytes
Returns
Returns the status of TIFF tags. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_transp_color()
This function sets the transparent color for GIF images.
Syntax
Remark
Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()
color Background color to set
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
164
Chapter 16 - Low Level Functions
IMGLOW_write_tiff_stream()
The function creates a TIFF file directly from raw or compressed data. This is best used when
receiving raw data (no header info) directly from a scanner or other input device.
Note:
A negative value indicates an error. See Appendix E, Snowbound Error Codes for a list
of error codes.
Syntax
Remark
Variable Description
LPBITMAPINFOHEADER Pointer to the bitmapinfoheader structure
data_stream Data to write out
data_size Size of data stream in bytes
file_type Tiff file type to write. See above constants
bm_name Output file name
Returns
Returns the status of the TIFF stream. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
165
Chapter 16 - Low Level Functions
gray scale */
#define SNBD_TIFF_COMP_G4_FO 4000 /* modified huffman group 4
with
fillorder of 1 */
166
Chapter 17 - DWG and DXF Functions
IMGLOW_set_cad_background()
IMGLOW_set_cad_input()
IMGLOW_set_cad_size()
IMGLOW_set_cad_background()
This function sets the background color for CAD rendering. The default color is black or [0,0,0].
Syntax
Remarks
Variable Description
r Sets the red background color.
g Sets the green background color.
b Sets the blue background color.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_cad_input()
This function sets the parameters for CAD rendering.
Syntax
Remarks
Variable Description
Sets the dots per inch. The default value is 300.0. Only
dpi
24-bit is supported.
167
Chapter 17 - DWG and DXF Functions
Variable Description
Sets the bits per pixel. Only 1-bit and 24-bit are supported.
bits_pix
The default value is 24.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_cad_size()
This function sets the pixel size of the output image for CAD rendering. It will overwrite the DPI
setting.
Syntax
Remarks
Variable Description
width Sets the width.
height Sets the height.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
168
Chapter 18 - HTML Functions
IMGLOW_set_html_capabilities()
IMGLOW_set_html_home_dir()
IMGLOW_set_html_image_capability()
IMGLOW_set_html_input()
IMGLOW_set_html_javascript_capability()
IMGLOW_set_html_page_size()
IMGLOW_set_html_page_size_ratio()
IMGLOW_set_html_page_size_ratio_capability()
IMGLOW_set_html_screen_dpi()
IMGLOW_set_html_use_page_breaks_exclusively()
IMGLOW_set_html_utf_bom()
IMGLOW_set_html_capabilities()
This function sets various parameters for the HTML renderer:
Note:
The new version of our HTML renderer engine has JavaScript and image downloading
enabled by default. Malicious JavaScript code and maliciously constructed embedded
images may compromise the security of the host computer. Please use these features
with caution.
Syntax
169
Chapter 18 - HTML Functions
double ratio);
Remarks
Variable Description
Set the value to 0 to disable. Set the value to 1 to enable.
isImageEnabled
The default value is 1.
Set the value to 0 to disable. Set the value to 1 to enable.
isJavascriptEnabled
The default value is 1.
Set the value to 0 to disable. Set the value to 1 to enable.
isRatioEnabled
The default value is 1.
Set the value to 0 to disable. Set the value to 1 to enable.
isPageBreaksExclusive
The default value is 1.
Sets the width/height ratio. The default value is 8.5/11.0.
(i.e. US LETTER portrait-mode).
ratio
Note: The ratio value is not set if the isRatioEnabled
value is disabled.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_html_home_dir()
This function sets the home directory for the HTML renderer.
Syntax
Remarks
Variable Description
This value does not support double-byte characters
dir
(i.e. ASCII only).
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
170
Chapter 18 - HTML Functions
IMGLOW_set_html_image_capability()
This function enables or disables image downloading and image loading capabilities for the
HTML renderer.
Note:
The new version of our HTML renderer engine has JavaScript and image downloading
enabled by default. Malicious JavaScript code and maliciously constructed embedded
images may compromise the security of the host computer. Please use these features
with caution.
Syntax
Remarks
Variable Description
Set the value to 0 to disable. Set the value to 1 to enable.
isEnabled
The default value is 1.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_html_input()
This function sets the parameters for HTML rendering.
Note:
If you call this function, the values of the width and height will immediately change.
Syntax
Remarks
Variable Description
print_dpi Used for rendering purposes. The default value is 200.0.
171
Chapter 18 - HTML Functions
Variable Description
Sets the bits per pixel. Only 1, 24, and 32 are supported.
bits_pix
The default value is 24.
Returns
Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_set_html_javascript_capability()
This function enables or disables JavaScript capabilities for the HTML renderer.
Notes:
The new version of our HTML renderer engine has JavaScript and image downloading
enabled by default. Malicious JavaScript code and maliciously constructed embedded
images may compromise the security of the host computer. Please use these features
with caution.
JavaScript is interpreted differently with each web browser. In particular, our new ren-
derer engine does not support all Microsoft Internet Explorer-only functions.
Syntax
Remarks
Variable Description
Set the value to 0 to disable. Set the value to 1 to enable.
isEnabled
The default value is 1.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_html_page_size()
This function sets the page size in pixels for screen size purposes. These values are just a sug-
gestion and will probably be over-written to more appropriate values during program execution.
Syntax
172
Chapter 18 - HTML Functions
Remarks
Variable Description
Sets the width. The default value is 0.
w Note: Setting the width to anything but zero will force the
user-defined screen DPI to be ignored.
h Sets the height. The default vaule is 0.
Returns
Returns the status of the Snowbound error code. A value of 1 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_set_html_page_size_ratio()
This function sets the ratio of the width to the height of the pages extracted from the HTML doc-
ument.
Syntax
Remarks
Variable Description
Sets the width/height ratio. The default value is 8.5/11.0.
(i.e. US LETTER portrait-mode).
ratio
Note: The value is ignored if the page size ratio capability
is disabled.
Returns
Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_set_html_page_size_ratio_capability()
This function enables or disables the use of the page size ratio capability of the HTML doc-
ument by forcing a page size ratio capability in the HTML document.
173
Chapter 18 - HTML Functions
Syntax
Remarks
Variable Description
Set the value to 0 to disable. Set the value to 1 to enable.
isEnabled
The default value is 1.
Returns
Returns the status of the Snowbound error code. A value of 0 or 1 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_set_html_screen_dpi()
This function sets the screen DPI used for layout purposes.
Syntax
Remarks
Variable Description
Set the screen DPI. The default value is 94.0.
screen_dpi Note: The value is ignored if the pixel width is set to any-
thing but zero (0).
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_html_use_page_breaks_exclusively()
This function enables or disables the ability to force the exclusive use of print page breaks to
signal page boundaries.
174
Chapter 18 - HTML Functions
Syntax
Remarks
Variable Description
Set the value to 0 to disable. Set the value to 1 to enable.
The default value is 1.
isEnabled
Note: This variable is only to be used in specific cases
where print page breaks tags are used.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_html_utf_bom()
This function forces this Unicode Byte-Order-Mark (BOM) to all HTML data read by Raster-
master.
The byte order mark (BOM) is a Unicode character used to signal the endianness (byte order) of
a text file or stream. Its code point is U+FEFF. BOM use is optional, and, if used, should appear
at the start of the text stream. Beyond its specific use as a byte-order indicator, the BOM char-
acter may also indicate which of the several Unicode representations the text is encoded in.
Since Unicode can be encoded as 16-bit or 32-bit integers, a computer receiving Unicode text
from arbitrary sources needs to know which byte order the integers are encoded in. The BOM
gives the producer of the text a way to describe the text stream's endianness to the consumer
of the text without requiring some contract or metadata outside of the text stream itself. Once
the receiving computer has consumed the text stream, it presumably processes the characters
in its own native byte order and no longer needs the BOM. Hence the need for a BOM arises in
the context of text interchange, rather than in normal text processing within a closed envir-
onment.
Syntax
Remarks
Variable Description
utf_bom May be set to one of the following values as defined in imglib.h:
175
Chapter 18 - HTML Functions
Variable Description
Please see Table 18-12 for byte order marks by encoding.
NOT_UNICODE 0
UTF_8 1
UTF_16BE 2
UTF_16LE 3
UTF_32BE 4
UTF_32LE 5
UTF_7 6
UTF_1 7
UTF_EBCDIC 8
SCSU 9
BOCU_1 10
B_18030 11
176
Chapter 18 - HTML Functions
1While identifying textas UTF-8, this is not really a "byte order" mark. Since the byte is also the
word in UTF-8, there is no byte order to resolve.
2In UTF-7, the fourth byte of the BOM, before encoding as base64, is 001111xx in binary, and
xx depends on the next character (the first character after the BOM). Hence, technically, the
fourth byte is not purely a part of the BOM, but also contains information about the next (non-
BOM) character. For xx=00, 01, 10, 11, this byte is, respectively, 38, 39, 2B, or 2F when
encoded as base64. If no following character is encoded, 38 is used for the fourth byte and the
following byte is 2D.
3SCSU allows other encodings of U+FEFF, the shown form is the signature recommended in
UTR #6.
4 For BOCU-1 a signature changes the state of the decoder. Octet 0xFF resets the decoder to
the initial state.
Returns
Returns the status of the Snowbound error code or the current BOM the system will use. See
Appendix E, Snowbound Error Codes for a list of error codes.
177
Chapter 19 - Open Office 2007 XML (OOXML) Functions
RasterMaster DLL Microsoft Office plugin supports the seamless conversion of Word 2007 and
Excel 2007 documents which use the OOXML format. These documents are frequently stored
with the file extension .docx/.xlsx.
This chapter contains the following functions that ensure the location of the location of the
Aspose products library is registered with RasterMaster:
IMGLOW_set_ooxml_license()
IMGLOW_set_ooxml_enable()
IMGLOW_set_ooxml_licenseW()
IMGLOW_set_ooxml_license()
This function loads the OOXML license file.
Syntax
Remark
Variable Description
File name of the license file. For example:
licenseFile
“c:\\temp\\license.txt”
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_ooxml_license_enable()
This function simplifies Aspose licensing by setting the license path.
178
Chapter 19 - Open Office 2007 XML (OOXML) Functions
Syntax
Remark
Variable Description
Buffer to receive path name of folder containing Aspose License file or
licensePath[out] NULL if no licenses found. This buffer must be allocated by calling applic-
ation.
nPathLength[in] Length in bytes of licensePath buffer.
Returns
Returns the status of the Snowbound error code. If no license file is found, returns -52,
OOXML_LICENSE_NOT_FOUND. If a license is found but is invalid, returns -53, OOXML_
LICENSE_EXPIRED. Any value less than zero is a Snowbound error code. See Appendix E,
Snowbound Error Codes for a list of error codes.
IMGLOW_set_ooxml_licenseW()
This function loads the OOXML license file.
Syntax
Remark
Variable Description
File name of the license file. For example:
licenseFile
”c:\\temp\\license.txt”
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
179
Chapter 19 - Open Office 2007 XML (OOXML) Functions
IMGLOW_get_ooxml_license_location()
This function gets the location of the OOXML license file.
Syntax
Notes:
This function supports wide characters. If you are using wide characters, then Windows
Unicode UTF-16LE is supported.
If the locationRequiredLength variable is longer than the locationLength variable, then
the value of the locationLength variable is used.
Remark
Variable Description
location Sets the location of where to write the location's characters.
locationLength The length of elements allocated in the location passed-parameter.
loc-
The number of characters the location data actually requires.(0 indicates
ationRe-
that there is no license location.)
quiredLength
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_ooxml_license_filename()
This function sets the filename of the OOXML license file.
Syntax
180
Chapter 19 - Open Office 2007 XML (OOXML) Functions
Remark
Variable Description
licenseFilename File name of the license file.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_ooxml_license_filenameW()
This function sets the filename of the OOXML license file.
Syntax
Note:
This function supports wide characters. If you are using wide characters, then Windows
Unicode UTF-16LE is supported.
Remark
Variable Description
licenseFilename File name of the license file.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_ooxml_license_path()
This function sets the absolute path of the OOXML license file path.
Syntax
Remark
181
Chapter 19 - Open Office 2007 XML (OOXML) Functions
Variable Description
licensePath Path to the license file.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_ooxml_license_pathW()
This function sets the absolute path of the OOXML license file path.
Syntax
Note:
This function supports wide characters. If you are using wide characters, then Windows
Unicode UTF-16LE is supported.
Remark
Variable Description
licensePath Path to the license file.
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
182
Chapter 20 - DocClean Functions
IMG_auto_orient()
IMG_deskew_bitmap()
IMG_despeckle_bitmap()
IMGLOW_auto_invert()
IMGLOW_detect_blank_page()
IMGLOW_remove_halftone()
IMGLOW_remove_holepunch()
IMG_auto_orient()
This function returns the orientation of the image. The value is 90 or 0. If the value is 90, you
may want to fix the image by using IMG_rotate_bitmap. See IMG_rotate_bitmap() for
more information.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
Angle returned as the current orientation. Number of pixels to add to
p_angle
the autocrop rectangle. Either 90 or 0 is returned.
Returns
Returns the status of the auto orient detection operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
183
Chapter 20 - DocClean Functions
IMG_deskew_bitmap()
This function uses the angle returned from IMG_get_deskew_angle to do the rotation. This
allows angle detection to be separate from the actual rotation in case the angle is 0 and no rota-
tion is needed. See IMGLOW_auto_invert() for more information.
Note:
When a call is made to IMG_deskew_bitmap, the internal Snowbound image object
is stored in memory for viewing. The function needs to be saved to the library for the
change to be permanent.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
*p_angle Angle value returned.
int deskew_angle_start Starting angle to test for. This may be negative.
Last angle to test for. This may be negative.
int IMG_deskew_bitmap(
int rot_angle
);
Returns
Returns the status of the Snowbound error code. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_despeckle_bitmap()
This function removes small specks or noise on the image.
184
Chapter 20 - DocClean Functions
Note:
When a call is made to IMG_despeckle_bitmap, the internal Snowbound image
object is stored in memory for viewing. The function needs to be saved to the library for
the change to be permanent.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
Sets the coarseness of the amount of data to be filtered or removed.
Returns
Returns the status of the despeckle operation. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_auto_invert()
This function inverts the colors of the image if the passed background color is found to not be
the dominant and presumably the background color of the image.
Syntax
Remark
185
Chapter 20 - DocClean Functions
Variable Description
hdib Standard RasterMaster image handle.
24-bpp: Red component of the detection color or the full background
color for 1, 4 and 8-bit per pixel images. May have the value of [0-
red
255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May
have the value of [0-1], [0-127], and [0-255], respectively.
Green component of the detection color. Ignored for non-24-bpp
green
images. May have the value of [0-255].
Blue component of the detection color. Ignored for non-24-bpp
blue
images.May have the value of [0-255].
colourTolerance Per color-channel pixel-value match tolerance linear distance value.
Mismatch tolerance percentage. If negative, it will default to 75. An
example of a valid value is 50.26. If the percentage of background
mismatchTolerance
pixels on the page is less than the mismatch tolerance, the image
will not be inverted.
Returns
Returns 1 if the image is inverted and 0 if the image is not inverted. Any value less than zero is
a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_detect_blank_page()
This function can be used to detect blank pages. It can also be used to detect pages that are
essentially blank though there are some scan artifacts or other “dirt” on them.
This function returns the percentage of pixels present that are not equal to the passed detection
or background color. If autodetect is set to 1, then the detection or background color will be
determined automatically and will correspond to the dominant color in the image. The tolerance
value can be set to allow for a more lenient color matching the algorithm.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
Auto-detect the background color (0: no; 1: yes). 1 will force the sys-
autodetect
tem to ignore the passed color.
24-bpp: Red component of the detection color. May have the value
red of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color.
May have the value of [0-1], [0-127], and [0-255], respectively.
186
Chapter 20 - DocClean Functions
Variable Description
Green component of the detection color. Ignored for non-24-bpp
green
images. May have the value of [0-255].
Blue component of the detection color. Ignored for non-24-bpp
blue
images.May have the value of [0-255].
Per color-channel pixel-value match tolerance linear distance value.
tolerance Use this value in comparing background pixels. This number is in the
range [0-255].
Execute the low-quality version of the autodetect algorithm (0: no; 1:
yes). The low-quality version will not guarantee the global maximum,
isLowQuality
but it will execute much faster. The tolerance level is not taken into
consideration.
Execute the low-memory version of the autodetect algorithm (0: no;
1: yes). The low-memory version will not guarantee the global max-
isLowMemory
imum. The tolerance level is not taken into consideration. This set-
ting is only for 24-bpp images.
Returns
Double. The percentage of pixels on the page that are not equal to the background color. If the
percentage is zero or near zero the page is blank. Note the percentage is a floating point num-
ber. For example, a return value of 50.26 means 50.26% of the page is non-blank. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_remove_halftone()
This function removes small blobs from images.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
minSize Minimum diameter of a blob. (This value should be at least 1.)
maxSize Maximum diameter of a blob. (This value should be kept very small.)
Returns
Returns the status of the halftone removal operation. A value greater or equal to 0 indicates suc-
cess and represents the number of blobs removed. Any value less than zero is an error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
187
Chapter 20 - DocClean Functions
IMGLOW_remove_holepunch()
This function removes hole punches from specified areas on the page or automatically finds the
hole punches. Specifying a fixed area to repair is faster than having the method find and fill the
holes. This may be done manually by specifying the exact span of any hole punches along with
the fill color. Alternatively, this may be done automatically where both the holes and the fill color
are determined algorithmically.
This function removes hole punches by filling in the hole area with a background color. The
background color is passed in as red, green and blue or you can have the function automatically
detect the background color.
Note:
This will not work with alpha-channel enabled images.
Syntax
Remark
Variable Description
hdib Standard RasterMaster image handle.
Auto-detect the fill color (0: no; 1: yes). 1 will force the system to
autoDetectFillColour
ignore the passed fill color.
24-bpp: Red component of the detection color or the full background
color for 1, 4 and 8-bit per pixel images. May have the value of [0-
red
255]. 1-bpp/4-bpp/8-bpp: Index value of the detection color. May
have the value of [0-1], [0-127], and [0-255], respectively.
Green component of the detection color for 24-bit images. Ignored for
green
non-24-bpp images. May have the value of [0-255].
Blue component of the detection color for 24-bit images. Ignored for
blue
non-24-bpp images.May have the value of [0-255].
Auto-detect the hole punches (0: no; 1: yes). 1 will force the system
autoFindHoles
to ignore the passed holes.
Array of hole punch spans to fill. If there are regions-of-interest
(ROI), then all holes which do not completely lie within an ROI are
holes
ignored. Similarly, holes which span several ROIs but not a single
ROI will be ignored. May be NULL when autoFindHoles is 1.
Number of elements in the holes array. May be 0 when
holeNum
autoFindHoles is 1.
188
Chapter 20 - DocClean Functions
Variable Description
Array of regions-of-interest (ROI). ROIs are areas where holes may
span. If ROIs is NULL and the holes are not automatically found,
ROIs then the entire image will be taken as the ROI. If ROIs is NULL and
the holes are automatically found, then sensible ROIs will be determ-
ined algorithmically.
Number of elements in the ROIs array. May be 0 when ROIs is
ROIsNum
NULL.
Minimum diameter in pixels of any holes. This is only used when
minHoleDiameter
holes are automatically found.
Maximum diameter in pixels of any holes. This is only used when
maxHoleDiameter
holes are automatically found.
Returns
Returns the number of holes found. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
189
Chapter 21 - Image Processing Functions
IMG_apply_profile()
IMG_cmyk_to_rgb()
IMG_create_thumbnail()
IMG_deskew_bitmap()
IMG_despeckle_bitmap()
IMG_display_fit_to_height()
IMG_display_fit_to_width()
IMG_flip_bitmapx()
IMG_flip_bitmapy()
IMG_get_deskew_angle()
IMG_get_profile()
IMG_histogram_equalize()
IMG_invert_bitmap()
IMG_process_bitmap()
IMG_resize_bitmap()
IMG_resize_bitmap_bicubic()
IMG_resize_bitmap_interp()
IMG_resize_to_gray()
IMG_rgb_to_cmyk()
IMG_rotate_bitmap()
IMG_set_gamma()
IMG_set_lut()
IMG_sharpen_bitmap()
IMG_window_level()
IMGLOW_get_auto_detect()
IMGLOW_get_fileinfo_fd()
190
Chapter 21 - Image Processing Functions
IMGLOW_get_palette()
IMGLOW_put_palette()
IMGLOW_read_pixel()
IMGLOW_set_auto_detect()
IMGLOW_set_decompsize()
IMGLOW_set_decomp_rect()
IMGLOW_set_decomp_reduction()
IMGLOW_set_dithermode()
IMGLOW_set_fast_convert()
IMGLOW_set_imnet_page_size()
IMGLOW_set_pcl_input()
IMGLOW_unset_auto_detect()
IMG_apply_profile()
This function takes the input_profile from the creating device, such as a scanner, and
output_profile for a printer or display and applies them to the image. If an input file is not
available, the parameter can be set to to NULL or zero.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap().
Pointer to a buffer containing the input pro-
*input_profile
file.
Pointer to a buffer containing the output pro-
*output_profile
file.
mode For mode choices, see below.
191
Chapter 21 - Image Processing Functions
Mode Description
0 Apply permanently to the image data.
1 Apply only at display time.*
2 Apply only at print time.*
3 Apply at display and print time.*
Returns
Returns the status of the apply profile operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_cmyk_to_rgb()
This function converts the 32-bit CMYK data to 24-bit RGB data.The RasterMaster products
supports full 32-bit CMYK data as an internal 32-bit DIB format.
Syntax
Remark
Variable Description
hdib RasterMaster image handle to convert
Returns
Returns the status of the convert CMYK to RGB operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
void CSnowBndView::OnConvertCmyktorgb()
{
SnowBndFuncCall(::IMG_cmyk_to_rgb);
}
IMG_create_thumbnail()
This function creates a thumbnail with the correct pixel depth and automatically selects the cor-
rect resize function for the image. See IMG_resize_bitmap() and IMG_resize_bitmap_bicubic()
for more information.
192
Chapter 21 - Image Processing Functions
1-bit images are converted to grayscale with our “scale to gray” algorithm. 8 and 24-bit images
are resized with our bicubic interpolation algorithm.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
xsize New width of image in pixels
ysize New height of image in pixels
Returns
Returns the status of the create thumbnail operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_deskew_bitmap()
This function uses the angle returned from IMG_get_deskew_angle to do the rotation. This
allows angle detection to be separate from the actual rotation in case the angle is 0 and no rota-
tion is needed. See IMG_get_deskew_angle() for more information.
Note:
When a call is made to IMG_deskew_bitmap, the internal Snowbound image object is
stored in memory for viewing. The function needs to be saved to the library for the
change to be permanent.
Syntax
Remark
193
Chapter 21 - Image Processing Functions
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
angle Angle in degrees by which to rotate image
Returns
Returns the status of the deskew bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
Example 21.2:IMG_deskew_bitmap
IMG_despeckle_bitmap()
This function is a noise removal algorithm.
Note:
When a call is made to IMG_despeckle_bitmap, the internal Snowbound image
object is stored in memory for viewing. The function needs to be saved to the library for
the change to be permanent.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Quality factor 1 - 100
value 1 = Remove only single pixels
100 = Removes large black areas
Returns
Returns the status of the despeckle bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
194
Chapter 21 - Image Processing Functions
IMG_display_fit_to_height()
This function displays the full height of the image vertically scaling it to fit. It crops the image
horizontally for aspect ratio correction and enables the scroll bars.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Fit sample.
Syntax
Remark
Variable Description
hdib RasterMaster image handle to display
hdc hdc port or device context to display
hwnd Windows handle to display
xs X starting position to display
ys Y starting position to display
xsize X size of rectangle to display
ysize Y size of rectangle to display
Returns
Returns the status of the display fit to height operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
case Height:
::IMG_display_fit_to_height(nHandle,h-
dc,hwnd,nLeft,nTop,nWidth,nHeight);
195
Chapter 21 - Image Processing Functions
IMG_display_fit_to_width()
This function displays the full width of the image horizontally scaling it to fit. It crops the image
vertically for aspect ratio correction and enables the scroll bars.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Fit sample.
Syntax
Remark
Variable Description
hdib RasterMaster image handle to display
hdc Port or device context to display
hwnd Windows handle to display
xs X starting position to display
ys Y starting position to display
xsize X size of rectangle to display
ysize Y size of rectangle to display
Returns
Returns the status of the display fit to width operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
case Width:
::IMG_display_fit_to_width(nHandle,h-
dc,hwnd,nLeft,nTop,nWidth,nHeight);
IMG_flip_bitmapx()
This function swaps horizontal pixels to produce a mirror image of the original image. It per-
manently changes the image in memory.
196
Chapter 21 - Image Processing Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the status of the flip bitmapx operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_flip_bitmapy()
This function swaps vertical pixels to produce a mirror image of the original image. It per-
manently changes the image in memory.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
197
Chapter 21 - Image Processing Functions
Returns
Returns the status of the flip bitmapy operation. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_get_deskew_angle()
This function detects the skew angle for 1-bit images by checking all angles starting at the start
angle and continuing in one degree increments until the stop angle is reached. The example
below uses -20 and 20 for starting and stopping angles. Your application may want to check for
only positive or negative angles.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
angle Pointer to integer to receive deskew angle
start_angle Starting angle for which to check
stop_angle Ending angle for which to check
Returns
Returns the status of the get deskew angle operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
198
Chapter 21 - Image Processing Functions
IMG_get_profile()
This function gets an input profile from an image file. ICC profiles may be embedded in the
image. In order to make an exact match, color profiles are created so that the identical color val-
ues can be printed or displayed.
Supported file formats include: TIFF, JPEG, PICT, PDF, GIF and PNG. These formats can con-
tain an embedded color profile.
Syntax
Remark
Variable Description
File name for the image to be read in from the
*bm_name
profile.
page Page number to be read in from the profile.
A pointer to return the length of the profile in
*length
the buffer.
Returns
Returns the character buffer. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
IMG_histogram_equalize()
This function is a histogram equalization which improves the dynamic range of 8 or 16-bit gray
scale images by remapping pixels based on a probability algorithm.
Syntax
Remark
199
Chapter 21 - Image Processing Functions
Variable Description
hdib Snowbound image handle
Returns
Returns the status of the histogram equalize operation. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_invert_bitmap()
This function changes each bit in the image from 0 to 1 or from 1 to 0. This works well for invert-
ing documents which have a black background. This permanently changes the image in
memory.
Syntax
Remark
Variable Description
Standard image handle obtained from a
Imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the status of the invert bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_process_bitmap()
This function is a Sobel image processing function. A simple 3 x 3 matrix is applied to the image
for 8 and 24-bit images. If the value for matrix pointer is not NULL, it assumes that it contains
values to be applied to the image.
Syntax
Remark
Variable Description
imghandle Standard image handle obtained from a
200
Chapter 21 - Image Processing Functions
Variable Description
decompress function such as IMG_decom-
press_bitmap()
type Specify the type of filter to be performed
0 = User defined 3 * 3 matrix
1 = Isolate points
2 = Edge detection
3 = Horizontal edge detection
4 = Vertical edge detection
matrix
5 = 45 degree edge detection
6 = -45 degree edge detection
7 = Laplacian
8 = Dialation
9 = Roberts Cross
Returns
Returns the status of the process bitmap operation. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_resize_bitmap()
This function scales the image up or down to the new height and width. This permanently
changes the height and width of the image.
Note:
IBM AFP printers require the width of an image to be an exact multiple of 8. To be on the
safe side, set the width to a multiple of 8.
Set the width and height to the original width and height of the image after decompress as
shown in the following example:
201
Chapter 21 - Image Processing Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
width New width of image
height New height of image
Returns
Returns the resize bitmap operation. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
if(CResizeDlg::Normal==rd.Resize)
nRes = ::IMG_resize_bitmap(nHandle, rd.m_nHorz,rd.m_nVert);
IMG_resize_bitmap_bicubic()
This function uses a bicubic interpolation algorithm to scale down images. This is good for cre-
ating high-resolution thumbnails of color images. Because this operation is floating point intens-
ive, it is not as fast as IMG_resize_bitmap(), which uses a linear interpolation.
Syntax
Remark
Variable Description
imghandle Standard image handle obtained from a
202
Chapter 21 - Image Processing Functions
Variable Description
decompress function such as IMG_decom-
press_bitmap()
xsize Width of image in pixels
ysize Height of image in pixels
Returns
Returns the resize bitmap bicubic interpolation algorithm operation. Any value less than zero is
a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_resize_bitmap_interp()
This function scales the image up or down to the new height and width in pixels. It resizes with
interpolation to provide a higher quality result simple resizing when scaling a 24-bit color or a
grayscale image up or down. The interp averages neighboring pixels for scaling down all image
types. This permanently changes the height and width of the image.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
width New width of image
height New height of image
Returns
203
Chapter 21 - Image Processing Functions
IMG_resize_to_gray()
This function resizes up 1-bit black and white images to 8-bit grayscale images using the scale
to gray anti-aliasing algorithm. This converts a 1-bit image to an 8-bit that may be saved in a
JPEG file format. This function is excellent for creating small, good looking thumbnails of large
documents or 1-bit black and white images.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
hres Destination width of image to resize
vres Destination height of image to resize
Returns
Returns the status of the resize to gray operation. A value of 0 indicates success. Returns a
PIXEL_DEPTH_UNSUPPORTED error message if the image has a bit depth of more than one if
the image is not black and white. May return an OUT_OF_MEMORY error message. Returns an
OUT_OF_MEMORY error if there is not enough memory to complete the operation. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMG_rgb_to_cmyk()
This function converts 24-bit RGB data to 32-bit CMYK data. RasterMaster products support
full 32-bit CMYK data as an internal 32-bit DIB format. The black plane is created.
Syntax
Remark
Variable Description
hdib RasterMaster image handle to convert
204
Chapter 21 - Image Processing Functions
Returns
Returns the status of the convert RGB to CMYK operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
void CSnowBndView::OnConvertRgbtocmyk()
{
SnowBndFuncCall(IMG_rgb_to_cmyk);
}
IMG_rotate_bitmap()
This function permanently rotates the image buffer in memory by the specified angle. The value
is in hundredths of degrees. For example, for 90 degrees use 9000.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Aspect
l Zoom
Note:
It is expected behavior that the image is smaller in each rotation using IMG_rotate_
bitmap. If an image is rotated by 90 degrees, RasterMaster flips from portrait to land-
scape (or vice-versa) and preserves the page content. If the image is rotated by some-
thing other than 90 degrees, RasterMaster shrinks the page so that all the content is
preserved. RasterMaster does not crop the edges during the rotation.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
angle Rotation in hundredths of degrees
205
Chapter 21 - Image Processing Functions
Returns
Returns the rotate bitmap operation. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
{
BeginWaitCursor();
GetFrame()->StartStatusBar();
nRes = ::IMG_rotate_bitmap(nImageHandle, nAngle);
GetFrame()->EndStatusBar();
if(nRes>=0)
{
UpdateImageWindow(nImageHandle);
GetDocument()->SetModifiedFlag();
}
EndWaitCursor();
}
return nRes;
IMG_set_gamma()
This function corrects for the gamma or response curve of the monitor. The default is 100. This
drastically improves the quality of gray scale or 24-bit images.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
gamma Integer ranging from 0 to 200
Returns
Returns the status of the set gamma operation. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
206
Chapter 21 - Image Processing Functions
IMG_set_lut()
This function changes the contrast or brightness of the image. A LUT (look up table) is used to
map the brightness values of the image between the upper and lower bound of the contrast
enhancement. This function changes the contrast or brightness of the image. Positive values
add contrast or brightness to the image while negative values darken or decrease the contrast
of the image.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
contrast Integer value from -127 to 127
brightness Integer value from -127 to 127
Returns
Returns the status of the set look up table operation. A value of 0 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMG_sharpen_bitmap()
This function sharpens or blurs the image. Positive values sharpen the image using a Laplacian
function while negative values blur the image using an image-averaging filter.
Syntax
Remark
207
Chapter 21 - Image Processing Functions
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
sharpness Integer value from -127 to 127
Returns
Returns the sharpen bitmap operation. A value of 0 indicates success. Returns a FORMAT_
NOT_ALLOWED error message for 1-bit (black and white) images and for 4-bit or 8-bit color
images. Returns an OUT_OF_MEMORY error if there is not enough memory to complete the oper-
ation. Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error
Codes for a list of error codes.
IMG_sharpen_bitmap(nHandle,_ttoi((LPCTSTR)ad.m_strSharpness));
IMG_window_level()
This function turns window-leveling on or off for 16 or 8-bit gray scale images. Window-leveling
remaps pixel values to increase or decrease dynamic range of gray values.
Many medical images have been created to use only a portion of the total range of gray values
possible. They appear very dark or washed out and need contrast enhancement or window lev-
eling. This is typical. The window-leveling function improves the contrast to allow more details
to be present in the image at display time. A normal 16 bit image that does not need window lev-
eling should be display correctly.
If the min and max values are set to 0 the function automatically calculates the best values for
min and max. The image data is never changed since the pixel remapping is done at display
time.
Syntax
int SNBDAPI IMG_window_level(int hdib, int min, int max, int on_
off);
Remark
Variable Description
hdib Snowbound image handle
min Starting pixel gray value
max Ending pixel gray value
Turn Windows leveling on or off
on_off
0 = Off
208
Chapter 21 - Image Processing Functions
Variable Description
1 = On
Returns
Returns the status of the set window level operation. A value of 0 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_get_auto_detect()
This function returns the current auto-detect status for the specified file type.
Syntax
Remark
Variable Description
Image format type from the defined list in
type
imglib.h.
Returns
Returns the status of the get auto-detect status operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMGLOW_get_fileinfo_fd()
This function reads and returns the file header information from the image file I/O handle passed
in. This handle is from an open() call and not the standard Snowbound image handle. It fills in
the DIB_HEADER structure with width, height, DPI and bits per pixel.
Syntax
Remark
Variable Description
fh File I/O handle
Pointer to a DIB_HEADER structure in which
lpbi
to fill
209
Chapter 21 - Image Processing Functions
Returns
Returns the status of the read and return file header information operation. A value of 0 indic-
ates success. Any value less than zero is a Snowbound error code. See Appendix E, Snow-
bound Error Codes for a list of error codes.
IMGLOW_get_palette()
This function returns the palette entries of the specified image into an array of RGBQUAD struc-
tures.
24-bit images have no palettes but the autocolor or rainbow palette is returned.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
prgb Pointer to array of RGBQUAD structures
Returns
Returns the status of the get palette operation. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_put_palette()
This function sets the palette entries of the specified image from an array of RGBQUAD struc-
tures.
210
Chapter 21 - Image Processing Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
prgb Pointer to array of RGBQUAD structures
Returns
Returns the status of the put palette operation. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_read_pixel()
This function reads and returns a pixel value from the image referenced by the image handle
hdib. The xpos and ypos specify the location in the image from which to read. You must first
call IMG_runs_to_dib() (and only once to read in 1-bit pixels). See IMG_runs_to_dib() for
more information.
Syntax
Remark
Variable Description
hdib Snowbound image handle
xpos X coordinate of pixel to read
ypos Y coordinate of pixel to read
Returns
Returns the status of the read pixel operation. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
211
Chapter 21 - Image Processing Functions
IMGLOW_set_auto_detect()
This function turns the automatic file type detection on for verifying the desired format.
Syntax
Remark
Variable Description
Image format type from the defined list in
type
imglib.h
Returns
Returns the status of the set auto-detect operation. A value of 0 or 1 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMGLOW_set_decompsize()
This function forces all images to be scaled as they are decompressed. This is useful for cre-
ating icons. If the width and height are set to 100, the image in memory is scaled to 100 by 100
using much less memory.
Syntax
Remark
Variable Description
width Width to decompress image
height Height to decompress image
Returns
Returns the status of the set decompressed size operation. A value of 0 indicates success.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
212
Chapter 21 - Image Processing Functions
IMGLOW_set_decomp_rect()
This function decompresses and holds in memory only the data contained in the specified crop-
ping rectangle. Set this before any decompression calls are made.
This stays in effect until it is reset to 0 for each parameter. 0 is the default.
Syntax
Remark
Variable Description
xstart Start of x cropping rectangle
ystart Start of y cropping rectangle
xsize Width of cropping rectangle
ysize Height of cropping rectangle
Returns
Returns the status of the set decompressed rectangle operation. A value of 0 indicates suc-
cess. Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error
Codes for a list of error codes.
IMGLOW_set_decomp_reduction()
This function forces color reduction at decompression. If set to 8, for instance, all 24-bit images
are reduced and stored in memory as 8-bit images.
Syntax
Remark
Variable Description
bits_per_pix May be set to 1, 4 or 8-bits
Returns
Returns the status of the set decompressed reduction operation. A value of 0 indicates suc-
cess. Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error
213
Chapter 21 - Image Processing Functions
IMGLOW_set_dithermode()
This function dithers 24-bit images to a 256-color display. Also 8 and 24-bit images are dithered
on 16-color display adapters.
If the display is set to DITHER_NONE, you are at the mercy of the display driver. For instance,
24-bit images on a 256 color display adapter can take 2 or more minutes to display with dither
mode off.
Syntax
Remark
Variable Description
Use the above values to decide how or how
dither_mode
not to dither. The default is -1.
Returns
Returns the status of the set dither mode reduction operation. A value of 0 indicates success.
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
IMGLOW_set_fast_convert()
This function greatly improves performance for decompression and conversion. Pages must be
decompressed sequentially. This function can be used with any of the decompression func-
tions, either from File I/O based or memory. To turn this function on, set the off_on value to 1.
To reset this function, set the off_on value to 0.
214
Chapter 21 - Image Processing Functions
This function makes the decompression functions non-reentrant or no longer thread safe when
turned on.
Note:
This function currently only works with MO:DCA or AFP images.
Syntax
Remark
Variable Description
0 = Off
off_on
1 = On
format Sets the format.
Returns
Returns the status of the set fast conversion operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMGLOW_set_imnet_page_size()
This function sets the size of an IMNET image in points or 1/72 of an inch. It also sets the dots
per inch (DPI).
Note:
The default value is 200 for the DPI and 0 for the width and height.
Syntax
Remark
Variable Description
xsize Sets the document’s width
ysize Sets the document’s height
dpi Sets the document in dots per inch (DPI)
215
Chapter 21 - Image Processing Functions
Returns
Returns the status of the set IMNET page size operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
IMGLOW_set_pcl_input()
This function sets the rendering for PCL decompression. PCL files are rendered as a bitmap at
decompression time. These values allow you to set the dots per inch and the pixel depth of the
resulting bitmap.
Syntax
Remark
Variable Description
dpi Resolution in dots per inch.
Bits per pixel to render image. May be 1 or 24
bits_pix
only.
Returns
Returns the status of the set PCL input operation. A value of 0 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
IMGLOW_unset_auto_detect()
This function turns the automatic file type detection off for the desired format. This file type is
then no longer decompressed by the library.
Syntax
Remark
Variable Description
Image format type from the defined list in
type
imglib.h
216
Chapter 21 - Image Processing Functions
Returns
Returns the status of the unset auto-detection operation. A value of 0 indicates success. Any
value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a
list of error codes.
217
Chapter 22 - Bit Depth Conversion Functions
IMG_bayer_color()
IMG_bayer_mono()
IMG_color_gray()
IMG_dib_to_runs()
IMG_diffusion_color()
IMG_diffusion_mono()
IMG_halftone_mono()
IMG_mediancut_color()
IMG_octree_color()
IMG_popularity_color()
IMG_runs_to_dib()
IMG_thresh_mono()
IMGLOW_get_filetype_mem()
IMGLOW_get_raster()
IMGLOW_put_raster()
IMGLOW_set_alias_quality()
IMG_bayer_color()
This function permanently converts 8 or 24-bit images to 4-bit per pixel using a 16 by 16 Bayer
matrix dither.
Syntax
Remark
218
Chapter 22 - Bit Depth Conversion Functions
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertBayercolor()
{
SnowBndFuncCall(::IMG_bayer_color);
}
IMG_bayer_mono()
This function permanently converts 4, 8, or 24-bit images to 1-bit per pixel using a Bayer fixed
matrix dithering technique.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertBayermono()
{
SnowBndFuncCall(::IMG_bayer_mono);
}
219
Chapter 22 - Bit Depth Conversion Functions
IMG_color_gray()
This function permanently converts 4, 8, or 24-bit images to an 8-bit gray scale image.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertGrayscale()
{
SnowBndFuncCall(::IMG_color_gray);
}
IMG_dib_to_runs()
This function converts the internal library image format from the Windows DIB format to a Snow-
bound runs format. This only works for 1-bit bi-level images.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
220
Chapter 22 - Bit Depth Conversion Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_diffusion_color()
This function permanently converts 8 or 24-bit images to 4-bit per pixel using the Stucky error
diffusion technique.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertDiffusioncolor()
{
SnowBndFuncCall(::IMG_diffusion_color);
}
IMG_diffusion_mono()
This function permanently converts 4, 8, or 24-bit images to 1-bit per pixel using the Stucky
error diffusion technique.
Note:
IMG_decompress_bitmap must be called before IMG_diffusion_mono. It is
designed for use on rasterized pages. It cannot be used on pages with vector content
created by IMGLOW_extract_text.
221
Chapter 22 - Bit Depth Conversion Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertDiffusionmono()
{
SnowBndFuncCall(::IMG_diffusion_mono);
}
IMG_halftone_mono()
This function permanently converts 4, 8, or 24-bit images to 1-bit per pixel using a fixed halftone
matrix dithering technique.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
222
Chapter 22 - Bit Depth Conversion Functions
nRes = ::IMG_halftone_mono(nHandle);
IMG_mediancut_color()
This function permanently converts 24-bit images to 8-bit per pixel using a combination of the
popularity algorithm and error diffusion.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvertMediancut()
{
SnowBndFuncCall(::IMG_mediancut_color);
}
IMG_octree_color()
This function converts 4, 8, or 24-bit images into 4 or 8-bit as specified. It uses a complex
octree function to reduce to the best palette and number of colors chosen, or reduces the image
to the palette passed into input_prgb if the pointer is not NULL. This is by far the best color
reduction algorithm in the library.
Syntax
223
Chapter 22 - Bit Depth Conversion Functions
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
bits_per_pixel Pixel depth to convert to: 4 or 8
input_prgb Pointer to array of RGBQUAD structures
Number of colors to reduce
entries 1 - 16 for 4-bit images
1 - 256 for 8-bit images
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
GetFrame()->StartStatusBar();
nRes ::IMG_octree_color(nHandle, nBits, pRGB, nolorsToReduce);
GetFrame()->EndStatusBar();
IMG_popularity_color()
This function permanently converts 24-bit images to 8-bit per pixel using the popularity
algorithm. Popularity chooses 256 of the most populous colors from the image.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
224
Chapter 22 - Bit Depth Conversion Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
void CSnowBndView::OnConvert256colors()
{
SnowBndFuncCall(::IMG_popularity_color);
}
IMG_runs_to_dib()
The RasterMaster library stores all 1-bit images as a series of runs. A call to this function forces
the image to be stored as raw uncompressed data. This only works for 1-bit images.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
if (nBits == 1)
{
::IMG_runs_to_dib(nHandle);
pDib = ::IMG_bitmap_info(nHandle, &nXSize, &nYSize, &nBits);
}
225
Chapter 22 - Bit Depth Conversion Functions
IMG_thresh_mono()
This function permanently converts 4, 8, or 24-bit images to 1-bit per pixel using a threshold
passed as the second argument.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
Threshold value to use. The range is from 1 -
thresh
255
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_get_filetype_mem()
This function gets the file type number of the image stored in memory at the location pointed to
by the file name pointer.
Syntax
Remark
Variable Description
filename Pointer to image in memory
Returns
Returns the standard library image handle. For example, a Word file would return the file type
number 86. For a list of file type numbers, please see Appendix A, Supported File Formats .
Any value less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes
for a list of error codes.
226
Chapter 22 - Bit Depth Conversion Functions
IMGLOW_get_raster()
This function gets a line of raw data from the line number specified by ypos.
Note:
Returns no more than the number of bytes specified. If set to -1, the number of bytes in
one line are calculated and returned.
Syntax
Remark
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap().
destination_ptr Buffer to receive a line of raw raster data.
ypos Line number of raster to get.
Returns no more than this number of bytes.
bytes If set to -1, it calculates the number of bytes
in one line and returns that amount.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_put_raster()
This function puts a line of raw data into the DIB specified by imghandle at the ypos line num-
ber.
Syntax
Remark
227
Chapter 22 - Bit Depth Conversion Functions
Variable Description
Standard image handle obtained from a
imghandle decompress function such as IMG_decom-
press_bitmap()
destination_ptr Buffer of raw data to put into DIB
ypos Line number in which to put data
bytes Replaces no more than this number of bytes
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_alias_quality()
This function sets the effectiveness of scale to gray and preserve black algorithms. This func-
tion works when using IMGLOW_set_alias(). A value of 100 ensures that no black pixels will be
discarded when displaying the image. See IMGLOW_set_alias() for more information.
Syntax
Remark
Variable Description
Alias Quality; 0 to 100
quality 0 = Discard black pixels
100 = Do not discard any black pixels
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
228
Chapter 23 - Document Conversion and Text Extraction
IMGLOW_extract_text()
IMGLOW_extract_text_mem()
IMG_save_document()
IMG_save_document_mem()
Currently, only AFP/MO:DCA, MS Word, Excel and PCL formats are supported.
Conversion and text extraction occur in the following two step process:
1. A call is made to extract the text, graphics, and bitmap data. The IMGLOW_extract_
text() function extracts text, graphics, and position information from the file name
passed in. The buffer returned is used as an argument in the call to write out the new
PDF file. See IMGLOW_extract_text() for more information.
IMGLOW_extract_text()
This function extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel files.
Returns the buffer of extracted text in ASCII format.
229
Chapter 23 - Document Conversion and Text Extraction
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l MFC_TextSearch_TextExtract_Sample
l Vector_Convert
Syntax
Remarks
Variable Description
*bm_name Name of file from which to extract text
Pointer for buffer from which to receive
**ptr
extracted text
Pointer to an integer to return the length of
*length
the extracted buffer
Page number of file from which to extract
page
text
Returns
Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
Note:
Some PDF or PCL files may be in a format that will not allow text searching.
Example 23.1:IMGLOW_extract_text
%%SOF
/Page=0
/Width=1700
/Height=2200
/FontName=TimesRoman
/FontHeight=44
/FontBold=1
/FontItalic=0
230
Chapter 23 - Document Conversion and Text Extraction
/Xpos=1300 /Ypos=240
%%SOT
Devadas
%%EOT
/Xpos=1253 /Ypos=240
%%SOT
S.
%%EOT
%%EOF
Variable Description
%%SOF Signals the start of the buffer
%%EOF Marks the end of extracted text
Specified once at the beginning of the file to
Page
indicate the page number
Specified once at the beginning of the file to
Width
indicate page width in pixels
Specified once at the beginning of the file to
Height
indicate page height in pixels
Font Name Name of font
FontHeight Font height in pixels
Font to be drawn plain or in bold
FontBold 1 = bold
0 = plain
Font to be drawn in normal or italic
FontItalic 1 = italic
0 = normal
Xpos X pos in pixels
Ypos Y pos in pixels
%%SOT Start of text block
%%EOT End of text block
IMGLOW_extract_text_mem()
This function extracts text from memory. It returns the buffer of extracted text in ASCII format.
Syntax
231
Chapter 23 - Document Conversion and Text Extraction
Remarks
Variable Description
*image_ptr Memory pointer to extract text from
Address of the pointer to the extracted text
**ptr
returned data
*length Pointer to the size of the extracted text buffer
Page number of the input document/image to
page
extract from
Returns
Returns the buffer of extracted text in ASCII format. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_save_document()
This function takes a buffer passed in with text, graphics, and position information obtained
from IMGLOW_extract_text() to create the document file output. The output file contains
searchable text. This currently only supports the PDF file as an output file.
Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a
PDF file already exists, a new page will be appended.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l MFC_TextSearch_TextExtract_Sample
l Vector Convert
Syntax
Remark
Variable Description
*bm_name Name of the output PDF file
Buffer of extracted text, graphics, and bit-
vbuff
maps
232
Chapter 23 - Document Conversion and Text Extraction
Variable Description
filetype Currently only supports PDF - file type 59
Note:
Some PDF or PCL files may be in a format that will not allow text searching.
Returns
Returns the document file output. Any value less than zero is a Snowbound error code. See
Appendix E, Snowbound Error Codes for a list of error codes.
Data Format for Extracted Text Buffer for both Windows and Java
Note:
Each of the tags below should be followed by a new line.
233
Chapter 23 - Document Conversion and Text Extraction
The Save Searchable PDF sample extracts the text from the
input document and saves it as a searchable PDF. The user can
also specify a text string to search for by assigning a value
to the 'stringToSearch' variable.
import Snow.SNBD_SEARCH_RESULT;
234
Chapter 23 - Document Conversion and Text Extraction
String stringToSearch="";
//annotations that have been added and are stored with the doc-
ument.";
System.out.println("fileName"+fileName);
int totalPages = snow.IMGLOW_get_pages(fileName);
System.out.println("total Pages ="+totalPages);
for (int page = 0; page < totalPages; page++) {
saveStatus = snow.IMG_save_document("h:\\testfiles\\output_
file.pdf", extractedText, 59);
System.out.println("extractedText..."+length[0]);
System.out.println("save doc status..."+saveStatus);
//mSearchResults = snow.IMGLOW_search_text(extrac-
tedText,stringToSearch,0,errorA);
//System.out.println("mSearchRes-
ults>>.."+mSearchResults.getClass());
System.out.println("errorA..."+errorA[0]);
}
}
IMG_save_document_mem()
This function takes a buffer passed in with text, graphics, and position information obtained
from IMGLOW_extract_text_mem() to save the document file output to memory. The out-
put file contains searchable text. This currently only supports the PDF file as an output file.
Since PDF is a multi-page file format, it is possible for a single file to contain multiple pages. If a
PDF file already exists, a new page will be appended.
235
Chapter 23 - Document Conversion and Text Extraction
Syntax
Remark
Variable Description
*image_ptr Memory buffer pointer already allocated
Buffer of extracted text, graphics, and bit-
vbuff
maps
filetype Currently only supports PDF - file type 59
Note:
Some PDF or PCL files may be in a format that will not allow text searching.
Returns
Returns the exact document size saved in memory. A value of 0 indicates success. Any value
less than zero is a Snowbound error code. See Appendix E, Snowbound Error Codes for a list of
error codes.
236
Chapter 24 - AFP Font Mapping Functions
IMGLOW_set_fontmap_path()
IMGLOW_set_fontmap()
RasterMaster automatically loads the snbd_map.fnt file if it is found in one of the following dir-
ectories:
l The directory into which images are being read. For example: C:\\AFP\\fontmap
l The directory where your application exists as long as you are not changing directories
with a dialog box
1. The IMGLOW_set_fontmap_path() function sets the path of the font mapping file. See
IMGLOW_set_fontmap_path() for more information.
l face name
l point size
237
Chapter 24 - AFP Font Mapping Functions
l bold attributes
l italic attributes
The snbd_map.fnt file is a simple ASCII text file. Each entry is ended with a carriage return line
feed. The following are two sample entries:
C0BC25I3,Courier,10,0,0
Variable Description
Font resource name in the AFP
C0BC25I3
file.
Courier New face name to map to.
New size in points or 1/72 of an
10
inch.
0 Bold attribute, 0 - off , 1 - on.
0 Italic attribute 0 - off, 1 - on.
If you have a mix of monochrome and color pages that you are converting and saving to another
format, then you may want to use IMGLOW_detect_color() to identify black and white pages
that can safely be converted to a higher performance 1-bit deep format. The color pages should
be converted to an output format that supports color, such as JPEG. Please see Appendix A,
Supported File Formats for details on which formats support color information at different bit-
depths.
IMGLOW_set_fontmap_path()
This function defines the path where Snowbound Software will look for the font mapping file,
snbd_map.fnt. If the path is not currently set, RasterMaster DLL looks for it in the current dir-
ectory. The current directory is whatever folder the program is currently in, usually wherever the
file being decompressed is located.
Syntax
238
Chapter 24 - AFP Font Mapping Functions
Remark
Variable Description
A string pointer to the path to
look for the snbd_map.fnt file.
Returns
Returns the status of the path of the font mapping file. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMGLOW_set_fontmap()
This function programmatically sets font mapping.
Syntax
Remark
Variable Description
Pointer to font mapping data. This
is the whole buffer of data found in
the font map file, snbd_map.fnt.
This variable overrides existing
font mapping in the snbd_map.fnt
file.
font_map The following are some examples
of the data in this variable:
C0H400xx90,PrecisionID Post-
net L DEMO,12,0,0
C0BPOSBX,CCodePost-
net,10,0,0
239
Chapter 24 - AFP Font Mapping Functions
Variable Description
The integer length of font mapping
maplength
data
Returns
Returns the status of the font mapping data. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
240
Chapter 25 - Standard UNIX and XWindows Specific Functions
IMG_global_get_Xdisplay()
IMG_global_set_Xdisplay()
IMG_global_get_Xscreen
IMG_global_set_Xscreen
IMG_global_get_Xreserverd_colors()
IMG_global_set_Xreserved_colors()
IMG_repaint_scroll()
IMG_scroll_bitmap()
IMG_zoom_bitmap()
IMG_zoom_bitmap_1_to_1()
IMG_zoom_bitmap_rect()
IMG_global_get_Xdisplay()
This function returns the cached display pointer.
Syntax
Returns
Returns the status of the Cached display pointer. Any value less than zero is a Snowbound
error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_global_set_Xdisplay()
Call this function before doing any display functions with the library. This value is used to obtain
information from XWindows. The default screen parameter is saved in an internal global when
the display is set. Reserved colors for the display default to 256. XAllocColorCells() is
called to set up the color cells.
241
Chapter 25 - Standard UNIX and XWindows Specific Functions
Syntax
Remark
Variable Description
display Type of display
Returns
Returns the status of the type of display. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_global_get_Xscreen
This function returns the cached screen parameter in use.
Syntax
Returns
Returns the status of the cached screen in use. Any value less than zero is a Snowbound error
code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_global_set_Xscreen
This function sets the screen. Call this function if the screen you are working with is not the
default screen (from DefaultScreen()) of the display. The default screen is saved in an internal
global when the display is set.
Syntax
Remark
Variable Description
screen Screen to use
242
Chapter 25 - Standard UNIX and XWindows Specific Functions
Returns
Returns the status of the screen to use. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_global_get_Xreserverd_colors()
This function returns the cached number of color cells allocated. In X, color map entries are
called color cells. A color map is a table with entries specifying the RGB values of available col-
ors. The number of color cells is equal to or greater than 2N where N is the number of bits in a
pixel value.
Syntax
Returns
Returns the status of the cached number of color cells allocated. Any value less than zero is a
Snowbound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_global_set_Xreserved_colors()
This function sets the number of color cells to allocate. Set this parameter before the first call to
IMG_global_set_Xdisplay() if you wish to allocate fewer than the default number of
color cells. The default is 2N where N is the number of bits in a pixel value.
Syntax
Remark
Variable Description
reserved Number of color cells to allocate
Returns
Returns the status of the number of color cells to allocate. Any value less than zero is a Snow-
bound error code. See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_repaint_scroll()
This function is used in the update event code after a scroll to repaint dirty scrolled areas of the
window.
243
Chapter 25 - Standard UNIX and XWindows Specific Functions
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Fit
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Library image handle integer returned from
imghandle most decompress functions. This is the
standard library image handle.
Pointer to X+window where the image is cur-
window
rently displayed.
scroll_dir Returned from IMG_scroll_bitmap().
xrange Width of the area to repaint after scrolling.
yrange Height of the area to repaint after scrolling.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_scroll_bitmap()
This function is used to scroll the image in a window. Call this as a result of a mouse down
event. This function calls TrackControl() to scroll the image until the mouse button is
244
Chapter 25 - Standard UNIX and XWindows Specific Functions
released. Provide only the ControlHandle of the scroll bar you wish to scroll, the other argu-
ments should be zero.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Fit
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Library image handle integer returned from most decompress func-
imghandle
tions. This is the standard library image handle.
window Pointer to X+window where the image is currently displayed.
SB_HORZ to scroll in x direction, SB_VERT to scroll in y dir-
orientation
ection.
Amount to scroll.
amount Positive for right/down
Negative for left/up
xrange Current scaled width of the image.
yrange Current scaled height of the image.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
245
Chapter 25 - Standard UNIX and XWindows Specific Functions
IMG_zoom_bitmap()
This function is the standard library zoom function. A zoom value of 100 tells the function to dis-
play the whole image at the coordinates in the IMG_display_bitmap() call. Any value
greater than 100 crops the image so it is not fully displayed in the current window. x_normal and
y_normal are used to calculate zooming. The scaled image coordinates and size are returned
for your use.
Syntax
Remark
Variable Description
Library image handle integer returned from
imghandle most decompress functions. This is the
standard library image handle.
Pointer to X+window where the image is cur-
window
rently displayed.
zoom_factor Amount to zoom.
(output) Scaled X origin with current rotation
x_pos
accounted for.
(output) Scaled Y origin with current rotation
y_pos
accounted for.
(output) Scaled X size with current rotation
x_range
accounted for.
(output) Scaled Y size with current rotation
y_range
accounted for.
x_normal (input) original X image size.
y_normal (input) original Y image size.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap_1_to_1()
This function is used to display images with a one-to-one pixel correspondence. A zoom value
of 100 tells the function to display each pixel of the image for one pixel on the screen. x_normal
and y_normal are used to base the zooming calculations on. The scaled image coordinates and
size are returned for your use.
246
Chapter 25 - Standard UNIX and XWindows Specific Functions
Syntax
Remark
Variable Description
Library image handle integer returned from
imghandle most decompress functions. This is the
standard library image handle.
Pointer to X+window where the image is cur-
window
rently displayed.
zoom_level Amount to zoom.
center_flag Re-centers image if set to 1.
(output) Scaled X origin with current rotation
x_pos
accounted for.
(output) Scaled Y origin with current rotation
y_pos
accounted for.
(output) Scaled X size with current rotation
x_range
accounted for.
(output) Scaled Y size with current rotation
y_range
accounted for.
x_normal (input) original X image size.
y_normal (input) original Y image size.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap_rect()
This function is most effective for resizing a window. Call after the zoom event has been pro-
cessed when repainting the image with IMG_display_bitmap(). The scaled image coordin-
ates and size are returned for your use. An IMG_RECT is the same as a Rect, except the
elements of the structure are long, not short.
Syntax
247
Chapter 25 - Standard UNIX and XWindows Specific Functions
Remark
Variable Description
Library image handle integer returned from
imghandle most decompress functions. This is the
standard library image handle.
Pointer to X+window where the image is cur-
window
rently displayed.
lprect Rectangle in image to zoom
mode Using image or screen coordinates.
(input/output) X origin client rectangle of
x_pos
image.
(input/output) Y origin client rectangle of
y_pos
image.
(input/output) X size client rectangle of
x_range
image.
(input/output) Y size client rectangle of
y_range
image.
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
248
Chapter 26 - Macintosh High Level and Image Management Functions
IMG_dib_to_GWorld()
IMG_dib_to_GWorld_bitDepth()
IMG_GWorld_to_dib()
IMG_display_bitmap_aspect()
IMG_repaint_scroll
IMG_scroll_bitmap()
IMG_set_croprect_scroll()
IMG_zoom_bitmap
IMG_zoom_bitmap_rect()
IMG_zoom_bitmap_1_to_1()
IMG_dib_to_GWorld()
This function generates a GWorld. It is the current pixel depth of the image of the screen from
the image passed in.
Syntax
Remark
Variable Description
Standard image handle obtained from a
hdib decompress function such as IMG_decom-
press_bitmap()
Pointer to a GWorldPtr, receives the created
*gWorldRef
GWorld
xsize Width of the image
ysize Height of the image
flags Additional flags to use when creating
249
Chapter 26 - Macintosh High Level and Image Management Functions
Variable Description
GWorld
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_dib_to_GWorld_bitDepth()
This function generates a GWorld from the image passed in. If the bitDepth is zero, the GWorld
is generated at the current depth of the screen. If the bitDepth is not zero, then a GWorld is cre-
ated using the bitDepth of the image. 24-bit images are promoted to 32-bit images.
Syntax
Remark
Variable Description
Standard image handle obtained from a
hdib decompress function such as IMG_decom-
press_bitmap()
GWorld pointer that receives the created
*gWorldRef
GWorld
xsize Width of the image
ysize Height of the image
flags Additional flags to use when creating GWorld
bitDepth Value of the bit depth
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_GWorld_to_dib()
This function creates an image from a GWorld. GWorld is the Macintosh’s virtual graphic envir-
onment. This does not alter the original GWorld; it just copies and converts the data to Raster-
Master’s internal DIB format. The function returns standard library codes.
Syntax
250
Chapter 26 - Macintosh High Level and Image Management Functions
Remark
Variable Description
hdib Imghandle for the image created
gWorldPtr Pointer to GWorld to convert
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_display_bitmap_aspect()
This function is an image display routine with corrected aspect ratio. It takes a standard image
handle and displays the image into the device context specified by hdc.
After displaying the image, it turns scroll bars on or off for correct scrolling. A zoom factor of 100
displays the image with a one-to-one pixel ratio. A zoom of 0 fits the image horizontally or ver-
tically into the window.
Syntax
Remark
Variable Description
hdib Imghandle of the image created
xs Starting X coordinate for display of image
ys Starting Y coordinate for display of image
xsize Width of the image
ysize Height of the image
Zoom factor:
zoom 0 = fit to window
100 = display pixels one to one
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizScroll
nonzero
251
Chapter 26 - Macintosh High Level and Image Management Functions
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_repaint_scroll
This function should be called after a scroll message to repaint the scrolled area of the window.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Alpha
l Annotate
l Aspect
l Fit
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from most
hdib
decompress functions.
theWindow Current active handle
scroll_dir Returned from IMG_scroll_bitmap()
*paint Pointer to the Rectange to Paint
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
252
Chapter 26 - Macintosh High Level and Image Management Functions
IMG_scroll_bitmap()
This function is used in conjunction with the IMG_repaint_scroll() function for fast
scrolling.
The value returned must be saved and passed to the IMG_repaint_scroll() function. The
message, wparam and lparam, are the arguments from the main windows handle procedure.
Syntax
Remark
Variable Description
Standard image handle obtained from a
handle decompress function such as IMG_decom-
press_bitmap()
theWindow Current active window handle
mouseLocation Current mouse pointer location
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizScroll
nonzero
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_set_croprect_scroll()
This function sets the cropping rectangle for the image represented by hdib. It also turns on or
off the scrollbars to enable scrolling.
If the aspect is set to 1, the aspect ratio is corrected. This slightly changes the cropping rect-
angle in the X or Y direction.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the following samples:
l Aspect
253
Chapter 26 - Macintosh High Level and Image Management Functions
l MFC_Sample
l MFC_TextSearch_TextExtract_Sample
l Zoom
Syntax
Remark
Variable Description
Standard image handle obtained from a
hdib decompress function such as IMG_decom-
press_bitmap()
Handle of window image is currently dis-
theWindow
played in
xs Starting X coordinate for cropping rectangle
ys Starting Y coordinate for cropping rectangle
xe Width of cropping rectangle
ye Height of cropping rectangle
1 or True = aspect ratio on
aspect
0 = aspect ratio off
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizScroll
nonzero
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap
This function is a standard library zoom function. A zoom value of 100 tells the function to dis-
play the whole image in the coordinates specified in the call to IMG_display_bitmap().
Any value greater than 100 crops the image to display only part of the image. If the entire image
does not fit into the current window, this function turns the scroll bars on or off.
254
Chapter 26 - Macintosh High Level and Image Management Functions
Syntax
Remark
Variable Description
Standard image handle obtained from a
handle decompress function such as IMG_decom-
press_bitmap()
theWindow Active window handle
zoom Amount to zoom
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizScroll
nonzero
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap_rect()
This function resizes a window. It turns the scroll bars on or off to allow scrolling.
You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Zoom sample.
Syntax
Remark
Variable Description
Standard image handle obtained from a
handle decompress function such as IMG_decom-
press_bitmap()
theWindow Active window handle
255
Chapter 26 - Macintosh High Level and Image Management Functions
Variable Description
lprect Rectangle in image to zoom about
lplast Client rectangle of image
Used to specify image or screen coordinates
mode 0 = Screen Coordinates
1 = Image Coordinates
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizScroll
nonzero
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
IMG_zoom_bitmap_1_to_1()
This function displays images with a one-to-one pixel ratio. A zoom value of 100 maps each
pixel of the image to one pixel on the screen.
Syntax
Remark
Variable Description
Standard image handle obtained from a
handle decompress function such as IMG_decom-
press_bitmap()
theWindow Active window handle
zoom Amount to zoom
center Re-centers image if set to 1
Modifies the vertical scroll bar when set to
vertScroll
nonzero
Modifies the horizontal scroll bar when set to
horizonScroll
nonzero
Returns
Returns the standard library image handle. Any value less than zero is a Snowbound error code.
See Appendix E, Snowbound Error Codes for a list of error codes.
256
Chapter 27 - Format for Decompressed Images
Extended Product
All formats are converted to either 1, 4, 8, or 24-bits. All 1, 4, and 8-bit images have a palette.
However, 24-bit images never have a palette. The raw uncompressed image data follows the
palette specification.
For RasterMaster plus options, 1-bit images are stored differently. The image format for 1-bit
images is the normal DIB header, a palette consisting of 2 RGBQUAD structures, and then the
compressed data. The image data is compressed and each raster is stored as a series of runs.
Each run is stored as a 32-bit integer. The first word is a byte count of the entire raster including
the byte count word. This is followed by a white then black column. The line alternates from
white to black until the end of the raster.
A line always starts with a white column. If the first pixel is black, the first white entry is then
zero. The line must end with at least 3 entries for the horizontal width.
257
Chapter 27 - Format for Decompressed Images
Note:
In RasterMaster V17.6, the pelsPerMeter attribute queries return the actual value con-
tained in the attribute. In previous versions, the bi{X/Y}PelsPerMeter would return a
default value of 100 if the value was not set in the image. This method resulted in there
being no way to tell if RasterMaster was returning the default value or the actual value
that was set. Beginning with RasterMaster V17.6, it will return the actual value even if it
258
Chapter 27 - Format for Decompressed Images
is 0. If you want to preserve the previous behavior, you can add a check to see if the bi
{X/Y}pelsPerMeter attribute is valued at 0. If it is valued at 0, replace it with 100.
All rasters must end on a long or a multiple of 4 bytes. Extra bytes are added to rasters not meet-
ing this criterion. They are stored with upside down or the last raster first up to the first or line 0.
259
Chapter 28 - Annotation and Redlining Toolkit
Note:
This is an optional tool for the RasterMaster product. Please contact sales if you would
like more information.
The library is called from the developer’s application. Annotation objects are created through an
interface and then stored in one or more annotation layers; each stored as a separate file. The
annotation objects are registered with the underlying image permitting zooming and scrolling of
the overall display without losing registration of the annotation information. The display of the
underlying image can be managed through the use of Snowbound’s RasterMaster product or
any other application or tool that displays images.
ANN_GRAPHIC_STRUCT Structure
SANN_activate_all_objects()
SANN_activate_object()
SANN_add_object()
SANN_choose_color()
SANN_choose_font()
SANN_choose_line_style()
SANN_choose_line_width()
SANN_create_ann()
SANN_deactivate_all_objects()
SANN_deactivate_object()
SANN_delete_all_objects()
SANN_delete_object()
SANN_display_annotations()
SANN_draw_object()
SANN_get_croprect()
SANN_get_object_bounds()
260
Chapter 28 - Annotation and Redlining Toolkit
SANN_get_object_data()
SANN_get_object_info()
SANN_get_object_num()
SANN_highlight_object()
SANN_map_image_to_wnd()
SANN_map_wnd_to_image()
SANN_merge_ann()
SANN_mouse()
SANN_move_object()
SANN_print_annotations()
SANN_read_ann()
SANN_resize_object()
SANN_rotate()
SANN_set_bcolor()
SANN_set_croprect()
SANN_set_delete_flag()
SANN_set_fcolor()
SANN_set_font()
SANN_set_line_style()
SANN_set_line_width()
SANN_set_size()
SANN_write_ann()
Annotation Constants
ANN_GRAPHIC_STRUCT Structure
This structure represents an annotation object stored in its internal format within the Raster-
Master Annotation SDK.
Structure
Below is the structure for the ANN_GRAPHIC_STRUCT function.
261
Chapter 28 - Annotation and Redlining Toolkit
Variables
Table 28.1: ANN_GRAPHIC_STRUCT Class Variables
Variable Description
ANN_GRAPHIC_STRUCT next Next Annotation object
char FAR next Next Annotation object
char FAR prev Previous Annotation object
SANN_RECT rc Rectangle
char FAR text Byte array of text
262
Chapter 28 - Annotation and Redlining Toolkit
Variable Description
long edit_hwnd Text area
long data_size Size of data in bytes
long fhmem Used internally
long hmem Used internally
long thmem Used internally
long imghandle Image handle
char font_name Name of font
short int italic Indicates italicized font
short int bold Indicates bold font
short int font_height Font height
short int fred Red plane of foreground color
short int fblue Blue plane of foreground color
short int fgreen Green plane of foreground
short int bred Red plane of background color
short int bblue Blue plane of background color
short int bgreen Green plane of background color
short int width Width of annotation object
short int height Height of annotation object
short int bits_pix Bits per pixel of image
short int transp Indicates transparency
short int graphic_id Annotation object type
short int line_width Line width
short int line_style Line style
SANN_activate_all_objects()
This function is used on SANN_EDIT and SANN_POSTIT objects to allow editing of the text in
the box. This makes the window active and usable. This call activates all objects on the page.
Notes:
In this mode you cannot move or delete the object.
You must call the SANN_deactivate_object first.
Syntax
Remark
Variable Description
hann Standard annotation handle.
263
Chapter 28 - Annotation and Redlining Toolkit
SANN_activate_object()
This function is currently used on SANN_EDIT and SANN_POSTIT objects to allow editing of
the text in the box. This makes the window active and usable.
Notes:
In this mode you cannot move or delete the object.
You must call the SANN_deactivate_object first.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num The object to activate
SANN_add_object()
This function adds a new object to the current annotation. Use data size, data for text, and free-
hand annotations to point to the text of array of points for freehand annotations. The size must
be in image coordinates. Use SANN_map_wnd_to_image to convert from screen to image
coordinates.
Syntax
Remark
Variable Description
hann Standard annotation handle.
graphic_id A unique number for each graphic object.
Pointer to rectangle defining outline of points
rc for most graphics functions in the current
image’s coordinates.
Data for text, freehand annotations, and
data
edits.
data_size The size in bytes for text, freehand, or edits.
264
Chapter 28 - Annotation and Redlining Toolkit
SANN_choose_color()
This function displays a dialog box suitable for selecting a color with which to draw. It returns
the selected color in a format packed in the following order: 3 bytes of red, green, and blue.
Syntax
Remark
Variable Description
hann Standard annotation handle.
SANN_choose_font()
This function displays a dialog box for choosing the font type and height for the annotation. If
the OK button is pressed, the current font height and name is set in the current annotation group
specified by the annotation handle.
Syntax
Remark
Variable Description
hann Standard annotation handle.
SANN_choose_line_style()
This function displays a dialog box for selecting and setting the current line style in the annota-
tions specified by the annotation handle.
Syntax
Remark
Variable Description
hann Standard annotation handle.
265
Chapter 28 - Annotation and Redlining Toolkit
SANN_choose_line_width()
This function displays a dialog box for selecting and setting the current line width in the annota-
tions specified by the annotation handle.
Syntax
Remark
Variable Description
hann Standard annotation handle.
SANN_create_ann()
This function creates and returns a new annotation handle if it is not reading an annotation from
a file.
Syntax
Remark
Variable Description
width Width in pixels of image to annotate
height Height in pixels of image to annotate
hWnd Window in which currently displayed
SANN_deactivate_all_objects()
This function is used on SANN_EDIT and SANN_POSTIT objects to stop the editing of text in
the box. It makes the window inactive and now draws the object as any other data object. This
call deactivates all objects on the page.
Notes:
In this mode you can move or delete the object.
You must call the SANN_activate_object to edit the text.
266
Chapter 28 - Annotation and Redlining Toolkit
Syntax
Remark
Variable Description
hann Standard annotation handle
SANN_deactivate_object()
This function is used on SANN_EDIT and SANN_POSTIT objects to stop the editing of text in
the box. It makes the window inactive and draws the object as any other data object. In this
mode you can move or delete the object.
Note:
You must call the SANN_activate_object to edit the text.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num Specify the object to deactivate
SANN_delete_all_objects()
This function deletes all graphics and memory associated with the graphics handle.
Syntax
Remark
Variable Description
hann After this call the hann will no longer be valid
267
Chapter 28 - Annotation and Redlining Toolkit
SANN_delete_object()
This function deletes a graphic from the current list referred to by the graphics handle.
Syntax
Remark
Variable Description
hann Standard annotation handle
This is an internal number for each graphic
returned by SANN_get_object_num. It is
the number in a linked list of graphics. Use
graphic_num this number after the call to SANN_get_
object_number as SANN_delete_
object. This may change the number of
existing graphics
SANN_display_annotations()
This function displays the current annotation to the device context pointed by HDC. This func-
tion always assumes that the image is aspect ratio corrected into the coordinates xs, ys, xz,
and yz.
Note:
Before calling you may want to call SANN_set_croprect to allow for zooming and
scrolling.
Syntax
Remark
Variable Description
hann Standard annotation handle
hDC Windows device context
xs Starting X position
ys Starting Y position
268
Chapter 28 - Annotation and Redlining Toolkit
Variable Description
xz X size of window
yz Y size of window
SANN_draw_object()
This function draws the object (graphic_num) at the coordinates passed that are image
coordinates.
Syntax
Remark
Variable Description
hann Standard annotation handle
hDC Device into which to draw context
graphic_num Specify the object to draw
xs X position to start drawing
ys Y position to start drawing
xz X size to draw object
yz Y size to draw object
SANN_get_croprect()
This function returns the annotations cropping area, which should be the same as the annotated
images.
Syntax
int SNBDAPI SANN_get_croprect(int hann, int *xs, int *ys, int FAR
*xe, int *ye);
Remark
Variable Description
hann Standard annotation handle
xs X starting coordinate to be returned
ys Y starting coordinate to be returned
xe X crop rectangle size to be returned
ye Y crop rectangle size to be returned
269
Chapter 28 - Annotation and Redlining Toolkit
SANN_get_object_bounds()
This function returns the bounding box of the object (graphic_num) in image pixel coordinates.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num Specify the object to return bounding box
rc Rectangle of bounding box
SANN_get_object_data()
This function returns the data of the object (graphic_num). The function returns the size of the
data in bytes. This function is currently only implemented for SANN_EDIT and SANN_POSTIT
to return the text input into the object.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num Specify the object from which to return data
data Pointer in which to put data
SANN_get_object_info()
This function returns as instance of the ANN_GRAPHIC_STRUCT class, which is the internal
wrapper for the object number passed in. This has information about the size, color, and object
attributes.
Syntax
270
Chapter 28 - Annotation and Redlining Toolkit
Remark
Variable Description
hann Standard annotation handle
Specify the object for which to return a struc-
graphic_num
ture pointer
SANN_get_object_num()
This function tries to find a graphic whose bounding box surrounds the points xpos and ypos. If
found, return the graphic number usable by SANN_delete_object and other functions.
Syntax
Remark
Variable Description
hann Standard annotation handle
hWnd Window currently being displayed in
xpos X coordinate in the windows coordinates
ypos Y coordinate in the windows coordinates
SANN_highlight_object()
This function highlights the bound box of the graphic specified by graphic_num. This number
is found by SANN_get_object_num.
Syntax
Remark
Variable Description
hann Standard annotation handle
Windows currently in use by image and
hWnd
annotations
graphic_num Graphic to highlight
271
Chapter 28 - Annotation and Redlining Toolkit
SANN_map_image_to_wnd()
This function converts the internal graphics coordinates relative to the image coordinates rel-
ative to the current window.
Syntax
Remark
Variable Description
hann Standard annotation handle.
Displays current rectangle. Use GetCli-
disprect
entRect if using the whole window.
xs Set the X coordinate to convert.
ys Set the Y coordinate to convert.
SANN_map_wnd_to_image()
This function converts the window coordinates to the current annotated image coordinates.
Syntax
Remark
Variable Description
hann Standard annotation handle.
Displays current rectangle. Use GetCli-
disprect
entRect if using the whole window.
xs Set the X coordinate to convert.
ys Set the Y coordinate to convert.
SANN_merge_ann()
This function reads in the annotation from the file name.
272
Chapter 28 - Annotation and Redlining Toolkit
Notes:
Do not replace the existing annotations specified by the hann handle. Append all annota-
tion objects from the file to the existing annotations specified by the handle.
Syntax
Remark
Variable Description
*filename File name of a snowbound annotation file
Handle to existing snowbound annotation
hann
object
SANN_mouse()
This function is part of the annotation toolkit user interface handling routines. It handles the user
interface for adding, deleting, and moving annotations and puts it into the main windows mes-
saging handling loop.
Notes:
Not necessary to call.
You may do your own user interface with all of the above calls.
Syntax
Remark
Variable Description
hWnd Current window handle being used
Window handling function message para-
msg
meter
Window handling function wParam para-
wParam
meter
lParam Window handling function lParam parameter
hann Standard annotation handle
graphic_id Current graphic id to add
273
Chapter 28 - Annotation and Redlining Toolkit
Variable Description
Extra data to add to EDIT or POSTIT
textbuff
objects or name of bitmap to import
SANN_move_object()
This function moves or resizes the object graphic_num. Use the rectangle passed in as rc.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num Specify the object to move
rc Rectangle for new object position and size
SANN_print_annotations()
This function prints the current annotation to the device context pointed by HDC. It always
assumes that the image is aspect ratio corrected into the coordinates xs, ys, xz, yz.
Syntax
Remark
Variable Description
hann Standard annotation handle
hDC Windows device context to print
xs Starting X position
ys Starting Y position
xz X size of window
yz Y size of window
SANN_read_ann()
This function reads an annotation file from disk and returns a handle to it. You do not need to
call SANN_create_ann if you call this function.
274
Chapter 28 - Annotation and Redlining Toolkit
Syntax
Remark
Variable Description
Refers to the name of the file in which to
Filename
read
hWnd Window currently being displayed
SANN_resize_object()
This function resizes an annotation object specified by the Id. The new size is specified in the
Rect structure. Hann is the handle to the group of annotation objects.
Syntax
Remark
Variable Description
hann Standard annotation handle
graphic_num The ID of the object to resize
rc Rectangle to hold new size of object
SANN_rotate()
This function rotates all annotations in the current handle by the specified angle: 90, 180, or 270
degrees.
Syntax
Remark
Variable Description
hann Standard annotation handle
angle Angle by which to rotate annotation
275
Chapter 28 - Annotation and Redlining Toolkit
SANN_set_bcolor()
This function sets the current background drawing color for all graphics. Currently only used by
the text graphic.
Syntax
Remark
Variable Description
hann Standard annotation handle
red Red value 0 - 255
green Green value 0 - 255
blue Blue value 0 - 255
SANN_set_croprect()
This function allows proper zooming, panning, and scrolling for annotations. The annotation
toolkit needs to know the images’ current cropping rectangle to work properly.
Syntax
int SNBDAPI SANN_set_croprect(int hann, int xs, int ys, int xe, int
ye);
Remark
Variable Description
hann Standard annotation handle
xs Set the X starting coordinate
ys Set the Y starting coordinate
xe Set the X crop rectangle size
ye Set the Y crop rectangle size
SANN_set_delete_flag()
This function allows you to turn on or off the Delete menu option in the popup window used
when editing annotations.
276
Chapter 28 - Annotation and Redlining Toolkit
Syntax
Remark
Variable Description
0 = on
on_off
1 = off
SANN_set_fcolor()
This function sets the current foreground drawing color for all graphics.
Syntax
Remark
Variable Description
hann Standard annotation handle
red Red value 0 - 255
green Green value 0 - 255
blue Blue value 0 - 255
SANN_set_font()
This function sets the current type of font to use. It uses the values returned from the
CHOOSEFONT common dialog box LOGFONT data structure.
Syntax
Remark
Variable Description
hann Standard annotation handle.
name Name of font to use. (lfFaceName)
277
Chapter 28 - Annotation and Redlining Toolkit
Variable Description
italic Use an italic font. (lfItalic)
bold Use bold font. (lpWeight)
font_height Size of the font to use. (lfHeight)
SANN_set_line_style()
This function sets current line style for lines, ellipses, rectangles, and freehand drawings.
Syntax
Remark
Variable Description
hann Standard annotation handle.
Line drawing style. Currently, the Raster-
Master Annotation Toolkit supports the fol-
lowing line styles:
style PS_DASH 1
PS_DASHDOT 3
PS_DASHDOTDOT 4
PS_DOT 2
PS_SOLID 0
SANN_set_line_width()
This function sets the current line width for lines, ellipses, rectangles, and freehand drawings.
Syntax
Remark
Variable Description
hann Standard annotation handle
width Width of lines in pixels
278
Chapter 28 - Annotation and Redlining Toolkit
SANN_set_size()
This function sets the height and width of the current image being annotated. The internal
format for Snowbound annotations contains this information.
When reading in other annotation file formats, you need to call this function to set the height and
width of the current annotation image being annotated after reading in the annotation file.
Syntax
Remark
Variable Description
hann Standard annotation handle
width Width of current image being annotated
height Height of current image being annotated
SANN_write_ann()
This function writes out annotations to disk file. The extra_size and extra_data variables
allow the embedding of other data into the file such as company name, data, or other elements
one would like to put into the file.
Syntax
Remark
Variable Description
hann Standard annotation handle
filename Path name or file to write
extra_size Size of extra data to write after first header
extra_data Pointer to extra data to write
Annotation Constants
The annotation and redlining toolkit also comes with pre-determined annotation constants. They
are as follows:
279
Chapter 28 - Annotation and Redlining Toolkit
Annotation Constant
SANN_FILED_RECT 1
SANN_HIGHLIGHTED_RECT 2
SANN_RECTANGLE 3
SANN_LINE 4
SANN_ELLIPSE 5
SANN_FILLED_ELLIPSE 6
SANN_FREEHAND 7
SANN_BITMAP 8
SANN_POSTIT 9
SANN_POLYGON 10
SANN_FILLED_POLYGON 11
SANN_ARROW 12
SANN_EDIT 13
280
Chapter 29 - Working with PDF and Other Document File Formats
Performance
These, like any other file formats supported by Snowbound Software’s products, are read in
using a call such as IMG_decompress_bitmap(). For ActiveX, use the Image property.
Snowbound Software’s products auto-detect the file format so there is no need to specify which
format you are reading. You don't even need a specific extension.
These formats contain graphics commands such as line and text drawing. This differs from bit-
map formats that are a 2-dimensional array of bytes forming a picture. Normally, documents are
drawn or “rendered” to a bitmap in RasterMaster, but RasterMaster can also produce search-
able text document.
The rendering size for the bitmap can be set by the following call to our library:
IMGLOW_set_document_input(int dpi, int bits_pix, int format);
281
Chapter 29 - Working with PDF and Other Document File Formats
Variable Description
dpi Sets the document in dots per inch.
bits_pix Sets the bits per pixel.
1 = black and white documents
24 = color images
format Sets the format parameter.
Saving
This function sets the destination size for saving PDF files. The xsize and ysize are the output
sizes in points. A point is 1/72 of an inch. Only PDF, PCL, and AFP file formats can be saved.
The PCL and APF file formats are saved as bitmap. The PDF file format can be saved as bit-
map or searchable text.
You can specify the output size with PDF using the following call:
IMGLOW_set_pdf_output(int double xsize, int double ysize);
Variable Description
double xsize Width of image in points.
double ysize Height of image in points.
Currently, Snowbound Software does not provide PDF reading support in UNIX and Macintosh
products. Snowbound Software does provide PDF writing support for its UNIX and Macintosh
products.
PDF reading is available as a separate option. For the RasterMaster Imaging SDK for Java, a
special PDF version is available. For the other RasterMaster products, the pdfplug.dll file is
required for PDF reading support. This file must be included in the same directory as the Act-
iveX, .NET library, or RasterMaster DLL. You can also include the file in the following directory:
\Windows\system.
282
Chapter 29 - Working with PDF and Other Document File Formats
The default size for decompressing PDF documents is 200 dots per inch (DPI) and 24 bits per
pixel. To alter this or to convert PDF files, you can call the IMGLOW_set_pdf_input(dpi,-
dots_per_inch) function. For RasterMaster Imaging SDK for ActiveX, call the PdfDpi and
PdfBitsPerPixel properties.
If you are working with black and white documents, you will save a lot of memory and increase
performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading PDF
images. For 1-bit or black and white images, RasterMaster will write out or save a PDF with
CCITT - G4 compression for black and white images.
Performance
If you are working with black and white documents, you will save a lot of memory and increase
performance by setting the DPI to 300 or 200 and the bits per pixel to 1 when reading all doc-
ument formats.
283
Appendix A - Supported File Formats
RasterMaster is a powerful conversion tool that can transform your documents and images into
many different formats. Some format types are limited in the amount of color (bit-depth) they
support in an image. Some file formats read and write only black and white (1-bit deep) and
other file formats support only color images (8+ bits deep). For many of these cases, Raster-
Master automatically converts the pixel depth to the appropriate value, based on the output
format specified. The chart below will help you determine whether your black and white or color
document will be able to convert straight to the desired output format with no additional pro-
cessing.
You can open a document in almost any supported input format by using IMG_decompress_bit-
map(). You do not have to pass in the format type, it is automatically recognized. You can save
a document to almost any supported output format by using IMG_save_bitmap(). You pass the
format type number from the chart below to indicate the format you want. Please see Chapter
11, File Format Conversion for more details.
Please note that the higher the bit depth (bits per pixel), then the larger the size of the image on
the disk or in memory. The higher bit depth may offer more quality, but the performance may suf-
fer because there is a lot more image data to process. Many users may have images that
appear to be black and white, however, they are stored in 24-bit color. Converting these doc-
uments to a 1-bit file format will decrease the size of the file and improve performance with no
perceivable loss in quality.
If you have any questions about what format to select you may contact Snowbound Technical
support on the web at http://support.snowbound.com.
284
Appendix A - Supported File Formats
You can find the bit depth/bits per pixel of your image by calling IMG_bitmap_info() and looking
at the value in biBitCount.
285
Appendix A - Supported File Formats
286
Appendix A - Supported File Formats
format.
287
Appendix A - Supported File Formats
288
Appendix A - Supported File Formats
289
Appendix A - Supported File Formats
files.
290
Appendix A - Supported File Formats
291
Appendix A - Supported File Formats
292
Appendix A - Supported File Formats
293
Appendix A - Supported File Formats
294
Appendix A - Supported File Formats
295
Appendix A - Supported File Formats
per pixel.
* = optional only
296
Appendix A - Supported File Formats
297
Appendix A - Supported File Formats
298
Appendix A - Supported File Formats
299
Appendix B - Software Installation
Directory Structure
Installed Files
You can get an evaluation by contacting a member of our sales team at sales@s-
nowbound.com or 1-617-607-2010. The evaluation copy expires at the end of each month.
Both the developer and runtime version of RasterMaster DLL ship as fully serialized builds
which are very easy to install. This product is fully enabled as either a developer or runtime
product.
RasterMaster DLL is delivered as a .zip archive that can be manually extracted to an install-
ation directory chosen by the user. For example:
C:\Program Files\Snowbound\RMDLL
Notes:
For RasterMaster DLL, Snowbound requests that you place all Snowbound components
in a non-common directory within Windows. They should NOT be placed in the \win-
dows or \windows\system directory or other such common area.
Starting with version 14, RasterMaster’s file naming convention will no longer include
the version number in the file name and will follow a generic naming convention. For
example, in the previous version, the file named snbd13cm.dll will now be named
snbdcm.dll.
When a developer's license is purchased, a Developer’s Version banner appears. You must
interactively select the notification box for the program to continue. Contact sales if you need to
eliminate this notification for your development purposes.
300
Appendix B - Software Installation
Notes:
You are running an evaluation version of the software if an evaluation banner appears on
the screen. Contact support at (support@snowbound.com) for help with these issues.
If you download an update or receive one from Snowbound technical support, please
ensure that you obtain a serialized version of the product before you go into distribution.
Your application will link to one or more Snowbound dlls, including snbdcm.dll and plug-in .dlls.
When your application is deployed, the Snowbound files should be placed in either the same dir-
ectory as your application or in a Snowbound directory where the application can find them.
These files should not be placed in a Windows\System directory or other common Windows
directory.
If more than one Snowbound dll is used, they should all be kept at the same version. If one dll is
updated or upgraded they should all be updated or upgraded.
l You will see a pop up banner when you view or convert your first document. Subsequent
documents in the same session will not elicit the banner.
l You will see large thin Xs across each page after the first 50 pages or thumbnails.
l After your expiration date, you will see a banner stating the evaluation has expired. You
will not see any output.
Other than that you will have full use of the product including support for all document formats.
301
Appendix B - Software Installation
Note:
The installation dialogs that you see during your actual installation may be slightly dif-
ferent depending on which version of the SDK you install. In this example, Raster-
Master DLL with PDF is being installed.
2. After reading the dialog, click Next to display the License Agreement dialog.
302
Appendix B - Software Installation
l If you agree with the license agreement, select “I accept the license agreement”
and click Next to display the Readme Information dialog.
l If you do not agree with the license agreement, you cannot proceed with the
installation.
4. Click Next after reading the Readme information to display the Installation Folder dialog.
303
Appendix B - Software Installation
5. Accept the default destination folder and click Next to display the Ready to Install dia-
log.
304
Appendix B - Software Installation
6. Click Install to begin the installation. Installation begins. This may take a few seconds.
7. You will see a warning message if you do not have the Visual C++ 2005 Redistributable
prerequisite file installed. If you want to use the RasterMaster Imaging SDK Microsoft
Office plugin to convert Word 2007 (.docx) documents, you need to click Yes to install
the Visual C++ 2005 Redistributable prerequisite file and continue RasterMaster DLL
installation.
305
Appendix B - Software Installation
Directory Structure
The installation of RasterMaster DLL creates a new directory called C:\Program
Files\Snowbound\RM<version><type><product>. The example below is a version 18
DLL directory.
RM18DLL
Docs
Images
Marketing
Samples
C_Samples
MFC_Sample
MFC_TextSearch_TextExtract_Sample
Snippets
TextSearch
306
Appendix B - Software Installation
Installed Files
This section describes the files that are installed during the RasterMaster DLL installation. The
main installation directory is RM<Version><Product>DLL. For example, if you install the ver-
sion 18 DLL, the directory will be RM18DLL. There is also a Product Documentation, Product
Information, and Samples subdirectory.
The files installed into the main directory are defined in Table B-1.
Note:
If you have an evaluation copy of RasterMaster installed, please remove the
Aspose.Total.Product.Family.lic file when you install your purchased version with the
Office 2007-2010 option.
File Description
abicplug.dll ABIC plugin file for use.
Annlib.h Defines annotation functions.
Aspose.Cells.dll Aspose.Cells library file.
Aspose.Total.Product.Family.lic Aspose product license.
Aspose.Words.dll Aspose.Words library file.
docplug.dll MS Word plugin file.
dwgplg.dll DWG plugin file.
filters.h Defines file extensions.
HtmlHelper.dll HTML plugin file.
htmlplg.dll HTML plugin file.
icudt38.dll HTML plugin file.
Defines standard error codes
IMG_ERR.h
for the Snowbound library.
Used in an the application pro-
gram for defining the Snow-
Imglib.h
bound Library function
prototypes.
jb2plug.dll JBIG2 plugin file.
jp2plug.dll JPEG2 plugin file.
Glue layer for connecting lib-
Nt_glue.h rary to a Windows NT applic-
ation.
Open Office XML (OOXML) plu-
ooxmlplug.dll
gin file.
pclplug.dll PCL plugin file.
pdfplug.dll PDF plugin file.
307
Appendix B - Software Installation
File Description
snbdan32.dll Main Snowbound file.
snbdan32.lib Snowbound Extended library.
snbdcm.dll Main Snowbound file.
sndbcm.lib Snowbound library.
Defines the Snowbound wrap-
Snowbnd_Class.h
per class.
The files installed into the Docs directory are defined in Table B-2.
File Description
Aspose end user license agree-
Aspose_LicenseAgreement.pdf
ment.
Snowbound Software com-
install_instructions-component.pdf
ponent installation instructions.
Open source software license
Open Source Software Licenses Used With Certain Snow-
agreement bundled with Snow-
bound Products_2009.05.pdf
bound Software products.
Complete DLL programmers
RMDLLProgrammersGuide18.3.pdf
guide.
RMDLLReleaseNotes18.3.pdf DLL Release Notes.
The files installed into the Marketing directory are defined in Table B-3.
File Description
Provides an overview of Snow-
bound Software including com-
CompanyOverview.pdf
pany facts, products, and
formats.
Provides an overview of Snow-
RasterMasterOverview.pdf bound Software’s Raster-
Master products.
The samples directory contains four subdirectories that contain the RasterMaster DLL
samples: MFC_Sample and C_Samples.
The MFC_Sample directory is described in Table B-4. For more information, about each
sample, see Appendix C, RasterMaster DLL Samples.
308
Appendix B - Software Installation
Sample Description
Sample showing how to open,
save, and zoom images. See
MFC_Sample
MFC_Sample for more inform-
ation.
Sample showing how to search
and extract text from
MODCA:PTOCA and PDF
MFC_TextSearch_TextExtract_Sample
files. See MFC_TextSearch_
TextExtract_Sample for more
information.
Sample showing how to use the
command line to extract text
TextSearch from a MODCA:PTOCA and
PDF files. See Vector_Convert
for more information.
The C_Samples are described in Table B-5. For more information about each sample, see
Appendix C,RasterMaster DLL Samples.
Sample Description
Sample for merging in an alpha
alpha channel image. See Alpha for
more information.
Sample for animation test. See
animate
Animate for more information.
Sample showing how to use
Image Library to:
Decompress an image
309
Appendix B - Software Installation
Sample Description
low-level call-back for decom-
press. See Callback for more
information.
Sample showing how to use the
Snowbound Library for a trans-
encrypt parent decompress and display
using GIF images. See Encrypt
for more information.
Sample for a basic load and dis-
fit play of images. See Fit for more
information.
Sample for a basic load and dis-
load play of images. See Load for
more information.
Sample for displaying any page
page also use anti-aliasing if desired.
See Page for more information.
Sample for printing and status
print bar. See Print for more inform-
ation.
Sample for scanning images.
scan
See Scan for more information.
Sample for converting image
simpleformatconversion formats. See Format Con-
version for more information.
Sample for saving multi-page
images. See Multi-page Split-
simplemutlipagsplitting
ting and Saving for more inform-
ation.
Sample showing how to use
Snowbound Library for reading
tags
.TIF tags. See Tags for more
information.
Sample showing how to use
Snowbound Library for a trans-
transp parent decompress and display
using .GIF images. See Transp
for more information.
Sample showing how to use
Image Library to:
Decompress an image
zoom
Zoom into an area selected by
dragging a rectangle
310
Appendix B - Software Installation
Sample Description
Rotate to screen
311
Appendix C - RasterMaster DLL Samples
If you do not find the sample that you are looking for in this manual, please open a support ticket
at http://support.snowbound.com to request a specific sample. We are dedicated to helping our
customers succeed and we are constantly enhancing our products based on feedback from cus-
tomers like you.
Note:
If you are running one of the RasterMaster DLL samples described in this appendix on a
64-bit machine, select x64 as the Active Solution Platform under the Build > Con-
figuration Manager menu of Microsoft Visual Studio.
Alpha
Animate
Annotate
Aspect
Callback
Encrypt
Fit
Format Conversion
Load
MFC_Sample
MFC_TextSearch_TextExtract_Sample
OCR
Page
Scan
Tags
Transp
312
Appendix C - RasterMaster DLL Samples
Vector_Convert
Zoom
Alpha
This sample describes how to use the Snowbound Image Library to merge in an alpha channel
image. You can select Zoom In, Zoom Out, and Zoom Restore. You can rotate the image 90,
180, or 270 degrees. You can rotate the screen 0 or 180 degrees.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
Animate
This sample is an example of an animation test. It allows you to open and test animated GIF
files.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_animate() draws all frames of the animated GIF file passed to it.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
313
Appendix C - RasterMaster DLL Samples
Annotate
This sample demonstrates how to use the image library and the annotation library together.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.
See Chapter 28, Annotation and Redlining Toolkit for more information on the annotation library
functions used.
Aspect
This sample demonstrates how to use the Snowbound Image Library to accomplish the tasks
listed below.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
l Decompress an image
l Scroll through an image
l Rotate to screen
l Convert screen coordinates to images coordinates
l Use display with corrected aspect ratio
314
Appendix C - RasterMaster DLL Samples
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.
IMG_set_croprect_scroll() enables and disables the scroll bar and sets the cropping rectangle.
Callback
This sample demonstrates how to use the Snowbound Image Library for low-level callback for
decompress. Callback functions are useful for getting raw decompressed image data directly
from a file without using the library’s functions for displaying, printing, rotating, and more. For
more information see Chapter 4, Callback Routines.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
Encrypt
This sample demonstrates how to use the Snowbound Image Library for a transparent decom-
press and display using .GIF images. It allows you to open an image, input a transparency
color, and save it in a desired format.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
315
Appendix C - RasterMaster DLL Samples
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMGLOW_get_transp_color() gets the GIF image’s background color if the information is not
available in the header.
Fit
This sample is a basic load and display program. It allows you to open an image and display it
as fit-to-width or fit-to-height.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMG_display_fit_to_width() displays the full width of the image horizontally scaling to fit.
IMG_display_fit_to_height() displays the full height of the image vertically scaling to fit.
Format Conversion
This sample demonstrates a simple conversion. It takes the path to the image to convert and
the format name or integer value for the type of file format you want to output, then saves the
image as out.sbd into the current directory.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
316
Appendix C - RasterMaster DLL Samples
Load
This sample is a basic load and display program. It allows you to open and display an image.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
MFC_Sample
This sample demonstrates how to open, save, and zoom a file in the MFC framework. It allows
you to open multiple images. You can zoom in, zoom out, or zoom into an area selected by drag-
ging a rectangle of the image through the menu or buttons on the toolbar. This sample displays
a toolbar and a status bar. You can save the image in a desired format.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMGLOW_set_pdf_input( ) converts PDF files into a raster image when being decompressed
into RasterMaster products.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
317
Appendix C - RasterMaster DLL Samples
IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.
IMG_set_croprect_scroll() enables and disables the scroll bar and sets the cropping rectangle.
MFC_TextSearch_TextExtract_Sample
This sample demonstrates the use of IMGLOW_extract_text and IMGLOW_search_text
in the SnbdText_Extract_Search Class in MODCA:PTOCA and PDF files.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
Select Find > Find menu command and type in your search string. Click the Find All option to
highlight all text found for each page or click OK to find the first instance of your search string
from the page you are currently viewing.
The F3 key highlights the next found search text and loops to the beginning page when the last
page is reached. Also, with this option on if you go to the next page the first instance of the
search string will be highlighted regardless.
To deactivate the search, select Find > Find and click the Cancel button.
To extract the text, open a MODCA:PTOCA or PDF document and select File > Save Extrac-
ted Text.
IMGLOW_set_pdf_input() converts PDF files into a raster image when being decompressed
into RasterMaster products.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
318
Appendix C - RasterMaster DLL Samples
IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.
IMG_save_document() takes a buffer passed in with text, graphics, and position information
obtained from IMGLOW_extract_text() to create the document file output.
IMG_set_croprect_scroll() enables and disables the scroll bar and sets the cropping rectangle.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
OCR
This sample application demonstrates how to use Snowbound Rastermaster .NET in con-
junction with an OCR engine, in this case Google Tesseract, to extract text and/or numbers
from a certain region of interest on an image. Please look at main.cxx for compilation and build
notes.
The Google Tesseract OCR engine is obtained and installed separately from Google. You will
need to know the location where you installed Google Tesseract.
319
Appendix C - RasterMaster DLL Samples
1. The OCR data directory location containing the OCR data files (e.g. eng.word-dawg).
2. The full path name of a raster image file such as a TIFF file.
3. The page number of the page to be OCRed, from 0 to (last page -1). You have the source
code so you can adjust it to one-based if you wish.
4. A rectangular region of interest that defines where to look for text on the page. The region
of interest can be the whole page. However ,this may produce confusing output for multi-
column layout pages. The rectangle coordinates are specified in this order:
l x_crop: The left-most position of the zone of OCR interest on the page in
pixels
l y_crop: The top-most position of the zone of OCR interest on the page in
pixels
The extracted text from the page will be displayed to the console. It will make a second pass
and attempt to extract only the numeric text and output that to the console.
In debug mode it will also output a text file with the same name and location as the image input
file, in the following format: <input filename>.<page number>.txt.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® .NET Evaluation\Net\Sample.
320
Appendix C - RasterMaster DLL Samples
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
Page
This sample displays any page of an image. It allows you to open a TIFF, IOCA, PCX, or text
file. You can view the next page or previous page of the image. If desired, it can also use anti-ali-
asing. You can select anti-aliasing, Preserve Black, and Scale to Gray.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
Print
This sample demonstrates how to print an image and also how to use status bars. It allows you
to open and print an image.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_decompress_bitmap() frees up the library handle and removes the image from memory.
321
Appendix C - RasterMaster DLL Samples
IMG_save_document() takes a buffer passed in with text, graphics, and position information
obtained from IMGLOW_extract_text() to create the document file output.
IMGLOW_extract_text() extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel
files.
Scan
This sample demonstrates the scanning process. It allows you to select Scan Acquire, Scan
Feeder, Set Caps, and Show UI.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMG_scan_acquire_feeder() scans in the image from the feeder on the currently installed
device.
322
Appendix C - RasterMaster DLL Samples
Tags
This sample demonstrates how to use the Snowbound Image Library for reading TIF tags. It
allows you to open an image, input a transparency color, and save it in a desired format.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
IMGLOW_get_transp_color() gets the GIF image’s background color if the information is not
available in the header.
Transp
This sample demonstrates how to use the Snowbound Image Library for a transparent decom-
press and display using .GIF images. It allows you to open an image, input a transparency
color, and save it in a desired format.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
323
Appendix C - RasterMaster DLL Samples
IMGLOW_get_transp_color() gets the GIF image’s background color if the information is not
available in the header.
Vector_Convert
This sample uses the command line to extract text from a MODCA:PTOCA and/or AFP files. It
saves the text in vector format and writes out to a searchable PDF.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
Zoom
This sample demonstrates how to use the Snowbound Image Library to accomplish the tasks
listed below.
You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.
l Decompress an image
l Zoom in or out of an image
l Zoom into an area selected by dragging a rectangle
l Restore zoom
l Scroll through an image
l Rotate the image 90, 180, or 270 degrees
l Rotate the image 0, 90, 180, or 270 degrees to the screen
IMG_set_croprect_scroll() enables and disables the scroll bar and sets the cropping rectangle.
324
Appendix C - RasterMaster DLL Samples
IMG_delete_bitmap() frees up the library handle and removes the image from memory.
325
Appendix D - TIFF Tags
To call the TIFF tags in RasterMaster, use theIMGLOW_get_tiff_tag() function. This function
reads a TIFF tag from the file specified by bm_name. To set the TIFF tags in RasterMaster, use
the IMGLOW_set_tiff_tag() function. This function reads a TIFF tag from the file specified by
bm_name.This function writes new tags as well as all current tags.
The TIFF file format was created by an independent group and was supported by Aldus. .TIF
files can be any number of bits per pixel, planes and several compression algorithms. The byte
order may be Intel or Motorola format. The bytes may also be filled from right to left or left to
right. Compression may be uncompressed, pack bits, LZW, modified Huffman, CCITT G4,
CCITT G3, CCITT G3-2D or JPEG. The CCITT G4 file format only saves to black and white.
If you have any questions about the TIFF file format and the tags described below, you may con-
tact Snowbound Technical support on the web at http://support.snowbound.com .
TIFF Baseline: The baseline set of tags were documented in TIFF 5.0 and carried over on
pages 11-47 of the 1992 TIFF 6.0 specification.
TIFF Extended: The extended set includes some additional tags and added values for existing
tags, as documented on pages 48-115 of the TIFF 6.0 specification.
TIFF Private: Originally, the term private meant just that. The TIFF 6.0 specification (page 8)
states, “An organization might wish to store information meaningful to only that organization . . .
. Tags numbered 32768 or higher, sometimes called private tags, are reserved for that purpose.
Upon request, the TIFF administrator . . . will allocate and register one or more private tags for
an organization . . . . You do not need to tell the TIFF administrator what you plan to use them
for, but giving us this information may help other developers to avoid some duplication of effort.”
Over time, however, many private tags have become well established and well documented,
e.g., tag 34675 for the ICC profile, dubbed InterColorProfile in the TIFF/EP standard.
Thus, many members of the private tag class can be viewed as open extensions rather than as
containers for secret information.
TIFF/EP, TIFF/IT, and DNG: A number of tags, some of which may once have been private,
have been defined in TIFF/EP (ISO 12234-2, 2001), TIFF/IT (ISO 12639, 2004), and DNG_1_1,
an Adobe-sponsored extension of the TIFF 6.0 specification.
TIFF Private IFD: The TIFF 6.0 specification (page 9) states, “If you need more than 10 tags,
we suggest that you reserve a single private tag, define it as a LONG TIFF data type, and use
its value as a pointer (offset) to a private IFD [image file directory] or other data structure of your
326
Appendix D - TIFF Tags
choosing. Within that IFD, you can use whatever tags you want, since no one else will know
that it is an IFD unless you tell them.” As with private tags, we can understand private IFDs as
an extension to TIFF, often very public and well documented.
The private IFD tags of greatest interest to the Library of Congress are those associated with
the EXIF_2_2 specification, pertaining to image generation by digital still cameras. Exif is an
abbreviation for EXchangeable Image File format, although Exif does not relate to TIFF as, say,
JFIF relates to JPEG_DCT. The Exif IFD is pointed to by the Private Exif IFD tag 34665. This
and other Exif tags are listed in the numerical table below.
For the Exif specification and other related information, see Exif.org. There are actually three
private IFDs specified by the Exif standard. The other two are the GPS IFD, for positioning
information, and the Interoperability IFD, used to encode compability information. With numer-
ical sequences of their own, the GPS and interoperability tags are not included in the table
below.
HD Photo tags: Although not a true TIFF implementation, WMP_1_0 (originally called Win-
dows Media Photo) is a 2006 specification with a container format that borrows heavily from
TIFF and adds a few new tags of interest. Included in the table.
Code
Name Description Source of Tag
Dec Hex
A general indication of the kind of data that
is contained in this subfile. This field is
made up of a set of 32 flag bits. Unused bits
are expected to be 0. Bit 0 is the low-order
bit.
The default is 0.
A general indication of the kind of data that
is contained in this subfile.
327
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
1 = full resolution image data - ImageWidth,
ImageLength, and StripOffsets are required
fields.
The default is 1.
1 = No compression, but pack data into
bytes as tightly as possible, with no unused
bits except at the end of a row. The bytes
are stored as an array of bytes, for Bit-
sPerSample <= 8, word if BitsPerSample >
8 and <= 16, and dword if BitsPerSample >
16 and <= 32. The byte ordering of data >8
259 0103 Compression bits must be consistent with that specified Baseline
in the TIFF file header (bytes 0 and 1).
Rows are required to begin on byte bound-
aries.
328
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
only for bilevel images (like FAX images...)
329
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
imaged as white. 2**BitsPerSample-1 is
imaged as black. If GrayResponseCurve
exists, it overrides the Pho-
tometricInterpretation value.
330
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
and ImageWidth as the main image.
1 = a bilevel "line art" scan. BitsPerSample
must be 1.
3 = Error Diffused.
The width of the dithering or halftoning mat-
264 0108 CellWidth rix used to create a dithered or halftoned Baseline
bilevel file.
The length of the dithering or halftoning mat-
265 0109 CellLength rix used to create a dithered or halftoned Baseline
bilevel file.
266 010A FillOrder The logical order of bits within a byte. Baseline
The name of the document from which this
269 010D DocumentName Extended
image was scanned.
A string that describes the subject of the
ImageDe- image. For example, a user may wish to
270 010E Baseline
scription attach a comment such as "1988 company
picnic" to an image.
Manufacturer of the scanner, video digitizer.
271 010F Make Baseline
Mandatory for TIFF/EP.
The model name/number of the scanner,
video digitizer. This tag is intended for user
272 0110 Model information only so format is arbitrary. Baseline
331
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
the image, and the 0th column represents
the visual right hand side.
332
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
strip. The existenceof this field greatly sim-
plifies the chore of buffering compressed
data, if the strip size is reasonable.
280 0118 MinSampleValue The minimum component value used. Baseline
MaxSampleValu-
281 0119 The maximum component value used. Baseline
e
The number of pixels per ResolutionUnit in
282 011A XResolution the X direction, i.e., in the ImageWidth dir- Baseline
ection.
The number of pixels per ResolutionUnit in
283 011B YResolution the Y direction, i.e., in the ImageLength dir- Baseline
ection.
1 = The sample values for each pixel are
stored contiguously, so that there is a single
image plane. See PhotometricInterpretation
to determine the order of the samples within
the pixel data. So, for RGB data, the data is
stored RGBRGBRGB...and so on.
If SamplesPerPixel is 1, PlanarCon-
figuration is irrelevant, and should not be
included.
The default is 1.
The name of the page from which this image
285 011D PageName Extended
was scanned.
The X offset of the left side of the image,
286 011E XPosition with respect to the left side of the page, in Extended
ResolutionUnits.
The Y offset of the top of the image, with
287 011F YPosition respect to the top of the page, in Res- Extended
olutionUnits. In the TIFF oordinate scheme,
333
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
the positive Y direction is down, so that
YPosition is always positive.
For each string of contiguous unused bytes
288 0120 FreeOffsets Baseline
in a TIFF file, the byte offset of the string.
For each string of contiguous unused bytes
289 0121 FreeByteCounts in a TIFF file, the number of bytes in the Baseline
string.
The precision of the information contained in
the GrayResponseCurve.
1 - Image is uncompressed
334
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
This field is made up of a set of 32 flag bits
and is used for the images with fax group 4
compression. Unused bits are expected to
be 0. It is probably not safe to try to read the
file if any bit of this field is set that you don't
know the meaning of. Gray scale and color
coding schemes are under study, and will
be added when finalized.
Bit map:
0 - reserved (unused)
2-31 - reserved
To be used with XResolution and YRes-
olution.
2 = Inch.
3 = Centimeter.
The default is 2.
This tag is used to specify page numbers of
297 0129 PageNumber a multiple page (e.g. facsimile) document. Extended
335
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
Two word values are specified. The first
value is the page number; the second value
is the total number of pages in the doc-
ument. Note that pages need not appear in
numerical order. The first page is 0 (zero).
Describes a transfer function for the image
301 012D TransferFunction Extended
in tabular style.
Name and release number of the software
305 0131 Software package that created the image. User Baseline
information only.
Date and time of image creation. Uses the
format "YYYY:MM:DD HH:MM:SS", with
hours on a 24-hour clock, and one space
306 0132 DateTime Baseline
character between the date and the time.
The length of the string, including the null, is
20 bytes.
Person who created the image. Copyright
315 013B Artist Baseline
notice.
The computer and/or operating system in
316 013C HostComputer use at the time of image creation. Baseline
ENIAC.
A mathematical operator that is applied to
the image data before an encoding scheme
is applied.
2 = Horizontal differencing.
Gives TIFF color image readers a better
idea of what kind of color image it is. There
will be borderline cases.
336
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
containing a greatly restricted (usually less
than or equal to 256) range of colors. Col-
orImageType should be 2. See Col-
orImageType.
337
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
s
330 014A SubIFDs Offset to child IFDs. Extended
The set of inks used in a separated (Pho-
332 014C InkSet Extended
tometricInterpretation=5) image.
The name of each ink used in a separated
333 014D InkNames Extended
image.
334 014E NumberOfInks The number of inks. Extended
The component values that correspond to a
336 0150 DotRange Extended
0% dot and 100% dot.
A description of the printing environment for
337 0151 TargetPrinter Extended
which this separation is intended.
338 0152 ExtraSamples Description of extra components. Baseline
Specifies how to interpret each data sample
339 0153 SampleFormat Extended
in a pixel.
338
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
FaxProfile field.
Used in the TIFF-FX standard, denotes the
405 0195 ModeNumber mode of the standard specified by the Extended
FaxProfile field.
Used in the TIFF-F and TIFF-FX standards,
433 01B1 Decode holds information about the ITULAB (Pho- Extended
tometricInterpretation = 10) encoding.
Defined in the Mixed Raster Content part of
DefaultImageCo-
434 01B2 RFC 2301, is the default color needed in Extended
lor
areas where no image is available.
Old-style JPEG compression field.
512 0200 JPEGProc TechNote2 invalidates this part of the spe- Extended
cification.
Old-style JPEG compression field.
JPEGIn-
513 0201 TechNote2 invalidates this part of the spe- Extended
terchangeFormat
cification.
JPEGIn-
Old-style JPEG compression field.
ter-
514 0202 TechNote2 invalidates this part of the spe- Extended
changeFormatLe-
cification.
ngth
Old-style JPEG compression field.
JPEGRe-
515 0203 TechNote2 invalidates this part of the spe- Extended
startInterval
cification.
Old-style JPEG compression field.
JPEGLoss-
517 0205 TechNote2 invalidates this part of the spe- Extended
lessPredictors
cification.
Old-style JPEG compression field.
JPEGPointTrans-
518 0206 TechNote2 invalidates this part of the spe- Extended
forms
cification.
Old-style JPEG compression field.
519 0207 JPEGQTables TechNote2 invalidates this part of the spe- Extended
cification.
Old-style JPEG compression field.
520 0208 JPEGDCTables TechNote2 invalidates this part of the spe- Extended
cification.
Old-style JPEG compression field.
521 0209 JPEGACTables TechNote2 invalidates this part of the spe- Extended
cification.
The transformation from RGB to YCbCr
YCbCrCoef- image data.
529 0211 Extended
ficients
Mandatory for TIFF/EP YCbCr images.
Specifies the subsampling factors used for
YCbCrSubSamp-
530 0212 the chrominance components of a YCbCr Extended
ling
image.
339
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
Specifies the positioning of subsampled
YCbCrPos-
531 0213 chrominance components relative to lumin- Extended
itioning
ance samples.
Specifies a pair of headroom and footroom
Refer-
532 0214 image data values (codes) for each pixel Extended
enceBlackWhite
component.
Defined in the Mixed Raster Content part of
559 022F StripRowCounts RFC 2301, used to replace RowsPerStrip Extended
for IFDs with variable-sized strips.
700 02BC XMP XML packet containing XMP metadata Extended
327-
800D ImageID OPI-related. Extended
81
329- Annotation data, as used in 'Imaging for
80A4 Wang Annotation Private
32 Windows.
334- CFARepeatPat- For camera raw files from sensors with CFA TIFF/EP spec, p.
828D
21 ternDim overlay. 23
334- For camera raw files from sensors with CFA TIFF/EP spec, p.
828E CFAPattern
22 overlay. 23
334- Encodes camera battery level at time of TIFF/EP spec, p.
828F BatteryLevel
23 image capture. 45
334-
8298 Copyright Copyright notice. Baseline
32
Exif Private IFD
334-
829A ExposureTime Exposure time given in seconds. TIFF/EP spec, p.
34
38
Exif Private IFD
334-
829D FNumber The F number. TIFF/EP spec, p.
37
39
334- Specifies the pixel data format encoding in
82A5 MD FileTag Private
45 the Molecular Dynamics GEL file format.
334- Specifies a scale factor in the Molecular
82A6 MD ScalePixel Private
46 Dynamics GEL file format.
Used to specify the conversion from 16bit to
334-
82A7 MD ColorTable 8bit in the Molecular Dynamics GEL file Private
47
format.
Name of the lab that scanned this file, as
334-
82A8 MD LabName used in the Molecular Dynamics GEL file Private
48
format.
334- Information about the sample, as used in
82A9 MD SampleInfo Private
49 the Molecular Dynamics GEL file format.
334- Date the sample was prepared, as used in
82AA MD PrepDate Private
50 the Molecular Dynamics GEL file format.
334- 82AB MD PrepTime Time the sample was prepared, as used in Private
340
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
51 the Molecular Dynamics GEL file format.
334- Units for data in this file, as used in the
82AC MD FileUnits Private
52 Molecular Dynamics GEL file format.
335- ModelPixelScale- Used in interchangeable GeoTIFF_1_0
830E Private
50 Tag files.
IPTC-NAA (International Press Tele-
337- TIFF/EP spec, p.
83BB IPTC/NAA communications Council-Newspaper Asso-
23 33
ciation of America) metadata.
339- INGR Packet
847E Intergraph Application specific storage. Private
18 Data Tag
339- INGR Flag
847F Intergraph Application specific flags. Private
19 Registers
339- IrasB Trans- Originally part of Intergraph's GeoTIFF tags,
8480 Private
20 formation Matrix but likely understood by IrasB only.
Originally part of Intergraph's GeoTIFF tags,
339- ModelTiepointTa- but now used in interchangeable GeoTIFF_
8482 Private
22 g 1_0 files. In GeoTIFF_1_0, either this tag or
34264 must be defined, but not both
340-
Site Site where image created. TIFF/IT spec, 7.2.3
16
340- TIFF/IT spec,
ColorSequence Sequence of colors if other than CMYK.
17 7.2.8.3.2
340-
IT8Header Certain inherited headers. TIFF/IT spec, 7.2.3
18
340-
RasterPadding Type of raster padding used, if any. TIFF/IT spec, 7.2.6
19
340- Bit- Number of bits for short run length encod-
TIFF/IT spec, 7.2.6
20 sPerRunLength ing.
Bit-
340-
sPer- Number of bits for long run length encoding. TIFF/IT spec, 7.2.6
21
ExtendedRunLength
340- TIFF/IT spec,
ColorTable Color value in a color pallette.
22 7.2.8.4
340- ImageCo- Indicates if image (foreground) color or trans-
TIFF/IT spec, 7.2.9
23 lorIndicator parency is specified.
Back-
340-
groundCo- Background color specification. TIFF/IT spec, 7.2.9
24
lorIndicator
340- TIFF/IT spec,
ImageColorValue Specifies image (foreground) color.
25 7.2.8.4
Back-
340- TIFF/IT spec,
groundCo- Specifies background color.
26 7.2.8.4
lorValue
340- PixelIn- Specifies data values for 0 percent and 100 TIFF/IT spec,
341
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
27 tensityRange percent pixel intensity. 7.2.8.4
340- Trans- TIFF/IT spec,
Specifies if transparency is used in HC file.
28 parencyIndicator 7.2.8.4
Col-
340- Specifies ASCII table or other reference per TIFF/IT spec,
orChar-
29 ISO 12641 and ISO 12642. 7.2.8.4
acterization
340- Indicates the type of information in an HC
HCUsage TIFF/IT spec, 7.2.6
30 file.
340- Indicates whether or not trapping has been
TrapIndicator TIFF/IT spec, 7.2.6
31 applied to the file.
340- Specifies CMYK equivalent for specific sep- TIFF/IT spec,
CMYKEquivalent
32 arations. 7.2.8.3.4
340-
Reserved For future TIFF/IT use TIFF/IT spec
33
340-
Reserved For future TIFF/IT use TIFF/IT spec
34
340-
Reserved For future TIFF/IT use TIFF/IT spec
35
Used in interchangeable GeoTIFF_1_0
342- ModelTrans-
85D8 files. In GeoTIFF_1_0, either this tag or Private
64 formationTag
33922 must be defined, but not both
343- Collection of Photoshop 'Image Resource
8649 Photoshop Private
77 Blocks.
346-
8769 Exif IFD A pointer to the Exif IFD. Private
65
346- TIFF/EP spec, p.
8773 InterColorProfile ICC profile data.
75 47
Defined in the Mixed Raster Content part of
347- RFC 2301, used to denote the particular
87AC ImageLayer Extended
32 function of this Image in the mixed raster
scheme.
347- GeoKeyDir- Used in interchangeable GeoTIFF_1_0
87AF Private
35 ectoryTag files. Mandatory in GeoTIFF_1_0.
347- Used in interchangeable GeoTIFF_1_0
87B0 GeoDoublePara- Private
36 files.
msTag
347- GeoAs- Used in interchangeable GeoTIFF_1_0
87B1 Private
37 ciiParamsTag files.
The class of the program used by the cam- Exif Private IFD
348- Expos-
8822 era to set exposure when the picture is TIFF/EP spec, p.
50 ureProgram
taken. 41
348- Spec- Indicates the spectral sensitivity of each Exif Private IFD
8824
52 tralSensitivity channel of the camera used. TIFF/EP spec, p.
342
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
48
348- TIFF/EP spec, p.
8825 GPSInfo A pointer to the Exif-related GPS Info IFD.
53 34
Indicates the ISO Speed and ISO Latitude Exif Private IFD
348- ISOSpeedRat-
8827 of the camera or input device as specified in TIFF/EP spec, p.
55 ings
ISO 12232. 47
Exif Private IFD
348- Indicates the Opto-Electric Conversion
8828 OECF TIFF/EP spec, p.
56 Function (OECF) specified in ISO 14524.
48
348- Indicates the field number of multifield TIFF/EP spec, p.
8829 Interlace
57 images. 22
348- Encodes time zone of camera clock relative TIFF/EP spec, p.
882A TimeZoneOffset
58 to GMT. 38
348- Number of seconds image capture was TIFF/EP spec, p.
882B SelfTimeMode
59 delayed from button press. 45
349- HylaFAX
885C Used by HylaFAX. Private
08 FaxRecvParams
349- HylaFAX
885D Used by HylaFAX. Private
09 FaxSubAddress
349- HylaFAX
885E Used by HylaFAX. Private
10 FaxRecvTime
368- The version of the supported Exif standard.
9000 ExifVersion Exif Private IFD
64 Mandatory in the Exif IFD.
The date and time when the original image Exif Private IFD
368-
9003 DateTimeOriginal data was generated. Mandatory for TIFF/EP spec, p.
67
TIFF/EP. 37
368- DateTimeDi- The date and time when the image was
9004 Exif Private IFD
68 gitized stored as digital data.
Com- Specific to compressed data; specifies the
371-
9101 pon- channels and complements Pho- Exif Private IFD
21
entsConfiguration tometricInterpretation
Com- Exif Private IFD
371- Specific to compressed data; states the
9102 pressedBit- TIFF/EP spec, p.
22 compressed bits per pixel.
sPerPixel 27
Exif Private IFD
373- Shut-
9201 Shutter speed. TIFF/EP spec, p.
77 terSpeedValue
39
Exif Private IFD
373-
9202 ApertureValue The lens aperture. TIFF/EP spec, p.
78
39
373- 9203 BrightnessValue The value of brightness. Exif Private IFD
343
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
TIFF/EP spec, p.
79
40
Exif Private IFD
373- Expos-
9204 The exposure bias. TIFF/EP spec, p.
80 ureBiasValue
40
Exif Private IFD
373- MaxAper-
9205 The smallest F number of the lens. TIFF/EP spec, p.
81 tureValue
40
Exif Private IFD
373- The distance to the subject, given in
9206 SubjectDistance TIFF/EP spec, p.
82 meters.
44
Exif Private IFD
373-
9207 MeteringMode The metering mode. TIFF/EP spec, p.
83
41
Exif Private IFD
373-
9208 LightSource The kind of light source. TIFF/EP spec, p.
84
46
Exif Private IFD
373- Indicates the status of flash when the image
9209 Flash TIFF/EP spec, p.
85 was shot.
42
Exif Private IFD
373-
920A FocalLength The actual focal length of the lens, in mm. TIFF/EP spec, p.
86
44
373- TIFF/EP spec, p.
920B FlashEnergy Amount of flash energy (BCPS).
87 43
Spa-
373- TIFF/EP spec, p.
920C tialFre- SFR of the camera.
88 49
quencyResponse
373- TIFF/EP spec, p.
920D Noise Noise measurement values.
89 49
Number of pixels per FocalPlaneRes-
373- FocalPlaneXRes- TIFF/EP spec, p.
920E olutionUnit (37392) in ImageWidth direction
90 olution 18
for main image.
Number of pixels per FocalPlaneRes-
373- FocalPlaneYRes- TIFF/EP spec, p.
920F olutionUnit (37392) in ImageLength direction
91 olution 19
for main image.
Unit of measurement for FocalPlaneXRes-
373- FocalPlaneRes- TIFF/EP spec, p.
9210 olution(37390) and FocalPlaneYResolution
92 olutionUnit 19
(37391).
373- 9211 ImageNumber Number assigned to an image, e.g., in a TIFF/EP spec, p.
344
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
93 chained image burst. 32
373- Secur- Security classification assigned to the TIFF/EP spec, p.
9212
94 ityClassification image. 33
373- TIFF/EP spec, p.
9213 ImageHistory Record of what has been done to the image.
95 33
Exif Private IFD
373- Indicates the location and area of the main
9214 SubjectLocation TIFF/EP spec, p.
96 subject in the overall scene.
45
373- Encodes the camera exposure index setting TIFF/EP spec, p.
9215 ExposureIndex
97 when image was captured. 47
373- TIFF/EPStand- For current spec, tag value equals 1 0 0 0. TIFF/EP spec, p.
9216
98 ardID Mandatory in TIFF/EP. 16
345
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
image is captured, as measured in Beam
83
Candle Power Seconds
Records the camera or input device spatial
Spa- frequency table and SFR values in the dir-
414-
A20C tialFre- ection of image width, image height, and Exif Private IFD
84
quencyResponse diagonal direction, as specified in ISO
12233.
Indicates the number of pixels in the image
414- FocalPlaneXRes-
A20E width (X) direction per FocalPlaneRes- Exif Private IFD
86 olution
olutionUnit on the camera focal plane.
Indicates the number of pixels in the image
414- FocalPlaneYRes-
A20F height (Y) direction per FocalPlaneRes- Exif Private IFD
87 olution
olutionUnit on the camera focal plane.
Indicates the unit for measuring
414- FocalPlaneRes-
A210 FocalPlaneXResolution and Exif Private IFD
88 olutionUnit
FocalPlaneYResolution.
414- Indicates the location of the main subject in
A214 SubjectLocation Exif Private IFD
92 the scene.
Indicates the exposure index selected on
414-
A215 ExposureIndex the camera or input device at the time the Exif Private IFD
93
image is captured.
414- Indicates the image sensor type on the cam-
A217 SensingMethod Exif Private IFD
95 era or input device.
417-
A300 FileSource Indicates the image source. Exif Private IFD
28
417-
A301 SceneType Indicates the image source. Exif Private IFD
29
Indicates the color filter array (CFA) geo-
417-
A302 CFAPattern metric pattern of the image sensor when a Exif Private IFD
30
one-chip color area sensor is used.
Indicates the use of special processing on
419- Cus-
A401 image data, such as rendering geared to out- Exif Private IFD
85 tomRendered
put.
419- Indicates the exposure mode set when the
A402 ExposureMode Exif Private IFD
86 image was shot.
419- Indicates the white balance mode set when
A403 WhiteBalance Exif Private IFD
87 the image was shot.
419- Indicates the digital zoom ratio when the
A404 DigitalZoomRatio Exif Private IFD
88 image was shot.
419- Indicates the equivalent focal length assum-
A405 FocalLengthIn35- Exif Private IFD
89 ing a 35mm film camera, in mm.
mmFilm
419- SceneCap-
A406 Indicates the type of scene that was shot. Exif Private IFD
90 tureType
346
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
419- Indicates the degree of overall image gain
A407 GainControl Exif Private IFD
91 adjustment.
Indicates the direction of contrast pro-
419-
A408 Contrast cessing applied by the camera when the Exif Private IFD
92
image was shot.
Indicates the direction of saturation pro-
419-
A409 Saturation cessing applied by the camera when the Exif Private IFD
93
image was shot.
Indicates the direction of sharpness pro-
419-
A40A Sharpness cessing applied by the camera when the Exif Private IFD
94
image was shot.
This tag indicates information on the pic-
419- DeviceSet-
A40B ture-taking conditions of a particular camera Exif Private IFD
95 tingDescription
model.
Sub-
419-
A40C jectDistanceRan- Indicates the distance to the subject. Exif Private IFD
96
ge
420- Indicates an identifier assigned uniquely to
A420 ImageUniqueID Exif Private IFD
16 each image.
Used by the GDAL library, holds an XML list
421- GDAL_ of name=value 'metadata' values about the
A480 Private
12 METADATA image as a whole, and about specific
samples.
Used by the GDAL library, contains an
421-
A481 GDAL_NODATA ASCII encoded nodata or background pixel Private
13
value.
481- A 128-bit Globally Unique Identifier (GUID) HD Photo Feature
BC01 PixelFormat
29 that identifies the image pixel format. Spec, p. 17
Specifies the transformation to be applied
481- HD Photo Feature
BC02 Transformation when decoding the image to present the
30 Spec, p. 23
desired representation.
481- HD Photo Feature
BC03 Uncompressed Specifies that image data is uncompressed.
31 Spec, p. 23
481- Specifies the image type of each individual HD Photo Feature
BC04 ImageType
32 frame in a multi-frame file. Spec, p. 27
482- The image's width, in pixels (X:horizontal). HD Photo Feature
BC80 ImageWidth
56 The number of columns in the image. Spec, p. 21
482- Specifies the number of pixels or scan lines HD Photo Feature
BC81 ImageHeight
57 in the transformed photo. Spec, p. 21
482- Specifies the horizontal resolution of a trans-HD Photo Feature
BC82 WidthResolution
58 formed image expressed in pixels per inch. Spec, p. 21
482- Specifies the vertical resolution of a trans- HD Photo Feature
BC83 HeightResolution
59 formed image expressed in pixels per inch. Spec, p. 21
483- BCC0 ImageOffset Specifies the byte offset pointer to the begin-HD Photo Feature
347
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
ning of the photo data, relative to the begin-
20 Spec, p. 22
ning of the file.
483- HD Photo Feature
BCC1 ImageByteCount Specifies the size of the photo in bytes.
21 Spec, p. 22
Specifies the byte offset pointer the begin-
483- HD Photo Feature
BCC2 AlphaOffset ning of the planar alpha channel data, rel-
22 Spec, p. 22
ative to the beginning of the file.
483- Specifies the size of the alpha channel data HD Photo Feature
BCC3 AlphaByteCount
23 in bytes. Spec, p. 23
Signifies the level of data that has been dis-
483- ImageDataDis- carded from the image as a result of a com- HD Photo Feature
BCC4
24 card pressed domain transcode to reduce the file Spec, p. 25
size.
Signifies the level of data that has been dis-
483- AlphaDataDis- carded from the planar alpha channel as a HD Photo Feature
BCC5
25 card result of a compressed domain transcode to Spec, p. 26
reduce the file size.
481- Specifies the image type of each individual HD Photo Feature
BC04 ImageType
32 frame in a multi-frame file. Spec, p. 27
502- Oce Scanjob
C427 Used in the Oce scanning process. Private
15 Description
502- Oce Application
C428 Used in the Oce scanning process. Private
16 Selector
502- Oce Identification
C429 Used in the Oce scanning process. Private
17 Number
502- Oce ImageLogic
C42A Used in the Oce scanning process. Private
18 Characteristics
Encodes DNG four-tier version number; for
507-
C612 DNGVersion version 1.1.0.0, the tag contains the bytes DNG spec, p. 17
06
1, 1, 0, 0. Used in IFD 0 of DNG files.
Defines oldest version of spec with which
507- DNGBack-
C613 file is compatible. Used in IFD 0 of DNG DNG spec, p. 17
07 wardVersion
files.
507- UniqueCam- Unique, non-localized nbame for camera
C614 DNG spec, p. 18
08 eraModel model. Used in IFD 0 of DNG files.
Local-
507- Similar to 50708, with localized camera
C615 izedCam- DNG spec, p. 19
09 name. Used in IFD 0 of DNG files.
eraModel
Mapping between values in the CFAPattern
507- tag and the plane numbers in LinearRaw
C616 CFAPlaneColor space. Used in Raw IFD of DNG files. DNG spec, p. 19
10
Required for non-RGB CFA images.
507- Spatial layout of the CFA. Used in Raw IFD
C617 CFALayout DNG spec, p. 20
11 of DNG files.
348
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
507- Lin- Lookup table that maps stored values to lin-
C618 DNG spec, p. 20
12 earizationTable
ear values. Used in Raw IFD of DNG files.
507- Black- Repeat pattern size for BlackLevel tag.
C619 DNG spec, p. 21
13 LevelRepeatDimUsed in Raw IFD of DNG files.
507- Specifies the zero light encoding level.Used
C61A BlackLevel DNG spec, p. 21
14 in Raw IFD of DNG files.
Specifies the difference between zero light
507- Black- encoding level for each column and the
C61B DNG spec, p. 22
15 LevelDeltaH baseline zero light encoding level. Used in
Raw IFD of DNG files.
Specifies the difference between zero light
507- Black- encoding level for each row and the baseline
C61C DNG spec, p. 23
16 LevelDeltaV zero light encoding level. Used in Raw IFD
of DNG files.
Specifies the fully saturated encoding level
507-
C61D WhiteLevel for the raw sample values. Used in Raw DNG spec, p. 23
17
IFD of DNG files.
For cameras with non-square pixels, spe-
507- cifies the default scale factors for each dir-
C61E DefaultScale DNG spec, p. 24
18 ection to convert the image to square pixels.
Used in Raw IFD of DNG files.
Specifies the origin of the final image area,
507- DefaultCropOri- ignoring the extra pixels at edges used to
C61F DNG spec, p. 25
19 gin prevent interpolation artifacts. Used in Raw
IFD of DNG files.
Specifies size of final image area in raw
507-
C620 DefaultCropSize image coordinates. Used in Raw IFD of DNG spec, p. 25
20
DNG files.
Defines a transformation matrix that con-
verts XYZ values to reference camera nat-
507-
C621 ColorMatrix1 ive color space values, under the first DNG spec, p. 27
21
calibration illuminant. Used in IFD 0 of DNG
files.
Defines a transformation matrix that con-
verts XYZ values to reference camera nat-
507-
C622 ColorMatrix2 ive color space values, under the second DNG spec, p. 28
22
calibration illuminant. Used in IFD 0 of DNG
files.
Defines a calibration matrix that transforms
reference camera native space values to
507- Cam-
C623 individual camera native space values DNG spec, p. 28
23 eraCalibration1
under the first calibration illuminant. Used in
IFD 0 of DNG files.
507- Cam- Defines a calibration matrix that transforms DNG spec, p. 29
C624
24 eraCalibration2
349
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
reference camera native space values to
individual camera native space values
under the second calibration illuminant.
Used in IFD 0 of DNG files.
Defines a dimensionality reduction matrix
for use as the first stage in converting color
507- Reduc-
C625 camera native space values to XYZ values, DNG spec, p. 30
25 tionMatrix1
under the first calibration illuminant. Used in
IFD 0 of DNG files.
Defines a dimensionality reduction matrix
for use as the first stage in converting color
507- Reduc-
C626 camera native space values to XYZ values, DNG spec, p. 30
26 tionMatrix2
under the second calibration illuminant.
Used in IFD 0 of DNG files.
Pertaining to white balance, defines the
507- gain, either analog or digital, that has been
C627 AnalogBalance DNG spec, p. 31
27 applied to the stored raw values. Used in
IFD 0 of DNG files.
Specifies the selected white balance at the
507- time of capture, encoded as the coordinates
C628 AsShotNeutral DNG spec, p. 31
28 of a perfectly neutral color in linear reference
space values. Used in IFD 0 of DNG files.
Specifies the selected white balance at the
507- time of capture, encoded as x-y chro-
C629 AsShotWhiteXY DNG spec, p. 32
29 maticity coordinates. Used in IFD 0 of DNG
files.
Specifies in EV units how much to move the
507- BaselineEx-
C62A zero point for exposure compensation. DNG spec, p. 32
30 posure
Used in IFD 0 of DNG files.
Specifies the relative noise of the camera
507- model at a baseline ISO value of 100, com-
C62B BaselineNoise DNG spec, p. 33
31 pared to reference camera model. Used in
IFD 0 of DNG files.
Specifies the relative amount of sharpening
507- BaselineSharp- required for this camera model, compared to
C62C DNG spec, p. 33
32 ness reference camera model. Used in IFD 0 of
DNG files.
For CFA images, specifies, in arbitrary
units, how closely the values of the green
507-
C62D BayerGreenSplit pixels in the blue/green rows track the val- DNG spec, p. 34
33
ues of the green pixels in the red/green
rows. Used in Raw IFD of DNG files.
Lin- Specifies the fraction of the encoding range
507-
C62E earRe- above which the response may become sig- DNG spec, p. 34
34
sponseLimit nificantly non-linear. Used in IFD 0 of DNG
350
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
files.
507- Cam- Serial number of camera. Used in IFD 0 of
C62F DNG spec, p. 35
35 eraSerialNumber DNG files.
507- Information about the lens. Used in IFD 0 of
C630 LensInfo DNG spec, p. 35
36 DNG files.
Normally for non-CFA images, provides a
507- Chro-
C631 hint about how much chroma blur ought to DNG spec, p. 36
37 maBlurRadius
be applied. Used in Raw IFD of DNG files.
Provides a hint about the strength of the
507-
C632 AntiAliasStrength camera's anti-aliasing filter. Used in Raw DNG spec, p. 36
38
IFD of DNG files.
Used by Adobe Camera Raw to control
507-
ShadowScale sensitivity of its shadows slider. Used in DNG spec, p. 38
39
IFD 0 of DNG files.
Provides a way for camera manufacturers
507- to store private data in DNG files for use by
C634 DNGPrivateData DNG spec, p. 37
40 their own raw convertors. Used in IFD 0 of
DNG files.
Lets the DNG reader know whether the Exif
507- Maker-
C635 MakerNote tag is safe to preserve. Used in DNG spec, p. 38
41 NoteSafety
IFD 0 of DNG files.
Cal-
507- Illuminant used for first set of calibration
C65A ibra- DNG spec, p. 26
78 tags. Used in IFD 0 of DNG files.
tionIlluminant1
Cal-
507- Illuminant used for second set of calibration
C65B ibra- DNG spec, p. 26
79 tags. Used in IFD 0 of DNG files.
tionIlluminant2
Specifies the amount by which the values of
507- the DefaultScale tag need to be multiplied to
C65C BestQualityScale DNG spec, p. 24
80 achieve best quality image size. Used in
Raw IFD of DNG files.
Contains a 16-byte unique identifier for the
507- RawDataU-
raw image file in the DNG file. Used in IFD DNG spec, p. 39
81 niqueID
0 of DNG files.
507- Alias Layer Alias Sketchbook Pro layer usage descrip-
C660 Private
84 Metadata tion.
Ori- Name of original file if the DNG file results
508-
gin- from conversion from a non-DNG raw file. DNG spec, p. 39
27
alRawFileName Used in IFD 0 of DNG files.
Ori- If the DNG file was converted from a non-
508-
gin- DNG raw file, then this tag contains the ori- DNG spec, p. 40
28
alRawFileData ginal raw data. Used in IFD 0 of DNG files.
508- Defines the active (non-masked) pixels of
ActiveArea DNG spec, p. 41
29 the sensor. Used in Raw IFD of DNG files.
351
Appendix D - TIFF Tags
Code
Name Description Source of Tag
Dec Hex
List of non-overlapping rectangle coordin-
ates of fully masked pixels, which can
508-
MaskedAreas optimally be used by DNG readers to meas- DNG spec, p. 42
30
ure the black encoding level. Used in Raw
IFD of DNG files.
Contains ICC profile that, in conjunction
with the AsShotPreProfileMatrix tag, spe-
508- AsShotICCPro- cifies a default color rendering from camera
DNG spec, p. 42
31 file color space coordinates (linear reference
values) into the ICC profile connection
space. Used in IFD 0 of DNG files.
Specifies a matrix that should be applied to
the camera color space coordinates before
508- AsShotPrePro-
processing the values through the ICC pro- DNG spec, p. 43
32 fileMatrix
file specified in the AsShotICCProfile tag.
Used in IFD 0 of DNG files.
The CurrentICCProfile and Cur-
rentPreProfileMatrix tags have the same
purpose and usage as the AsShotICCPro-
508- Cur-
file and AsShotPreProfileMatrix tag pair, DNG spec, p. 44
33 rentICCProfile
except they are for use by raw file editors
rather than camera manufacturers. Used in
IFD 0 of DNG files.
The CurrentICCProfile and Cur-
rentPreProfileMatrix tags have the same
Cur- purpose and usage as the AsShotICCPro-
508-
rentPrePro- file and AsShotPreProfileMatrix tag pair, DNG spec, p. 44
34
fileMatrix except they are for use by raw file editors
rather than camera manufacturers. Used in
IFD 0 of DNG files.
1Content for base and extended tags used by permission of the author, Max Maischein.
352
Appendix E - Snowbound Error Codes
353
Appendix E - Snowbound Error Codes
354
Appendix E - Snowbound Error Codes
355
Appendix E - Snowbound Error Codes
Error Description
The image in memory cannot
DELETE_ERROR
be removed.
Any problems with displaying
DISPLAY_ERROR an image will return this error
code.
No image data is available to
IMAGE_NOT_AVAILABLE
do manipulations on.
This is returned if a parameter
NOT_VALID
passed into an API is not valid.
This is returned if an API
SNOWBND_API_NOT_AVAILABLE method is not implemented in
the current build.
General API error code of an
SNOWBND_ERROR
unsuccessful action.
356
Appendix E - Snowbound Error Codes
Error Description
General API status of a suc-
SNOWBND_OK
cessful action.
This is returned when a Critical
SYSTEM_CRASH
Exception is thrown.
357
Appendix F - Troubleshooting
Appendix F - Troubleshooting
This appendix describes solutions to issues that you may run across when installing and using
RasterMaster DLL.
l Use the following function prior to decompression to reduce the output dots per inch
(DPI) or bit depth. Please see Chapter 16, Low Level Functions for more detailed inform-
ation.
l Use one of the following color reduction functions to reduce 8-bit and 24-bit images to
smaller gray scale images. Please see Chapter 12, High Level Functions , Chapter 21,
358
Appendix F - Troubleshooting
Image-Processing Functions and Chapter 22, Bit Depth Conversion Functions for more
detailed information.
IMG_color_gray(int hdib) converts 24-bit color images to 8-bit gray scale images.
Please see IMG_color_gray() for more information.
IMG_resize_to_gray(int imghandle, int hres, int vres) resizes a 1-bit black and
white image to a (smaller) 8-bit grayscale image. Please see IMG_resize_to_gray()
for more information.
If this is a simple bitmap format such as TIFF, you can try adjusting the sharpening, contrast
and brightness. To improve the quality of a 1-bit file format document, first convert it to gray
scale using IMG_promote_8().
If the source image or document is vector or it is composed of text and drawing commands
such as PDF, Word, or AFP, you can set the conversion to be 1-bit or increase the dots per inch
using IMGLOW_set_document_input(Dpi, bits_pix). Please see IMGLOW_set_document_
input() for more information.
Please note that a higher resolution will almost always yield a better quality conversion but will
probably result in a larger output file size.
Also it is common to convert to TIFF_G4. This is a 1-bit per pixel format. Make sure that if you
are converting from a color image, that it is mostly text. There will be a noticeable loss in quality
for pictures or color graphics such as logos when converting a color image to a 1-bit per pixel
format. Text will usually work well.
If your document requires color, then try saving to a color output format such as TIFF_Packbits,
TIFF_ JPEG or TIFF_LZW.
The output quality of your output document may be much lower than the original document if
you convert a high quality image to a low quality output such as TIFF_G4_FAX. Please see the
following suggestions to improve the quality of the output document:
Choose a different output format such as TIFF_LZW to produce an output document with suf-
ficient pixel depth. Appendix A, Supported File Formats shows a list of file formats and their
supported bit depths.
359
Appendix F - Troubleshooting
l Use the following function prior to decompression to reduce the output dots per inch
(DPI) or bit depth. Please see Chapter 16, Low Level Functions for more detailed inform-
ation.
l Use the color promotion function, IMG_promote_24(), to promote 1-bit, 4-bit and 8-bit
images to 24-bit images. Please see Chapter 14, Image Management Functions for
more detailed information.
Improving Performance
The more colors there are in the input or output image, the bigger the file and the slower the pro-
cessing speed. To reduce the number of colors and improve performance, reduce the bit depth
(bits per pixel) value to grayscale (8-bit) or black and white (1-bit).
l Use one of the following color reduction functions to reduce 8-bit and 24-bit images to
smaller gray scale images. Please see Chapter 12, High Level Functions, Chapter 21,
Image-Processing Functions, and Chapter 22, Bit Depth Conversion Functions for more
detailed information.
IMG_color_gray(int hdib) converts 24-bit color images to 8-bit gray scale images.
Please see IMG_color_gray() for more information.
IMG_resize_to_gray(int imghandle, int hres, int vres) resizes a 1-bit black and
white image to a (smaller) 8-bit grayscale image. Please see IMG_resize_to_gray()
for more information.
Please note that there is always a trade off between performance and quality. To improve per-
formance, the quality of the image may be less. This is true whenever working with any imaging
software.
360
Appendix F - Troubleshooting
l To improve performance in RasterMaster, consider the input file type. To reduce the res-
olution, reduce the DPI value. If the input file is not a raster image, such as PCL, vector
PDF, Word or Excel, use the following function to set the DPI and bit depth prior to
decompression. Please see Chapter 16, Low-Level Functions for more detailed inform-
ation.
Some PDF document generators do not properly specify all of the information needed in a doc-
ument. To resolve this issue in PDF documents that are generated by custom applications,
open the document in Adobe Acrobat and then save it. You should then be able to process the
newly saved document in RasterMaster.
361
Appendix F - Troubleshooting
This issue typically occurs when the file in question is converted at 1-bit black and white or 8-bit
grayscale, rather than 24-bit color. By default, RasterMaster will often choose 1 bit/pixel to
ensure better performance during conversion. Formats which are converted to 1-bit by default
include AFP, DOC, XLS, and PCL. For these formats, we recommend that you call the
IMGLOW_set_document_input() method prior to decompression if you wish to convert to TIFF_
JPEG. Please see the following example:
status = s.IMGLOW_set_document_input(200, 24, Defines.DOC)
status = s.IMG_decompress_bitmap("C:\\input\\file.doc", page);
status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)
In the above example, the input DPI and bit-depth are set to 200 and 24 respectively for the
input DOC file before being converted to TIFF_JPEG.
Please also note that while color input images (e.g. JPEG, TIFF, PNG) will be converted to 24
bits/pixel by default, you still might see this issue for black and white or grayscale input images.
In the case where your input file is a black and white or grayscale image, you can promote the
bit-depth to 24 by calling IMG_promote_24() after decompression. Please see the following
example:
status = s.IMG_decompress_bitmap("C:\\input\\file.png", page);
status = s.IMG_promote_24();
status = s.IMG_save_bitmap("C:\\output\\file.tif", Defines.TIFF_JPEG)
This should produce an output TIFF that can be viewed by most third party image viewers.
If you have a mix of monochrome and color pages that you are converting and saving to another
format, then you may want to use IMGLOW_detect_color() to identify black and white pages
that can safely be converted to a higher performance 1-bit deep format. The color pages should
362
Appendix F - Troubleshooting
be converted to an output format that supports color, such as JPEG. Please see Appendix A,
Supported File Formats for details on which formats support color information at different bit-
depths.
363
Index: -1 error code – -43 error code
364
Index: -44 error code – ASCIIPAGEHEIGHT
365
Index: ASCIIPAGEWIDTH – CANT_CREATE_FILE error code
ASCIITABSTOP 126
B
ASCIITYPEFACE 126
BAD_DISPLAY_AREA error
ASCIIWEIGHT 126 code 353
366
Index: CANT_FIND_TWAIN_DLL error code – Encrypt
367
Index: EPS – error code
368
Index: error during conversion – error code
BAD_LICENSE_ GENERAL_STATUS.DELETE_
369
Index: error during conversion – error code
STATUS.SNOWBND_ OOXML_LICENSE_
OK 356 EXPIRED 355
GENERAL_STATUS.SYSTEM_ OOXML_LICENSE_NOT_
CRASH 356 FOUND 355
370
Index: error during conversion – GENERAL_STATUS.SNOWBND_ERROR
installing 301 G
filename GENERAL_STATUS.NOT_VALID
error code 356
OOXML license file 180-181
GENERAL_STATUS.SNOWBND_
filename extension 361
API_NOT_AVAILABLE error
FileNet 287 code 356
files GENERAL_STATUS.SNOWBND_
ERROR 356
redistributed 301
371
Index: GENERAL_STATUS.SNOWBND_OK error code – IMG_animate
GENERAL_STATUS.SNOWBND_
H
OK error code 356
halftone
GENERAL_STATUS.SYSTEM_
CRASH error code 356 remove 187
GlobalLock() 145
I
GX2 288 ICO 288
372
Index: IMG_antique_effect – IMG_display_fit_to_width
IMG_antique_effect 61 IMG_decompress_bitmap_page 72
IMG_auto_orient 62 IMG_decompress_tiled_bitmap 74
IMG_autocrop_bitmap 61 IMG_delete_bitmap_keep 76
IMG_create_handle_keep 67 IMG_display_bitmap 77
IMG_create_handle_shell 68 IMG_display_bitmap_aspect 78
IMG_decompress_bitmap 69 IMG_display_bitmap_iac 80
IMG_decompress_bitmap IMG_display_bitmap_transp 81
(java.awt.Image, int) 238, 362
IMG_display_ddb 82
IMG_decompress_bitmap_display 70
IMG_display_ddb_effect 101
IMG_decompress_bitmap_fd 71
IMG_display_fit_to_height 195
IMG_decompress_bitmap_mem 71
IMG_display_fit_to_width 196
373
Index: IMG_erase_rect – IMG_save_bitmap_mem
374
Index: IMG_save_document – IMGLOW_get_fileinfo
IMG_scan_pages_fast 96 IMGLOW_decompress_bitmap_
mem 134
IMG_scan_set_cap 97
IMGLOW_detect_blank_page Func-
IMG_scan_set_caps 92
tion 186
IMG_scan_setup 98
IMGLOW_detect_color 135, 238, 362
IMG_scroll_bitmap 244
IMGLOW_extract_text 137
IMG_set_croprect 113
IMGLOW_extract_text_mem 139, 231
IMG_set_croprect_scroll 253
IMGLOW_get_anim_delay 139
IMG_set_display_angle 115
IMGLOW_get_ascii_attributes 128
IMG_set_encrypt 89
IMGLOW_get_ascii_page 128
IMG_set_gamma 206
IMGLOW_get_auto_detect 209
IMG_set_lut 207
IMGLOW_get_bitmap_header 140
IMG_set_statusbar 116
IMGLOW_get_bitmap_name 140
IMG_sharpen_bitmap 207
IMGLOW_get_custstring 141
IMG_thresh_mono 226
IMGLOW_get_display_rect 141
IMG_unload_lib 90
IMGLOW_get_fileinfo 120
375
Index: IMGLOW_get_fileinfo_fd – IMGLOW_set_document_input
376
Index: IMGLOW_set_document_page_size – IMGLOW_set_wipedelay
IMGLOW_set_document_page_ IMGLOW_set_jpeg2000_comp_
size 157 ratio 158
IMGLOW_set_html_javascript_cap- IMGLOW_set_ooxml_license_path
ability 172 Function 181
377
Index: IMGLOW_unset_auto_detect – MO
IMGLOW_unset_auto_detect 216
K
IMGLOW_write_tiff_stream 165
KOFAX 289
IMNET 288
L
input
large documents
color page 238, 362
printing 48
input compatible with output 57
LASER_DATA 289
input quality 57
LINE_DATA 289
Installation Process 300
Load 317
Installed Files 300
location
invert
OOXML license file 180
color 185
lossy compression 58
IOCA 288
low output quality 57
isImageEnabled 170
isJavascriptEnabled 170 M
MAG 289
J
METHOD_NOT_FOUND error
jb2plug.dll 307
code 355
JBIG 288
MFC_Sample 317
JEDMICS 289
MFC_TextSearch_TextExtract_
jp2plug.dll 307 Sample 318
JPEG2000 289 MO
378
Index: MODCA resource – ODS
NOT_A_TILED_IMAGE error
N
code 354
NCR 290
NOT_SUPPORTED_IN_THIS_
NO_ABIC_VERSION error code 355
VERSION error code 354
NO_BITMAP_FOUND error code 353
NOT_VALID error code 356
NO_CLIPBOARD_IMAGE error
Nt_glue.h 307
code 354
NO_DELAY_TIME_FOUND error O
ODS 290
379
Index: ODT – pdfplug.dll
ODT 290
P
Office 238, 362
Page 321
OOXML 290
PAGE_NOT_FOUND error code 353
OOXML files
palette 57, 202-203, 250
set absolute path 181-182
PALETTE_IMAGES_NOT_
OOXML license file ALLOWED error code 354
380
Index: performance – SANN_create_ann
performance RasterMaster
PIXEL_DEPTH_ remove
UNSUPPORTED 57, 284
halftone 187
PIXEL_DEPTH_UNSUPPORTED
hole punch 188
error code 354
resolution 56
pixels
return
percentage 186
orientation of image 183
PNG 293
Rich Text Format 293
PowerPoint 238, 362
rotate
PPT 293
image 184
PPTX 293
RTF 293
Print 321
Printing S
SANN_choose_line_style 265
R
SANN_choose_line_width 266
RAST 293
SANN_create_ann 266
381
Index: SANN_deactivate_all_objects – Snowbound ASCII
382
Index: Snowbound Error Codes – USING_RUNTIME error code
TIFF_G4_FAX_STRIP 294 U
383
Index: variables – XWindows-specific
XWindows-specific 241
V
variables
IMG_auto_orient 183
IMGLOW_set_ooxml_license_
path 181
VectorExtract 324
version
get 104
WBMP 295
WINFAX 295
WMF 295
WPG 295
XBM 295
Xerox_EPS 296
XLSX 296
XPM 296
XWD 296
XWindows 241
384