Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

RMDLLProgrammersGuide PDF

Download as pdf or txt
Download as pdf or txt
You are on page 1of 384

RasterMaster® SDK

Dynamic Link Library (DLL), Windows and UNIX V18.4


Programmer’s Reference Guide

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

Version 18.4 Additions and Improvements 35

New Features 35

Chapter 2 - Quick Start 37

Quickly Getting Started with the Format Conversion Sample 37

Viewing Samples Packaged with the Library 38

Reading and Displaying Images 39

Reading Images 39

Displaying an Image 40

Return Values and Error Codes 40

System Overview 41

Chapter 3 - Saving and Reading Multi-page Images 44

Multi-page Images 44

Supported Multi-page Formats 44

Decompressing a Multi-page Image 44

Determining Multi-page Page Count 44

Saving Multi-page File Formats 45

Multi-page Format Functions 45

Chapter 4 - Callback Routines 46

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

Printing Large Documents 48

Servers 48

Clients 48

Solution 48

Chapter 6 - Displaying and Saving Transparent Images 49

Transparency Overview 49

Displaying Transparent Images 49

Changing Transparent Color 49

Saving a Modified Image 50

Chapter 7 - Aspect Ratio Correction Functions 51

Aspect Ratio Correction Functions 51

Chapter 8 - RasterMaster Library 52

Changing the DPI in the RasterMaster Library 52

Chapter 9 - Display Quality 53

Achieving the Best Display Quality 53

24-Bit Images Displayed on a 256 Color Adapter 53

Bi-Level and 1-Bit Per Pixel Images 53

Chapter 10 - Image Compression 55

Preferred Formats 55

iv
24-Bit Color Images 55

8-Bit Gray Scale Images 55

1-bit Bi-Level Images 55

Chapter 11 - File Format Conversion 56

Converting File Formats 56

Automatically Detecting File Formats 56

Input Document Quality: Resolution/DPI 56

Input Document Quality: Color/bit-depth/Pixel Depth 57

Making Sure Input is Compatible with Output 57

Getting a Pixel_Depth_Unsupported Error 57

Adjusting Low Output Quality 57

Chapter 12 - High Level Functions 59

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

Chapter 13 - Scanning Functions 92

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

Chapter 14 - Image Management Functions 100

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

Chapter 15 - ASCII Formats and Functions 125

ASCII Attribute Structure 125

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

Chapter 16 - Low Level Functions 130

IMGLOW_autocolor() 131

IMGLOW_decompress_bitmap() 132

put_dib_data Callback Routines For IMGLOW_decompress_bitmap 133

set_header Callback Routine For IMGLOW_decompress_bitmap 133

IMGLOW_decompress_bitmap_mem() 134

put_dib_data Callback Routine For IMGLOW_decompress_bitmap_mem 134

set_header Callback Routine For IMGLOW_decompress_bitmap_mem 135

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

get_dib_data Callback Routine For IMGLOW_save_bitmap 150

IMGLOW_save_bitmap_mem() 150

get_dib_data Callback Routine For IMGLOW_save_bitmap_mem 151

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

Supported File Types 165

Chapter 17 - DWG and DXF Functions 167

IMGLOW_set_cad_background() 167

IMGLOW_set_cad_input() 167

IMGLOW_set_cad_size() 168

Chapter 18 - HTML Functions 169

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

Chapter 19 - Open Office 2007 XML (OOXML) Functions 178

IMGLOW_set_ooxml_license() 178

IMGLOW_ooxml_license_enable() 178

IMGLOW_set_ooxml_licenseW() 179

Previous Word 2007 Open Office XML (OOXML) Functions 180

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

Chapter 20 - DocClean Functions 183

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

Chapter 21 - Image Processing Functions 190

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

Chapter 22 - Bit Depth Conversion Functions 218

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

Chapter 23 - Document Conversion and Text Extraction 229

Document Conversion and Text Extraction Overview 229

IMGLOW_extract_text() 229

IMGLOW_extract_text_mem() 231

IMG_save_document() 232

IMG_save_document_mem() 235

Chapter 24 - AFP Font Mapping Functions 237

AFP Font Mapping 237

Format of Font Mapping Data 237

Color Documents Rendered as Black and White 238

IMGLOW_set_fontmap_path() 238

IMGLOW_set_fontmap() 239

Chapter 25 - Standard UNIX and XWindows Specific Functions 241

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

Chapter 26 - Macintosh High Level and Image Management Functions 249

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

Chapter 27 - Format for Decompressed Images 257

Overview of Data Formats 257

RasterMaster Plus Options 257

MS_Windows DIB Header Format 258

MS_Windows DIB Palette Format 259

MS_Windows DIB Image Data Format 259

Chapter 28 - Annotation and Redlining Toolkit 260

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

Annotation Constants 279

Chapter 29 - Working with PDF and Other Document File Formats 281

Working with Document File Formats 281

Saving 282

Reading and Writing Support for PDF File Formats 282

Reading or Decompressing a PDF Document 283

Saving to a PDF Document 283

xviii
Working with Black and White Images 283

Working with Color Images 283

Changing Output Page Size 283

Performance 283

Appendix A - Supported File Formats 284

Descriptions of Supported File Formats 284

File Type Constants Listed by File Type Number 296

Appendix B - Software Installation 300

Overview of the Installation Process 300

Redistributing Snowbound Files 301

What to Expect When Installing an Evaluation Version 301

What to Expect in a Production Version 301

Installing the Production Version of RasterMaster DLL 301

Installing the Software 302

Directory Structure 306

Installed Files 307

Main Directory Files 307

Docs Directory Files 308

Marketing Directory Files 308

Sample Directory Files 308

Appendix C - RasterMaster DLL Samples 312

Alpha 313

Animate 313

Annotate 314

xix
Aspect 314

Callback 315

Encrypt 315

Fit 316

Format Conversion 316

Load 317

MFC_Sample 317

MFC_TextSearch_TextExtract_Sample 318

Multi-page Splitting and Saving 319

OCR 319

Page 321

Print 321

Save Searchable PDF 322

Scan 322

Tags 323

Transp 323

Vector_Convert 324

Zoom 324

Appendix D - TIFF Tags 326

Sources for Tag Specifications 326

Descriptions of Tags in Numerical Order 327

Appendix E - Snowbound Error Codes 353

Detailed Status/Error Codes 353

General Error Define Values Retrieved from Status Property 356

xx
General Status/Error Codes 356

Appendix F - Troubleshooting 358

Receiving an Error Code When Loading, Saving, or Converting a Document 358

Output Document Differs from Original Document 358

Output Document Has Much Larger File Size than the Original Document 358

Output Document Has Much Lower Quality than the Original Document 359

Output Document Displays Incorrect or Missing Characters 360

Improving Performance 360

Identifying an Unknown File Format 361

Receiving a -3 Corrupted File Error code 361

Overlay Resources Not Pulled into APF or MODCA Document 361

Searching for Text in a Snowbound Software Generated PDF 361

Some TIFF_JPEG Files Produced By RasterMaster Do Not Open In Third Party


Image Viewers 362

Color Documents Rendered as Black and White 362

xxi
List of Tables

Table 2.1: RasterMaster DLL MFC_Sample Directory 38

Table 2.2: RasterMaster DLL C_Samples Directory 38

Table 2.3: Memory Requirements Based on Image Size 43

Table 3.1: Supported Multi-page Functions 45

Table 7.1: Aspect Ratio Function Descriptions 51

Table 12.1: IMG_animate Function Variables 60

Table 12.2: IMG_antique_effect Function Variable 61

Table 12.3: IMG_autocrop_bitmap Function Variables 62

Table 12.4: IMG_bitmap_info Function Variables 63

Table 12.5: IMG_bitmap_palette Function Variables 65

Table 12.6: IMG_color_combine Function Variables 65

Table 12.7: IMG_color_separate Function Variables 66

Table 12.8: IMG_color_gray Function Variable 67

Table 12.9: IMG_create_handle Function Variable 67

Table 12.10: IMG_create_handle_keep Function Variable 68

Table 12.11: IMG_create_handle_shell Function Variable 68

Table 12.12: IMG_decompress_bitmap Function Variable 69

Table 12.13: IMG_decompress_bitmap_display Function Variables 70

Table 12.14: IMG_decompress_bitmap_fd Function Variables 71

Table 12.15: IMG_decompress_bitmap_mem Function Variables 72

Table 12.16: IMG_decompress_bitmap_page Function Variables 73

Table 12.17: IMG_decompress_fax Function Variables 73

Table 12.18: IMG_decompress_fax_mem Function Variables 74

xxii
Table 12.19: IMG_decompress_tiled_bitmap Function Variables 75

Table 12.20: IMG_delete_bitmap Function Variable 76

Table 12.21: IMG_delete_bitmap_keep Function Variable 77

Table 12.22: IMG_dib_to_ddb Function Variables 77

Table 12.23: IMG_display_bitmap Function Variables 78

Table 12.24: IMG_display_bitmap_aspect Variables 79

Table 12.25: IMG_display_bitmap_dti Function Variables 80

Table 12.26: IMG_display_bitmap_iac Function Variables 81

Table 12.27: IMG_display_bitmap_transp Function Variables 82

Table 12.28: IMG_display_ddb Function Variables 82

Table 12.29: IMG_erase_rect Function Variables 83

Table 12.30: IMG_print_bitmap Function Variables 84

Table 12.31: IMG_print_bitmap_fast Function Variables 85

Table 12.32: IMG_remove_red_eye Function Variables 86

Table 12.33: IMG_save_bitmap Function Variables 87

Table 12.34: IMG_save_bitmap_fd Function Variables 88

Table 12.35: IMG_save_bitmap_mem Function Variables 89

Table 12.36: IMG_set_encrypt Function Variables 89

Table 13.1: IMG_scan_acquire Function Variables 93

Table 13.2: IMG_scan_acquire_feeder Function Variables 94

Table 13.3: IMG_scan_acquire_feeder_fast Function Variables 94

Table 13.4: IMG_scan_open_source Function Variable 95

Table 13.5: IMG_scan_pages Function Variables 96

Table 13.6: IMG_scan_page_fast Function Variables 96

xxiii
Table 13.7: IMG_scan_get_cap Function Variables 97

Table 13.8: IMG_scan_set_cap Function Variables 98

Table 13.9: IMG_scan_set_caps Function Variable 98

Table 13.10: IMG_scan_setup Function Variable 99

Table 14.1: IMG_create_handle_ddb Function Variables  101

Table 14.2: IMG_display_ddb_effect Function Variables 101

Table 14.3: IMG_get_bitmap_palette Function Variable 102

Table 14.4: IMG_get_croprect Function Variables  103

Table 14.5: IMG_ifl_version Function Variables 104

Table 14.6: IMG_ifl_version_ext Function Variables 105

Table 14.7: IMG_merge_bitmap Function Variables 105

Table 14.8: IMG_merge_bitmap_alpha Function Variables 107

Table 14.9: IMG_merge_bitmap_handle Function Variables 108

Table 14.10: IMG_promote_8 Function Variable 109

Table 14.11: IMG_promote_24 Function Variable 109

Table 14.12: IMG_promote_32 Function Variable 110

Table 14.13: IMG_repaint_scroll Function Variables 111

Table 14.14: IMG_scroll_bitmap Function Variables 113

Table 14.15: IMG_set_croprect Function Variables 113

Table 14.16: IMG_set_croprect_scroll Function Variables 115

Table 14.17: IMG_set_display_angle Function Variables 115

Table 14.18: IMG_set_statusbar Function Variables 116

Table 14.19: IMG_zoom_bitmap Function Variables 117

Table 14.20: IMG_zoom_bitmap_rect Function Variables 118

xxiv
Table 14.21: IMG_zoom_bitmap_1_to_1 Function Variables 118

Table 14.22: IMGLOW_map_image_to_wnd Function Variables 119

Table 14.23: IMGLOW_map_wnd_to_image Function Variables 120

Table 14.24: IMGLOW_get_fileinfo Function Variables 120

Table 14.25: IMGLOW_get_fileinfo_page Function Variables 121

Table 14.26: IMGLOW_set_rop Function Variables 121

Table 14.27: IMGLOW_set_fileio Function Variables 123

Table 14.28: IMGLOW_set_wipedelay Function Variable 123

Table 15.1: ASCIITEXTATTR Function Flags 126

Table 15.2: IMG_import_ascii Function Variables 127

Table 15.3: IMG_RECT Function Variables 127

Table 15.4: IMGLOW_get_ascii_attributes Function Variable 128

Table 15.5: IMGLOW_get_ascii_page_width Function Variable 128

Table 15.6: IMGLOW_set_ascii_attributes Function Variable 129

Table 16.1: IMGLOW_autocolor Function Variable 132

Table 16.2: IMGLOW_decompress_bitmap Function Variables 132

Table 16.3: put_dib_data Callback Routine Variables  133

Table 16.4: set_header Callback Routine Variables 133

Table 16.5: IMGLOW_decompress_bitmap_mem Function Variables  134

Table 16.6: put_dib_data Callback Routine Variables 135

Table 16.7: set_header Callback Routine Variables 135

Table 16.8: IMGLOW_extract_text Function Variables 137

Table 16.9: Extracted Text Variables 138

Table 16.10: IMGLOW_extract_text_mem Function Variables 139

xxv
Table 16.11: IMGLOW_get_anim_delay Function Variable 139

Table 16.12: IMGLOW_get_bitmap_header Function Variables 140

Table 16.13: IMGLOW_get_bitmap_name Function Variables 140

Table 16.14: IMGLOW_get_custstring Function Variable 141

Table 16.15: IMGLOW_get_display_rect Function Variables 141

Table 16.16: IMGLOW_get_filetype Function Variable 142

Table 16.17: IMGLOW_get_filetype_fd Function Variable 143

Table 16.18: IMGLOW_get_image_orientation Function Variable 143

Table 16.19: IMGLOW_get_image_orientation_page Function Variables 143

Table 16.20: IMGLOW_get_pages Function Variable 144

Table 16.21: IMGLOW_get_pages_fd Function Variable 145

Table 16.22: IMGLOW_get_pages_mem Function Variable 145

Table 16.23: IMGLOW_get_tiff_tag Function Variables 146

Table 16.24: IMGLOW_get_tiff_tag_page Function Variables 147

Table 16.25: IMGLOW_get_tile_info Function Variables 147

Table 16.26: IMGLOW_get_transp_color Function Variable 148

Table 16.27: IMGLOW_save_bitmap Function Variables 149

Table 16.28: get_dib_data Callback Routine Variables 150

Table 16.29: IMGLOW_save_bitmap_mem Function Variables 150

Table 16.30: get_dib_data Callback Routine Variables 151

Table 16.31: IMGLOW_search_text Function Variables 152

Table 16.32: IMGLOW_set_alias Function Variable 153

Table 16.33: IMGLOW_set_alias_img Function Variables 154

Table 16.34: IMGLOW_set_bitmap_name Function Variables 154

xxvi
Table 16.35: IMGLOW_set_comp_quality Function Variable 155

Table 16.36: IMGLOW_set_dispfunc Function Variable 155

Table 16.37: IMGLOW_set_document_input Function Variable 156

Table 16.38: IMGLOW_set_document_page_size Function Variable 157

Table 16.39: IMGLOW_set_image_orientation Function Variable 158

Table 16.40: IMGLOW_set_jpeg_decompression Function Variable 158

Table 16.41: W_set_jpeg2000_comp_ratio Function Variable 159

Table 16.42: IMGLOW_set_jpg_interleave Function Variables 159

Table 16.43: IMGLOW_set_msg_render_preferences Function Variables 160

Table 16.44: IMGLOW_set_pdf_input Function Variables 161

Table 16.45: IMGLOW_set_pdf_output Function Variables 162

Table 16.46: IMGLOW_set_pdf_password Function Variables 162

Table 16.47: IMGLOW_set_tiff_save_strips Function Variable 163

Table 16.48: IMGLOW_set_tiff_tag Function Variables 164

Table 16.49: IMGLOW_set_transp_color Function Variables 164

Table 16.50: IMGLOW_write_tiff_stream Function Variables 165

Table 17.1: IMGLOW_set_cad_background Function Variables 167

Table 17.2: IMGLOW_set_cad_input Function Variables 167

Table 17.3: IMGLOW_set_cad_size Function Variables 168

Table 18.1: IMGLOW_set_html_capabilities Function Variables  170

Table 18.2: IMGLOW_set_html_home_dir Function Variables 170

Table 18.3: IMGLOW_set_html_image_capability Function Variables 171

Table 18.4: IMGLOW_set_html_input Function Variables 171

Table 18.5: IMGLOW_set_html_javascript_capability Function Variables 172

xxvii
Table 18.6: IMGLOW_set_html_page_size Function Variables 173

Table 18.7: IMGLOW_set_html_page_size_ratio Function Variables 173

Table 18.8: IMGLOW_set_html_page_size_ratio_capability Function Variables 174

Table 18.9: IMGLOW_set_html_screen_dpi Function Variables 174

Table 18.10: IMGLOW_set_html_use_page_breaks_exclusively Function Variables 175

Table 18.11: IMGLOW_set_html_utf_bom Function Variables 175

Table 18.12: Representations of byte order marks by encoding 176

Table 19.1: IMGLOW_set_ooxml_license Function Variable 178

Table 19.2: IMGLOW_ooxml_license_enable  Function Variable 179

Table 19.3: IMGLOW_set_ooxml_licenseW Function Variable 179

Table 19.4: IMGLOW_get_ooxml_license_location Function Variable 180

Table 19.5: IMGLOW_set_ooxml_license_filename Function Variables 181

Table 19.6: IMGLOW_set_ooxml_license_filenameW Function Variables 181

Table 19.7: IMGLOW_set_ooxml_license_path function variable descriptions. 181

Table 19.8: IMGLOW_set_ooxml_license_pathW Function Variables 182

Table 20.1: IMG_auto_orient Function Variables 183

Table 20.2: IMG_deskew_bitmap Function Variables 184

Table 20.3: IMG_despeckle_bitmap Function Variables 185

Table 20.4: IMGLOW_auto_invert Function Variable 185

Table 20.5: IMGLOW_detect_blank_page Function Variable 186

Table 20.6: IMGLOW_remove_halftone Function Variable 187

Table 20.7: IMGLOW_remove_holepunch Function Variable 188

Table 21.1: IMG_apply_profile Function Variables 191

Table 21.2: IMG_apply_profile Modes 191

xxviii
Table 21.3: IMG_cmyk_to_rgb Function Variable 192

Table 21.4: IMG_create_thumbnail Function Variables 193

Table 21.5: IMG_deskew_bitmap Function Variables 193

Table 21.6: IMG_despeckle_bitmap Function Variable 194

Table 21.7: IMG_display_fit_to_height Function Variables 195

Table 21.8: IMG_display_fit_to_width Function Variables 196

Table 21.9: IMG_flip_bitmapx Function Variable 197

Table 21.10: IMG_flip_bitmapy Function Variable 197

Table 21.11: IMG_get_deskew_angle Function Variables 198

Table 21.12: IMG_get_profile Function Variables 199

Table 21.13: IMG_histogram_equalize Function Variable 199

Table 21.14: IMG_invert_bitmap Function Variable 200

Table 21.15: IMG_process_bitmap Function Variables 200

Table 21.16: IMG_resize_bitmap Function Variables 202

Table 21.17: IMG_resize_bitmap_bicubic Function Variables 202

Table 21.18: IMG_resize_bitmap_interp Function Variables 203

Table 21.19: IMG_resize_to_gray Function Variables 204

Table 21.20: IMG_rgb_to_cmyk Function Variable 204

Table 21.21: IMG_rotate_bitmap Function Variables 205

Table 21.22: IMG_set_gamma Function Variables 206

Table 21.23: IMG_set_lut Function Variables 207

Table 21.24: IMG_sharpen_bitmap Function Variables 207

Table 21.25: IMG_window_level Function Variables 208

Table 21.26: IMGLOW_get_auto_detect Function Variable 209

xxix
Table 21.27: IMGLOW_get_fileinfo_fd Function Variables 209

Table 21.28: IMGLOW_get_palette Function Variables 210

Table 21.29: IMGLOW_put_palette Function Variables 211

Table 21.30: IMGLOW_read_pixel Function Variables 211

Table 21.31: IMGLOW_set_auto_detect Function Variable 212

Table 21.32: IMGLOW_set_decompsize Function Variables 212

Table 21.33: IMGLOW_set_decomp_rect Function Variables 213

Table 21.34: IMGLOW_set_decomp_reduction Function Variable 213

Table 21.35: IMGLOW_set_dithermode Function Variable 214

Table 21.36: IMGLOW_set_fast_convert Function Variables 215

Table 21.37: IMGLOW_set_imnet_page_size Function Variables 215

Table 21.38: IMGLOW_set_pcl_input Function Variables 216

Table 21.39: IMGLOW_unset_auto_detect Function Variable 216

Table 22.1: IMG_bayer_color Function Variable 218

Table 22.2: IMG_bayer_mono Function Variable 219

Table 22.3: IMG_color_gray Function Variable 220

Table 22.4: IMG_dib_to_runs Function Variable 220

Table 22.5: IMG_diffusion_color Function Variable 221

Table 22.6: IMG_diffusion_mono Function Variable 222

Table 22.7: IMG_halftone_mono Function Variable 222

Table 22.8: IMG_mediancut_color Function Variable 223

Table 22.9: IMG_octree_color Function Variables 224

Table 22.10: IMG_popularity_color Function Variable 224

Table 22.11: IMG_runs_to_dib Function Variable 225

xxx
Table 22.12: IMG_thresh_mono Function Variables 226

Table 22.13: IMGLOW_get_filetype_mem Function Variable 226

Table 22.14: IMGLOW_get_raster Function Variables 227

Table 22.15: IMGLOW_put_raster Function Variables 227

Table 22.16: IMGLOW_set_alias_quality Function Variable 228

Table 23.1: IMGLOW_extract_text Function Variables 230

Table 23.2: Extracted Text Variables 231

Table 23.3: IMGLOW_extract_text_mem Function Variables 232

Table 23.4: IMG_save_document Function Variables 232

Table 23.5: IMG_save_document_mem Function Variables 236

Table 24.1: Description of a sample entry in the snbd_map.fnt file 238

Table 24.2: IMGLOW_set_fontmap_path Function Variables  239

Table 24.3: IMGLOW_set_fontmap Function Variables 239

Table 25.1: IMG_global_set_Xdisplay Function Variable 242

Table 25.2: IMG_global_set_Xscreen Function Variable 242

Table 25.3: IMG_global_set_Xreserverd_colors Function Variable 243

Table 25.4: IMG_repaint_scroll Function Variables  244

Table 25.5: IMG_scroll_bitmap Function Variables 245

Table 25.6: IMG_zoom_bitmap Function Variables 246

Table 25.7: IMG_zoom_bitmap_1_to_1 Function Variables 247

Table 25.8: IMG_zoom_bitmap_rect Function Variables 248

Table 26.1: IMG_dib_to_GWorld Function Variables 249

Table 26.2: IMG_dib_to_GWorld_bitDepth Function Variable 250

Table 26.3: IMG_GWorld_to_dib Function Variables 251

xxxi
Table 26.4: IMG_display_bitmap_aspect Variables 251

Table 26.5: IMG_repaint_scroll Function Variables 252

Table 26.6: IMG_scroll_bitmap Function Variables 253

Table 26.7: IMG_set_croprect_scroll Function Variables 254

Table 26.8: IMG_zoom_bitmap Function Variables 255

Table 26.9: IMG_zoom_bitmap_rect Function Variables 255

Table 26.10: IMG_zoom_bitmap_1_to_1 Function Variables 256

Table 28.1: ANN_GRAPHIC_STRUCT Class Variables 262

Table 28.2: SANN_activate_all_objects Function Variable 263

Table 28.3: SANN_activate_object Function Variables 264

Table 28.4: SANN_add_object Function Variables 264

Table 28.5: SANN_choose_color Function Variable 265

Table 28.6: SANN_choose_font Function Variable 265

Table 28.7: SANN_choose_line_style Function Variable 265

Table 28.8: SANN_choose_line_width Function Variable 266

Table 28.9: SANN_create_ann Function Variables 266

Table 28.10: SANN_deactivate_all_objects Function Variable 267

Table 28.11: SANN_deactivate_object Function Variables 267

Table 28.12: SANN_delete_all_objects Function Variable 267

Table 28.13: SANN_delete_object Function Variables 268

Table 28.14: SANN_display_annotations Function Variables 268

Table 28.15: SANN_draw_object Function Variables 269

Table 28.16: SANN_get_croprect Function Variables 269

Table 28.17: SANN_get_object_bounds Function Variables 270

xxxii
Table 28.18: SANN_get_object_data Function Variables 270

Table 28.19: SANN_get_object_info Function Variables 271

Table 28.20: SANN_get_object_num Function Variables 271

Table 28.21: SANN_highlight_object Function Variables 271

Table 28.22: SANN_map_image_to_wnd Function Variables 272

Table 28.23: SANN_map_wnd_to_image Function Variables 272

Table 28.24: SANN_merge_ann Function Variables 273

Table 28.25: SANN_mouse Function Variables 273

Table 28.26: SANN_move_object Function Variables 274

Table 28.27: SANN_print_annotations Function Variables 274

Table 28.28: SANN_read_ann Function Variables 275

Table 28.29: SANN_resize_object Function Variables 275

Table 28.30: SANN_rotate Function Variables 275

Table 28.31: SANN_set_bcolor Function Variables 276

Table 28.32: SANN_set_croprect Function Variables 276

Table 28.33: SANN_delete_flag Function Variable 277

Table 28.34: SANN_set_fcolor Function Variables 277

Table 28.35: SANN_set_font Function Variables 277

Table 28.36: SANN_set_line_style Function Variables 278

Table 28.37: SANN_set_line_width Function Variables 278

Table 28.38: SANN_set_size Function Variables 279

Table 28.39: SANN_write_ann Function Variables 279

Table 28.40: Annotation Constants 279

Table 29.1: IMGLOW_set_document_input Function Variable 282

xxxiii
Table 29.2: IMGLOW_set_pdf_output Function Variables 282

Table A.1: File Format Key 284

Table A.2: Supported File Format Descriptions 285

Table A.3: File Type Constants listed by File Type Number 296

Table B.1: RasterMaster DLL Default Directory Files 307

Table B.2: RasterMaster DLL Imaging SDK Docs Directory Files 308

Table B.3: RasterMaster DLL Marketing Directory Files 308

Table B.4: RasterMaster DLL MFC_Sample Directory 309

Table B.5: RasterMaster DLL Imaging SDK C_Samples Directory 309

Table D.1: TIFF Tags in Numerical Order1 327

Table E.1: Error Codes 353

Table E.2: General Error Define Values Retrieved from Status Property 356

Table E.3: General Status/Error Codes 356

xxxiv
Chapter 1 - Additions and Improvements

Chapter 1 - Additions and Improvements


This chapter describes the latest additions and improvements to the software.

Version 18.4 Additions and Improvements


The following are some of the new features and formats added to Version 18.4 of the Raster-
Master DLL and library.

New Features
The following are the new features added to Version 18.4 of the product:

Simplified Aspose License Function

l Added the IMGLOW_ooxml_license_enable(char* licensePath, int nPathLength) func-


tion to simplify Aspose licensing by setting the license path. This function searches for
the license files that match the pre-defined names, and then returns the directory in
which the license is found. The enable license function only needs to be called once to
cover all formats such as DOCX, XLSX and PPTX. If the license is not found or is not
valid, one of the following OOXML error codes is returned:

l OOXML_LICENSE_NOT_FOUND (-52) error message - returned when no


license file is found.

l OOXML_LICENSE_EXPIRED (-53) error message - returned when the license


file is found but invalid.

Setting the Page Size of Excel Documents

l Added the IMGLOW_set_document_page_size(double height, double width, int format)


method to set the document’s page size. Currently, this method only supports .xls and
.xlsx files.

Getting the Version Number for All Four Digits

l Added the IMG_ifl_version_ext(int *major, int *minor, *update, *fix) method to return the
version number to all four digits.

PDF Portfolio Package Support

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

l Multiple enhancements and bug fixes to the Word file format.

l Multiple enhancements and bug fixes to the PDF file format.

l Multiple enhancements and bug fixes to the PCL file format.

36
Chapter 2 - Quick Start

Chapter 2 - Quick Start


This chapter describes how to quickly start decompressing and displaying images using the
RasterMaster DLL.

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.

Quickly Getting Started with the Format Conversion


Sample
The fastest way to get started is to run the Format Conversion sample that is included with this
product. You can find the samples in the following directory C:\Program Files\Snow-
bound Software\RasterMaster® DLL Evaluation\DLL\Samples. The Format Con-
version sample will convert any supported document type into the file format you request and
then display it. For more information, please see Appendix C, RasterMaster DLL Samples on
how to find and run the Format Conversion sample.

The Format Conversion sample uses three routines that are at the heart of RasterMaster:

1. IMG_decompress_bitmap() - reads in a document in any format and converts it to a valid


Snowbound image.

2. IMG_display_bitmap() - displays a valid Snowbound image.

3. IMG_save_bitmap() - saves the valid Snowbound image to any available format.

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 .

Viewing Samples Packaged with the Library


To run a sample, open any of the samples described below in your development environment
such as Visual Studio.

Sample Directory Files

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.

Table 2.1: RasterMaster DLL MFC_Sample Directory

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.

Table 2.2: RasterMaster DLL C_Samples Directory

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

aspect Scroll through an image

Rotate to screen and Rotate to screen

Convert screen coordinates to images coordinates

38
Chapter 2 - Quick Start

Sample Description
Use display with corrected aspect ratio

See Aspect for more information.


Sample showing how to use Snowbound Image Library
callback for low-level call-back for decompress. See Callback for
more information.
Sample showing how to use the Snowbound Library for a
encrypt transparent decompress and display using GIF images.
See Encrypt for more information.
Sample for a basic load and display of images. See Fit
fit
for more information.
Sample for a basic load and display of images. See Load
load
for more information.
Sample for displaying any page also use anti-aliasing if
page
desired. See Page for more information.
Sample for printing and status bar. See Print for more
print
information.
Sample for scanning images. See Scan for more inform-
scan
ation.
Sample for converting image formats. See Format Con-
simpleformatconversion
version for more information.
Sample for saving multi-page images. See Multi-page
simplemutlipagsplitting
Splitting and Saving for more information.
Sample showing how to use Snowbound Library for read-
tags
ing .TIF tags. See Tags for more information.
Sample showing how to use Snowbound Library for a
transp transparent decompress and display using .GIF images.
See Transp for more information.
Sample showing how to use Image Library to:

Decompress an image

Zoom into an area selected by dragging a rectangle


zoom
Scroll through an image

Rotate to screen

See Zoom for more information.

Reading and Displaying Images


The following section describes how to read and display images, and remove images from
memory.

Reading Images

To read an image use the function below.

39
Chapter 2 - Quick Start

Syntax

int SNBDAPI IMG_decompress_bitmap(char *filename);

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.

See IMG_decompress_bitmap() for more information on reading an image.

Displaying an Image

To display an image use the function below.

Syntax

int SNBDAPI IMG_display_bitmap(int imghandle, IMGPORT hdc, int


xpos, int ypos, int width, int height);

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.

See IMG_display_bitmap_aspect() for more information on automatic aspect ratio correction.

See IMG_display_bitmap() for more information on displaying an image.

Removing Images from Memory

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

int SNBDAPI IMG_delete_bitmap(int imghandle);

See IMG_delete_bitmap() for more information on removing an image from memory.

Return Values and Error Codes


Snowbound file handles start with zero (0). The handle is simply an integer value to reference
the image.

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.

Determining System Requirements

System requirements to run RasterMaster DLL include:

l Supported Operating Systems:

l Microsoft Windows XP (32 and 64 bit)

l Microsoft Windows Server 2003

l Microsoft Windows Server 2008

l Microsoft Windows 7 (32 and 64 bit)

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

l Native Language of Library

l 32-bit code for all operating systems

l 64-bit code for 64 bit Windows OS

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 compressed to uncompressed document formats (lossy com-


pression to raw image data).

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).

Determining Memory Requirements

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:

(height_in_pixels * width_in_pixels * bits_per_pixel)/ 8 = image_size_in_bytes

Table 2.3: Memory Requirements Based on Image Size

Image Size Required Memory


24-bit per pixel, 640 x 480
640 * 480 * (24 / 8) = 921600 bytes
image
1-bit per pixel, 8.5" x 11" image,
at 300 dpi (2550 pixels by 3300 2550 * 3300 * (1 / 8) = 1051875 bytes
pixels)
24-bit per pixel, 8.5" x 11"
image, at 300 dpi (2550 pixels 2550 * 3300 * (24 / 8) = 25245000 bytes (25 megabytes)
by 3300 pixels)

43
Chapter 3 - Saving and Reading Multi-page Images

Chapter 3 - Saving and Reading Multi-page


Images
This chapter describes how to decompress, determine page counts, save, and convert multi-
page images in the RasterMaster DLL.

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.

Supported Multi-page Formats


RasterMaster DLL currently supports the following multi-page formats:

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

Decompressing a Multi-page Image


Each page must be decompressed then saved separately. In other words, a decompress then
save must be performed for each page.

Determining Multi-page Page Count


You can keep decompressing pages until a PAGE NOT FOUND or -11 error is returned from
the decompress function or method, or you can query the number of pages with the IMGLOW_
get_pages function. See IMGLOW_get_pages() for more information.

44
Chapter 3 - Saving and Reading Multi-page Images

Saving Multi-page File Formats


When saving to a multi-page file format, keep in mind that all RasterMaster products append or
add new pages to an image file if the file already exists. If you do not want to keep saving to the
same file, you must first delete the page or save each page to a unique file name. See the multi-
page sample Multi-page Splitting and Saving for more information.

Multi-page Format Functions


Table 3.1: Supported Multi-page Functions

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 an existing file, new pages are appended.

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.

See IMG_save_bitmap() for more information on these func-


tions.

45
Chapter 4 - Callback Routines

Chapter 4 - Callback Routines


This chapter describes how to use callback routines within the RasterMaster DLL.

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

int SNBDAPI IMGLOW_decompress_bitmap(int fd, unsigned long offset,


int page, PUTDIBDATACB put_dib_data, void FAR *private_data,
PUTHEADERCB set_header);

See IMGLOW_decompress_bitmap() for more information on decompressing images.

Saving Images
Use IMGLOW_save_bitmap() to save an image.

Syntax

int SNBDAPI IMGLOW_save_bitmap(int fd, LPDIBHEADER lpbih, int type,


GETDIBDATACB get_dib_data, void *private_data);

See IMGLOW_save_bitmap() for more information on saving images.

46
Chapter 5 - Printing Images

Chapter 5 - Printing Images


This chapter describes how to print images using the RasterMaster DLL.

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()

See IMG_print_bitmap() for more information on normal printing.

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

Printing Large Documents


Printing large documents, such as documents approaching or exceeding 100 pages, or doc-
uments set to a resolution of 300 DPI or above, requires additional memory resources. These
additional resource requirements can affect the performance of both servers and clients.

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

Chapter 6 - Displaying and Saving Trans-


parent Images
This chapter describes how to display and save transparent images using RasterMaster DLL.

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.

Transparency is currently supported for the GIF file format.

Displaying Transparent Images


To display a transparent image:

1. Get a valid image handle such as:

     imghandle = IMG_decompress_bitmap(filename);

2. Get the transparent color using:

     backcolor = IMGLOW_get_transp_color(imghandle);

3. Display the image as you would normally, but send in the transparent color with the state-
ment:

     IMG_display_bitmap_transp (imghandle, hdc, xpos, ypos, width,


height, backcolor);

Note:
If the image does not contain transparent color information, you may receive the error
code NO_TCOLOR_FOUND

See IMG_decompress_bitmap(), IMGLOW_get_transp_color(), and IMG_display_bitmap_


transp() for more information on displaying transparent images.

Changing Transparent Color


To change the transparent color of an image, call the function below.
backcolor = IMGLOW_set_transp_color(int imghandle, int color);

49
Chapter 6 - Displaying and Saving Transparent Images

See IMGLOW_set_transp_color() for more information on changing the transparent color of an


image.

Saving a Modified Image


To save a modified image, call the function below.
IMG_save_bitmap(int imghandle, "out.gif", GIF);

See IMG_save_bitmap() for more information on saving a modified image.

50
Chapter 7 - Aspect Ratio Correction Functions

Chapter 7 - Aspect Ratio Correction Func-


tions
This chapter describes the functions used for aspect ratio correction within the RasterMaster
DLL.

Aspect Ratio Correction Functions


Table 7.1: Aspect Ratio Function Descriptions

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.

The return value is the current zoom factor. See IMG_set_


croprect_scroll() for more information.

51
Chapter 8 - RasterMaster Library

Chapter 8 - RasterMaster Library


This chapter describes how to change the DPI in the RasterMaster DLL library.

Changing the DPI in the RasterMaster Library


When the library decompresses an image, it is converted into an MS-Windows device inde-
pendent bitmap, which contains a header for the width, height, and also the dots per inch.

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:

Example 8.1: Changing the DPI

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

Chapter 9 - Display Quality


This chapter describes how to achieve the best display quality for an image using RasterMaster
DLL.

Achieving the Best Display Quality


Achieving the best display quality of any image depends on the type of image being viewed.

24-Bit Images Displayed on a 256 Color Adapter


To achieve the best display quality for 24-bit images displayed on a 256 color adapter, the
default behavior is to convert the image at display time to 256 colors using a simple bayer mat-
rix dither. You can change this to a better quality diffusion dithering by using the following call:
IMGLOW_set_dithermode();

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.

See IMGLOW_set_dithermode() and IMG_octree_color() for more information on displaying 24-


bit images.

Bi-Level and 1-Bit Per Pixel Images


To achieve the best display quality for bi-level or 1-bit per pixel images, set the IMGLOW_set_
alias() function to:

l 2 for scale to gray

l 1 for preserve black

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

Chapter 10 - Image Compression


This chapter describes how to select the best compression for an image using the Raster-
Master DLL.

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.

24-Bit Color Images


For 24-bit color images, use the JPEG format in RasterMaster DLL for the best conversion res-
ults.

8-Bit Gray Scale Images


For 8-bit gray scale images, use the JPEG format in RasterMaster DLL for the best conversion
results.

1-bit Bi-Level Images


For 1-bit bi-level images, use the TIFF G4 in RasterMaster DLL for the best conversion results.
The JBIG format works about twenty percent better than the TIFF G4 format, but it can be
much slower.

55
Chapter 11 - File Format Conversion

Chapter 11 - File Format Conversion


This chapter describes how to convert an image to a different file format.

Converting File Formats


The RasterMaster products support over 10040 file formats. Many formats such as TIFF are
very broad in the internal support of compression and bit depths. Not all formats can support all
bit depths.

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.

Automatically Detecting File Formats


In most cases, you do not need to know the file format you wish to convert since RasterMaster
products automatically detect the file format regardless of the file extension. File extensions are
not mandatory.

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.

Input Document Quality: Resolution/DPI

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

Input Document Quality: Color/bit-depth/Pixel Depth

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.

Making Sure Input is Compatible with Output

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().

Getting a Pixel_Depth_Unsupported Error

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.

Adjusting Low Output Quality

The output quality is affected by several factors described in the sections below:

The Input Quality

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.

Error During Conversion

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.

Conversion Takes Too Long or Output Is Too Large

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

Chapter 12 - High Level Functions


This chapter describes the RasterMaster DLL high-level functions. This chapter contains the fol-
lowing topics:

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

Table 12.1: IMG_animate Function Variables

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

int IMG_antique_effect(int hdib);

Remark

Table 12.2: IMG_antique_effect Function Variable

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.

The margin may be a value of 0.

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

int SNBDAPI IMG_autocrop_bitmap(int imghandle, int margin);

61
Chapter 12 - High Level Functions

Remark

Table 12.3: IMG_autocrop_bitmap Function Variables

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

int SNBDAPI IMG_auto_orient(int imghandle, int *p_angle);

Remark

IMG_auto_orient Function Variables

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

LPDIB_HEADER SNBDAPI IMG_bitmap_info(int imghandle, int *width, int


*height, int *bits_per_pixel);

Remark

Table 12.4: IMG_bitmap_info Function Variables

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.

Example 12.1: IMG_bitmap_info

IMG_bitmap_info(nHandle, &nWidth, &nHeight, &nBits);

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

int SNBDAPI IMG_bitmap_palette(int imghandle, IMGPORT hdc);

Remark

Table 12.5: IMG_bitmap_palette Function Variables

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.

Example 12.2: IMG_bitmap_palette

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

int SNBDAPI IMG_color_combine(int blue_handle, int green_handle,


int red_handle, int k_handle, int planes);

Remark

Table 12.6: IMG_color_combine Function Variables

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

int SNBDAPI IMG_color_separate(int imghandle, int plane);

Remark

Table 12.7: IMG_color_separate Function Variables

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:

For 32 bit cmyk planes are:


0 = cyan
1 = magenta
2 = yellow
plane
3 = black

For 24-bit rgb planes are:


0 = blue
1 = green
2 = red

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

int SNBDAPI IMG_color_gray(int hdib);

Remark

Table 12.8: IMG_color_gray Function Variable

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

int SNBDAPI IMG_create_handle(LPDIB_HEADER lpbih);

Remark

Table 12.9: IMG_create_handle Function Variable

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

int SNBDAPI IMG_create_handle_keep(LPBITMAPINFOHEADER lpbih);

Remark

Table 12.10: IMG_create_handle_keep Function Variable

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

int SNBDAPI IMG_create_handle_shell(LPDIB_HEADER lpbih);

Remark

Table 12.11: IMG_create_handle_shell Function Variable

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

int SNBDAPI IMG_decompress_bitmap(char *filename);

Remark

Table 12.12: IMG_decompress_bitmap Function Variable

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

int SNBDAPI IMG_decompress_bitmap_display(char *filename, IMGPORT


hdc, int xpos, int ypos, int width, int height, int aspect);

Remark

Table 12.13: IMG_decompress_bitmap_display Function Variables

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 Multi-page Splitting and Saving

l Page

Syntax

int SNBDAPI IMG_decompress_bitmap_fd(int fd, unsigned long offset,


int page);

Remark

Table 12.14: IMG_decompress_bitmap_fd Function Variables

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

int SNBDAPI IMG_decompress_bitmap_mem(char *image_data, int page);

Remark

Table 12.15: IMG_decompress_bitmap_mem Function Variables

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.

Example 12.3: IMG_decompress_bitmap_mem

nNewHandle = IMG_decompress_bitmap_mem((char*)pDib, 0);

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

int SNBDAPI IMG_decompress_bitmap_page(char * filename, int page);

Remark

Table 12.16: IMG_decompress_bitmap_page Function Variables

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

int SNBDAPI IMG_decompress_fax(int fd, int xsize, int ysize, int


type, int fill_order);

Remark

Table 12.17: IMG_decompress_fax Function Variables

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

int SNBDAPI IMG_decompress_fax_mem(char *image_ptr, int xsize, int


ysize, int type, int fill_order);

Remark

Table 12.18: IMG_decompress_fax_mem Function Variables

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.

The normal IMG_decompress_bitmap() decompresses each tile as a multi-page, unas-


sembled file of tile images. Each tile is decompressed into a separate file.

74
Chapter 12 - High Level Functions

To decompress a tiled image using IMG_decompress_bitmap_fd(), treat each tile as if it


were the next page of a multi-page image. See IMG_decompress_bitmap() and IMG_decom-
press_bitmap_fd() for more information.

Syntax

int SNBDAPI IMG_decompress_tiled_bitmap(char *bm_name, int page);

Remark

Table 12.19: IMG_decompress_tiled_bitmap Function Variables

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 Multi-page Splitting and Saving

l OCR

l Page

l Print

l Scan

l Tags

l Transp

l Zoom

Syntax

int SNBDAPI IMG_delete_bitmap(int imghandle);

Remark

Table 12.20: IMG_delete_bitmap Function Variable

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

int SNBDAPI IMG_delete_bitmap_keep(int imghandle);

76
Chapter 12 - High Level Functions

Remark

Table 12.21: IMG_delete_bitmap_keep Function Variable

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

DDB SNBDAPI IMG_dib_to_ddb(int imghandle, int width, int height);

Remark

Table 12.22: IMG_dib_to_ddb Function Variables

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

DDB or old-style Windows bitmap (HBITMAP or Device Dependent bitmap).

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().

See IMG_octree_color(), IMG_mediancut_color(), and IMG_bayer_color() for more information.

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

int SNBDAPI IMG_display_bitmap(int imghandle, IMGPORT hdc, int


xpos, int ypos, int width, int height);

Remark

Table 12.23: IMG_display_bitmap Function Variables

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

int SNBDAPI IMG_display_bitmap_aspect(int imghandle, IMGPORT hdc,


HWND hwnd, int xpos, int ypos, int width, int height, int zoom);

Remark

Table 12.24: IMG_display_bitmap_aspect Variables

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.

Example 12.4: IMG_display_bitmap_aspect

79
Chapter 12 - High Level Functions

IMG_display_bitmap_aspect(nHandle, hdc, hwnd ,nLeft, nTop,


nWidth, nHeight, pDoc->ZoomValue());

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

int SNBDAPI IMG_display_bitmap_dti(int imghandle, HDC hdc, int


xpos, int ypos, int width, int height, int zoom);

Remark

Table 12.25: IMG_display_bitmap_dti Function Variables

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

int SNBDAPI IMG_display_bitmap_iac(int imghandle, IMGPORT hdc, HWND


hwnd, int xpos, int ypos, int width, int height, int rotate_angle);

Remark

Table 12.26: IMG_display_bitmap_iac Function Variables

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

int SNBDAPI IMG_display_bitmap_transp(int imghandle, IMGPORT hdc,


int xpos, int ypos, int width, int height, int tcolor);

81
Chapter 12 - High Level Functions

Remark

Table 12.27: IMG_display_bitmap_transp Function Variables

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

int SNBDAPI IMG_display_ddb(DDB hbitmap, IMGPORT hdc, int xpos, int


ypos);

Remark

Table 12.28: IMG_display_ddb Function Variables

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

Table 12.29: IMG_erase_rect Function Variables

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.

Example 12.5: IMG_erase_rect

nRes = ::IMG_erase_rect(nHandle, nx/20, ny/20, nx-(nx/10), ny-


(ny/10), 0xffffffff,0);

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

int SNBDAPI IMG_init_lib(void);

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

int SNBDAPI IMG_print_bitmap(int imghandle, IMGPORT printerDC, int


xpos, int ypos, int width, int height);

Remark

Table 12.30: IMG_print_bitmap Function Variables

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.

Example 12.6: IMG_print_bitmap

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.

Postscript printers will be much faster.

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

int SNBDAPI IMG_print_bitmap_fast(int imghandle, HDC printerDC, int


xpos, int ypos, int width, int height);

Remark

Table 12.31: IMG_print_bitmap_fast Function Variables

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

int SNBDAPI IMG_remove_red_eye(int hdib, int xpos, int ypos, int


xsize, int ysize);

Remark

Table 12.32: IMG_remove_red_eye Function Variables

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

l Multi-page Splitting and Saving

Note:
If the type is -1, the library looks at the file extension for determining the output file type.

Syntax

int SNBDAPI IMG_save_bitmap(int imghandle, char *filename, int


type);

Remark

Table 12.33: IMG_save_bitmap Function Variables

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

int SNBDAPI IMG_save_bitmap_fd(int imghandle, int fd, int type);

Remark

Table 12.34: IMG_save_bitmap_fd Function Variables

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

int SNBDAPI IMG_save_bitmap_mem(int imghandle, char *memptr, int


type);

88
Chapter 12 - High Level Functions

Remark

Table 12.35: IMG_save_bitmap_mem Function Variables

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

nRes = ::IMG_save_bitmap_mem(nHandle, (LPSTR)lpBuf, pDoc-


>ImageType());

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

int SNBDAPI IMG_set_encrypt(int on_off, long key);

Remark

Table 12.36: IMG_set_encrypt Function Variables

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

int SNBDAPI IMG_unload_lib(void);

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

int SNBDAPI IMG_unload_plugins(void);

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

Chapter 13 - Scanning Functions


This chapter describes the scanning functions and parameters. This chapter contains the fol-
lowing topics:

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

typedef struct _scan_caps


{
int bitspix; /* bits per pixel. */
double left; /* window x start pos in inches */
double top; /* window y start pos in inches */
double right; /* window x size in inches */
double bottom; /* window y size in inches */
int hres; /* x resolution in pixels. */
int vres; /* y resolution in pixels. */
}
SCAN_CAPS;

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

int SNBDAPI IMG_scan_acquire(HWND hwnd, int showui);

Remark

Table 13.1: IMG_scan_acquire Function Variables

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

int SNBDAPI IMG_scan_acquire_feeder(HWND hwnd, int showui);

Remark

Table 13.2: IMG_scan_acquire_feeder Function Variables

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

int SNBDAPI IMG_scan_acquire_feeder_fast(HWND hwnd, int showui, int


duplex);

Remark

Table 13.3: IMG_scan_acquire_feeder_fast Function Variables

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

int SNBDAPI IMG_scan_feeder_close(void);

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

int SNBDAPI IMG_scan_open_source(HWND hwnd);

Remark

Table 13.4: IMG_scan_open_source Function Variable

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

int SNBDAPI IMG_scan_pages(HWND hwnd, char *filename, int filetype,


int show_ui);

Remark

Table 13.5: IMG_scan_pages Function Variables

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

int SNBDAPI IMG_scan_pages_fast(HWND hwnd, char *filename, int file-


type, int show_ui);

Remark

Table 13.6: IMG_scan_page_fast Function Variables

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

int SNBDAPI IMG_scan_get_cap(HWND hwnd, int cap);

Remark

Table 13.7: IMG_scan_get_cap Function Variables

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

int SNBDAPI IMG_scan_set_cap(HWND hwnd, int cap, int value);

97
Chapter 13 - Scanning Functions

Remark

Table 13.8: IMG_scan_set_cap Function Variables

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

int SNBDAPI IMG_scan_set_caps(SCAN_CAPS *new_caps);

Remark

Table 13.9: IMG_scan_set_caps Function Variable

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

int SNBDAPI IMG_scan_setup(HWND hwnd);

98
Chapter 13 - Scanning Functions

Remark

Table 13.10: IMG_scan_setup Function Variable

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

Chapter 14 - Image Management Functions


This chapter describes the many image management functions, such as status bar updates
and similar functions. This chapter contains the following topics:

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

int SNBDAPI IMG_create_handle_ddb(DDB hbitmap, int hpalette);

Remark

Table 14.1: IMG_create_handle_ddb Function Variables

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

int SNBDAPI IMG_display_ddb_effect(DDB hbitmap, IMGPORT hdc, int


xpos, int ypos, int effect);

Remark

Table 14.2: IMG_display_ddb_effect Function Variables

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

5 - Displays image in the Window in a window horizontal blind fashion

6 - Displays image in the Window as staggered blocks

7 - Displays image in the Window as blocks from the center of the Win-
dow

8 - Displays image in the Window in a window vertical blind fashion

9 - Displays image in the Window as small blocks from the center of the
Window

10 - Displays image in the Window as blocks in a zigzag pattern

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

HPALETTE SNBDAPI IMG_get_bitmap_palette(int imghandle);

Remark

Table 14.3: IMG_get_bitmap_palette Function Variable

Variable Description
Standard image handle obtained from a decompress func-
imghandle
tion such as IMG_decompress_bitmap()

Returns

Returns the palette as an HPALETTE format of the image specified by imghandle.

102
Chapter 14 - Image Management Functions

Example 14.1: IMG_get_bitmap_palette

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

int SNBDAPI IMG_get_croprect(int imghandle, int *xpos, int *ypos,


int *width, int *height);

Remark

Table 14.4: IMG_get_croprect Function Variables

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.

Example 14.2: IMG_get_croprect

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

int SNBDAPI IMG_ifl_version(int *major, int *minor);

Remark

Table 14.5: IMG_ifl_version Function Variables

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

int SNBDAPI IMG_ifl_version_ext(int *major, int *minor, *update,


*fix);

Remark

Table 14.6: IMG_ifl_version_ext Function Variables

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

int SNBDAPI IMG_merge_bitmap(int imghandle, char *filename, int ras-


ter_operation, int xpos, int ypos);

Remark

Table 14.7: IMG_merge_bitmap Function Variables

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.

0 or SRCCOPY = Copies the source bitmap to the des-


tination bitmap.

1 or SRCPAINT = Combines pixels of the destination and


source bitmaps using thememory specified by imghandle.

2 or SRCAND = Combines pixels of the destination and


source bitmaps using the Boolean AND operator.

3 or SRCINVERT = Combines pixels of the destination


and source bitmaps using the Boolean XOR operator.

4 or SRCERASE = Inverts the destination bitmap and


combines the result with the source bitmap using the
Boolean AND operator.

5 or NOTSRCCOPY = Copies the inverted source bitmap


to the destination.

6 or NOTSRCERASE = Inverts the result of combining


the destination and source bitmaps using the Boolean OR
operator.

7 or MERGECOPY = Combines the pattern and the


source bitmap using the Boolean AND operator.

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

8 or MERGEPAINT = Combines the inverted source bit-


map with the destination bitmap using the Boolean OR
operator.

9 or PATCOPY = Copies the pattern to the destination bit-


map.

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.

11 or PATINVERT = Combines the destination bitmap


with the pattern using the Boolean XOR operator.

12 or DSTINVERT = Inverts the destination bitmap.

13 or BLACKNESS = Turns all output black.

14 or WHITENESS = Turns all output white.


xpos Pointer to integer to receive the starting x coordinate.
ypos Pointer to integer to receive the starting y coordinate.

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

int SNBDAPI IMG_merge_bitmap_alpha(int imghandle, DIB_HEADER


*dlpbi, int xpos, int ypos, int opaque);

Remark

Table 14.8: IMG_merge_bitmap_alpha Function Variables

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

int SNBDAPI IMG_merge_bitmap_handle(int dhdib, int shdib, int rop,


int xpos, int ypos);

Remark

Table 14.9: IMG_merge_bitmap_handle Function Variables

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

int SNBDAPI IMG_promote_8(int imghandle);

Remark

Table 14.10: IMG_promote_8 Function Variable

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.

Example 14.3: IMG_promote_8

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

int SNBDAPI IMG_promote_24(int imghandle);

Remark

Table 14.11: IMG_promote_24 Function Variable

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.

Example 14.4: IMG_promote_24

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

int SNBDAPI IMG_promote_32(int imghandle);

Remark

Table 14.12: IMG_promote_32 Function Variable

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.

Example 14.5: IMG_promote_32

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

int SNBDAPI IMG_repaint_scroll(int imghandle, IMGPORT hdc, HWND


hwnd, int scroll_dir, PAINTSTRUCT *ps);

Remark

Table 14.13: IMG_repaint_scroll Function Variables

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

Example 14.6: IMG_repaint_scroll

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

int SNBDAPI IMG_scroll_bitmap(int imghandle, HWND hwnd, int wparam,


long lparam, int message);

112
Chapter 14 - Image Management Functions

Remark

Table 14.14: IMG_scroll_bitmap Function Variables

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.

Example 14.7: IMG_scroll_bitmap

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

int SNBDAPI IMG_set_croprect(int imghandle, int xpos, int ypos, int


width, int height);

Remark

Table 14.15: IMG_set_croprect Function Variables

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.

Example 14.8: IMG_set_croprect

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

int SNBDAPI IMG_set_croprect_scroll(int imghandle, HWND hwnd, int


xpos, int ypos, int width, int height, int aspect);

114
Chapter 14 - Image Management Functions

Remark

Table 14.16: IMG_set_croprect_scroll Function Variables

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.

To save the image as rotated, use IMG_rotate_bitmap(). The image is permanently


rotated in memory. See IMG_rotate_bitmap() for more information.

Use this function on all image types for fast rotation.

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

int SNBDAPI IMG_set_display_angle(int imghandle, int rotangle);

Remark

Table 14.17: IMG_set_display_angle Function Variables

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.

Example 14.9: IMG_set_display_angle

nRes =::IMG_set_display_angle(nHandle, nAngle);

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

int SNBDAPI IMG_set_statusbar(void *private_data, STATUSBARCB


statusbar, int on_off_flag);

Remark

Table 14.18: IMG_set_statusbar Function Variables

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.

Turns status bar on or off.


on_off_flag
0 = Off
1 = On

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

int SNBDAPI IMG_zoom_bitmap(int imghandle, HWND hwnd, int zoom_


factor);

Remark

Table 14.19: IMG_zoom_bitmap Function Variables

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

nRes= ::IMG_zoom_bitmap(nHandle, GetSafeHwnd(), nNewZoom);

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

int SNBDAPI IMG_zoom_bitmap_rect(int imghandle, HWND hwnd, LPIMG_


RECT lpzoom, LPIMG_RECT lpclient, int mode);

Remark

Table 14.20: IMG_zoom_bitmap_rect Function Variables

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

int SNBDAPI IMG_zoom_bitmap_1_to_1(int imghandle, HWND hwnd, int


zoom_level, int center_flag);

Remark

Table 14.21: IMG_zoom_bitmap_1_to_1 Function Variables

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

int SNBDAPI IMGLOW_map_image_to_wnd(int imghandle, HWND hwnd, int


*x, int *y);

Remark

Table 14.22: IMGLOW_map_image_to_wnd Function Variables

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

int SNBDAPI IMGLOW_map_wnd_to_image(int imghandle, HWND hwnd, int


*x, int *y);

Remark

Table 14.23: IMGLOW_map_wnd_to_image Function Variables

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

int SNBDAPI IMGLOW_get_fileinfo(char *filename, LPBITMAPINFOHEADER


lpbih);

Remark

Table 14.24: IMGLOW_get_fileinfo Function Variables

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

int SNBDAPI IMGLOW_get_fileinfo_page(char *filepath,


LPBITMAPINFOHEADER lpbih, int page);

Remark

Table 14.25: IMGLOW_get_fileinfo_page Function Variables

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

int SNBDAPI IMGLOW_set_rop(int imghandle, long raster_op);

Remark

Table 14.26: IMGLOW_set_rop Function Variables

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.

SRCPAINT = Combines pixels of the destination and


source bitmaps using the Boolean OR operator.

SRCAND = Combines pixels of the destination and


source bitmaps using the Boolean AND operator.

SRCINVERT = Combines pixels of the destination and


source bitmaps using the Boolean XOR operator.

SRCERASE = Inverts the destination bitmap and com-


bines the result with the source bitmap using the Boolean
AND operator.

NOTSRCCOPY = Copies the inverted source bitmap to


the destination.

NOTSRCERASE = Inverts the result of combining the


destination and source bitmaps using the Boolean OR
operator.

MERGECOPY = Combines the pattern and the source


bitmap using the Boolean AND operator.

MERGEPAINT = Combines the inverted source bitmap


with the destination bitmap using the Boolean OR oper-
ator.

PATCOPY = Copies the pattern to the destination bit-


map.

PATPAINT = Combines the inverted source bitmap with


the pattern using the Boolean XOR operator. Combines
the result of this operation with the destination bitmap
using the Boolean OR operator.

PATINVERT = Combines the destination bitmap with the


pattern using the Boolean XOR operator.Combines the
destination bitmap with the pattern using the Boolean
XOR operator.

DSTINVERT - Inverts the destination bitmap.

BLACKNESS - Turns all output black.

WHITENESS - Turns all output white.

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

int SNBDAPI IMGLOW_set_fileio(READCB newread_func, WRITECB


newwrite_func, SEEKCB newseek_func);

Remark

Table 14.27: IMGLOW_set_fileio Function Variables

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

int SNBDAPI IMGLOW_set_wipedelay(int wipe_delay);

Remark

Table 14.28: IMGLOW_set_wipedelay Function Variable

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

Chapter 15 - ASCII Formats and Functions


This chapter describes the structure for defining Snowbound’s available ASCII attributes 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)

This chapter contains the following topics:

ASCII Attribute Structure

IMG_import_ascii()

IMG_RECT()

IMGLOW_get_ascii_attributes()

IMGLOW_get_ascii_page_width()

IMGLOW_set_ascii_attributes()

ASCII Attribute Structure


Below is the structure for defining Snowbound ASCII attributes.

Syntax

typedef struct tagASCIITEXTATTR


{
      INT   asciiFlags;         /* determines which fields to use
*/               
      INT   asciiXDpi;       /* horizontal dots per inch */
      INT   asciiYDpi;       /* vertical dots per inch */
      IMG_RECT   asciiMargin;   /* margins (1/1000 inches) */
      INT   asciiTabStop;       /* # of chars between tab stops */
      INT   asciiPageWidth;     /* width of page (1/1000 inches) */
      INT   asciiPageHeight;    /* height of page (1/1000 inches)*/
      INT   asciiPointSize;     /* point size of the font */
      INT   asciiCharsPerLine;  /* number of characters per line */
      INT   asciiLinesPerPage;  /* number of lines per page*/
      INT   asciiWeight;       /* normal = 0, bold = 1   */
      INT   asciiItalic;       /* normal = 0, italic = 1   */
      char   asciiTypeFace[32]; /* name of the font to use   */
} ASCIITEXTATTR, *LPASCIITEXTATTR;

125
Chapter 15 - ASCII Formats and Functions

Remark

Table 15.1: ASCIITEXTATTR Function Flags

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

Standard Page Sizes


ASCIIXSIZELETTER 8500L /* 8 1/2" */
ASCIIYSIZELETTER 11000L /* 11" */

ASCIIXSIZELEGAL 8500L /* 8 1/2" */


ASCIIYSIZELEGAL 14000L /* 14" */

ASCIIXSIZEEXECUTIVE 7250L /* 7 1/4" */


ASCIIYSIZEEXECUTIVE 10500L /* 10 1/2" */

ASCIIXSIZEENVELOPE 4125L /* 4 1/8" */


ASCIIYSIZEENVELOPE 9500L /* 9 1/2" */

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

int SNBDAPI IMG_import_ascii(char *filename, int page);

Remark

Table 15.2: IMG_import_ascii Function Variables

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

Table 15.3: IMG_RECT Function Variables

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

int SNBDAPI IMGLOW_get_ascii_attributes(LPASCIITEXTATTR lpat-


tributes);

Remark

Table 15.4: IMGLOW_get_ascii_attributes Function Variable

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

int SNBDAPI IMGLOW_get_ascii_page_width(char *filename);

Remark

Table 15.5: IMGLOW_get_ascii_page_width Function Variable

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

int SNBDAP IMGLOW_set_ascii_attributes(LPASCIITEXTATTR lpat-


tributes);

Remark

Table 15.6: IMGLOW_set_ascii_attributes Function Variable

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

Chapter 16 - Low Level Functions


This chapter describes the RasterMaster DLL low-level functions. This chapter contains the fol-
lowing topics:

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()

Supported File Types

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

int SNBDAPI IMGLOW_autocolor(int on_off);

131
Chapter 16 - Low Level Functions

Remark

Table 16.1: IMGLOW_autocolor Function Variable

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

int SNBDAPI IMGLOW_decompress_bitmap(int fd, unsigned long offset,


int page, PUTDIBDATACB put_dib_data, void FAR *private_data,
PUTHEADERCB set_header);

Remark

Table 16.2: IMGLOW_decompress_bitmap Function Variables

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.

put_dib_data Callback Routines For IMGLOW_decom-


press_bitmap
This section describes the put_dib_data callback routine used by IMGLOW_decompress_
bitmap().

Syntax

int put_dib_data(private_data, buffer, ypos, bytes);

Remark

Table 16.3: put_dib_data Callback Routine Variables

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.

set_header Callback Routine For IMGLOW_decompress_


bitmap
This section describes the set_header callback routine used by the IMGLOW_decompress_
bitmap() function.

Syntax

int set_header(LPBITMAPINFOHEADER, private_data);

Remark

Table 16.4: set_header Callback Routine Variables

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

int SNBDAPI IMGLOW_decompress_bitmap_mem(char *imageptr, int page,


PUTDIBDATACB put_dib_data, void *private_data, PUTHEADERCB set_
header);

Remark

Table 16.5: IMGLOW_decompress_bitmap_mem Function Variables

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..

put_dib_data Callback Routine For IMGLOW_decom-


press_bitmap_mem
This section describes the put_dib_data callback routine used by IMGLOW_decompress_
bitmap_mem().

134
Chapter 16 - Low Level Functions

Syntax

int put_dib_data(private_data, buffer, ypos, bytes);

Remark

Table 16.6: put_dib_data Callback Routine Variables

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.

set_header Callback Routine For IMGLOW_decompress_


bitmap_mem
This section describes the set_header callback routine used by IMGLOW_decompress_bit-
map_mem().

Syntax

int set_header(LPBITMAPINFOHEADER, private_data);

Remark

Table 16.7: set_header Callback Routine Variables

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.

Example 16.1: IMGLOW_detect_color

public int IMGLOW_detect_color()

int pages = tSimage.IMGLOW_get_pages(st);

system.out.println("Pages - " + pages);

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

int SNBDAPI IMGLOW_extract_text(char *bm_name, char **ptr, int


*length, int page);

Remarks

Table 16.8: IMGLOW_extract_text Function Variables

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.

Example 16.2: Extracted Text Variables

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

Table 16.9: Extracted Text Variables

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

int SNBDAPI IMGLOW_extract_text_mem(char *image_ptr, char **ptr,


int *length, int page);

Remarks

Table 16.10: IMGLOW_extract_text_mem Function Variables

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

int SNBDAPI IMGLOW_get_anim_delay(char *bm_name);

Remark

Table 16.11: IMGLOW_get_anim_delay Function Variable

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

int SNBDAPI IMGLOW_get_bitmap_header(int imghandle, char *header);

Remark

Table 16.12: IMGLOW_get_bitmap_header Function Variables

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

int SNBDAPI IMGLOW_get_bitmap_name(char *nameptr, char *dateptr);

Remark

Table 16.13: IMGLOW_get_bitmap_name Function Variables

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

int SNBDAPI IMGLOW_get_custstring(char *string);

Remark

Table 16.14: IMGLOW_get_custstring Function Variable

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

int SNBDAPI IMGLOW_get_display_rect(int hdib, int *xs, int *ys, int


*xsize, int *ysize);

Remark

Table 16.15: IMGLOW_get_display_rect Function Variables

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

l Multi-page Splitting and Saving

Syntax

int SNBDAPI IMGLOW_get_filetype(char *filename);

Remark

Table 16.16: IMGLOW_get_filetype Function Variable

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

int SNBDAPI IMGLOW_get_filetype_fd(int fd);

142
Chapter 16 - Low Level Functions

Remark

Table 16.17: IMGLOW_get_filetype_fd Function Variable

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

int SNBDAPI IMGLOW_get_image_orientation(char *filename);

Remark

Table 16.18: IMGLOW_get_image_orientation Function Variable

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

int SNBDAPI IMGLOW_get_image_orientation_page(char * file, int


page);

Remark

Table 16.19: IMGLOW_get_image_orientation_page Function Variables

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 Save Searchable PDF

l Vector_Convert

Syntax

int SNBDAPI IMGLOW_get_pages(char *filename);

Remark

Table 16.20: IMGLOW_get_pages Function Variable

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

int SNBDAPI IMGLOW_get_pages_fd(int fh);

Remark

Table 16.21: IMGLOW_get_pages_fd Function Variable

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

int SNBDAPI IMGLOW_get_pages_mem(char *image_ptr);

Remark

Table 16.22: IMGLOW_get_pages_mem Function Variable

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

int SNBDAPI IMGLOW_get_tiff_tag(int tag, int max_bytes, long


*value, char *bm_name, char *buff);

Remark

Table 16.23: IMGLOW_get_tiff_tag Function Variables

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

int SNBDAPI IMGLOW_get_tiff_tag_page(int tag, int max_bytes, long


*value, char *bm_name, char *buff, int page);

Remark

Table 16.24: IMGLOW_get_tiff_tag_page Function Variables

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

int SNBDAPI IMGLOW_get_tile_info(char *bm_name, SNBDTILESTRUCT


*stile);

Remark

Table 16.25: IMGLOW_get_tile_info Function Variables

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

Example 16.3: IMGLOW_get_tile_info  

typedef struct tagSNBDTILESTRUCT


{
Long width;
Long height;
Long tile_width

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

int SNBDAPI IMGLOW_get_transp_color(int imghandle);

Remark

Table 16.26: IMGLOW_get_transp_color Function Variable

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

int SNBDAPI IMGLOW_is_tiled_image();

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

int SNBDAPI IMGLOW_save_bitmap(int fd, LPDIBHEADER lpbih, int type,


GETDIBDATACB get_dib_data, void *private_data);

Remark

Table 16.27: IMGLOW_save_bitmap Function Variables

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

get_dib_data Callback Routine For IMGLOW_save_bit-


map
This section describes the get_dib_data callback routine used by IMGLOW_save_bimap
().

Syntax

int get_dib_data(private_data, buffer, ypos, bytes);

Remark

Table 16.28: get_dib_data Callback Routine Variables

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

int SNBDAPI IMGLOW_save_bitmap_mem(char *imageptr, LPDIBHEADER


lpbih, int type, GETDIBDATACB get_dib_data, void *private_data);

Remark

Table 16.29: IMGLOW_save_bitmap_mem Function Variables

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.

get_dib_data Callback Routine For IMGLOW_save_bit-


map_mem
The following section describes the get_dib_data callback routine used by IMGLOW_save_
bimap_mem().

Syntax

int get_dib_data(private_data, buffer, ypos, bytes);

Remark

Table 16.30: get_dib_data Callback Routine Variables

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

l Save Searchable PDF

Note:
The following file formats are supported: AFP, PCL, PDF, Word and Excel.

Syntax

int SNBDAPI IMGLOW_search_text(char *buffer, char *search_string,


int instance, int case_sensitive, int *error);

Remark

Table 16.31: IMGLOW_search_text Function Variables

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

int SNBDAPI IMGLOW_set_alias(int alias_type);

Remark

Table 16.32: IMGLOW_set_alias Function Variable

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

int SNBDAPI IMGLOW_set_alias_img(int hdib, int alias);

Remark

Table 16.33: IMGLOW_set_alias_img Function Variables

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

int SNBDAPI IMGLOW_set_bitmap_name(char *nameptr, char *dateptr);

Remark

Table 16.34: IMGLOW_set_bitmap_name Function Variables

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

int SNBDAPI IMGLOW_set_comp_quality(int quality);

Remark

Table 16.35: IMGLOW_set_comp_quality Function Variable

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

int SNBDAPI IMGLOW_set_dispfunc(typedef int(FAR PASCAL


*DISPLAYCB));

Remark

Table 16.36: IMGLOW_set_dispfunc Function Variable

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.

You can use this function to do the following:

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 Read in color or grayscale documents by setting a higher bits-per-pixel. Please see


Appendix A, Supported File Formats for details on what bits per pixel are supported for
each format.

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

int SNBDAPI IMGLOW_set_document_input(int dpi, int bits_pix, int


format);

Remark

Table 16.37: IMGLOW_set_document_input Function Variable

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

See Appendix A, Supported File Formats for information


on these and other pixel depths supported by each format.
Sets the format parameter. A file format number as spe-
format cified in Appendix A, Supported File Formats i.e. Word
(DOC) is 86.

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

int SNBDAPI IMGLOW_set_document_page_size(double height, double


width, int format);

Remark

Table 16.38: IMGLOW_set_document_page_size Function Variable

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

int SNBDAPI IMGLOW_set_image_orientation(int orient);

Remark

Table 16.39: IMGLOW_set_image_orientation Function Variable

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

int SNBDAPI IMGLOW_set_jpeg_decompression(int mode);

Remark

Table 16.40: IMGLOW_set_jpeg_decompression Function Variable

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

int SNBDAPI IMGLOW_set_jpeg2000_comp_ratio(int comp_ratio);

Remark

Table 16.41: W_set_jpeg2000_comp_ratio Function Variable

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

int SNBDAPI IMGLOW_set_jpg_interleave(int h_int, int v_int);

Remark

Table 16.42: IMGLOW_set_jpg_interleave Function Variables

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

int SNBDAPI IMGLOW_set_msg_render_preferences(int preference);

Remark

Table 16.43: IMGLOW_set_msg_render_preferences Function Variables

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

int SNBDAPI IMGLOW_set_overlay_path(char *path);

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

int SNBDAPI IMGLOW_set_pdf_input(int dpi, int bits_pix);

Remark

Table 16.44: IMGLOW_set_pdf_input Function Variables

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

int SNBDAPI IMGLOW_set_pdf_output(int double xsize, int double


ysize);

Remark

Table 16.45: IMGLOW_set_pdf_output Function Variables

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

int SNBDAPI IMGLOW_set_pdf_password(char *filename);

Remark

Table 16.46: IMGLOW_set_pdf_password Function Variables

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

int SNBDAPI IMGLOW_set_tiff_save_strips(int on_off);

Remark

Table 16.47: IMGLOW_set_tiff_save_strips Function Variable

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

int SNBDAPI IMGLOW_set_tiff_tag(int tag, int max_bytes, int value,


byte buff[]);

Remark

Table 16.48: IMGLOW_set_tiff_tag Function Variables

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

int SNBDAPI IMGLOW_set_transp_color(int imghandle, int color);

Remark

Table 16.49: IMGLOW_set_transp_color Function Variables

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

int SNBDAPI IMGLOW_write_tiff_stream(LPBITMAPINFOHEADER lpbi, char*


data_stream, int data_size, int file_type, char *bm_name);

Remark

Table 16.50: IMGLOW_write_tiff_stream Function Variables

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.

Supported File Types


Listed below are the currently supported file types:

Example 16.4: Supported File Types

#define SNBD_TIFF_COMP_NONE 1 /* no compression */


#define SNBD_TIFF_COMP_GIII 2 /* modified huffman group3 */
#define SNBD_TIFF_COMP_ 3 /* modified huffman group 3 padding
*/
#define SNBD_TIFF_COMP_G4 4 /* modified huffman group 4 */
#define SNBD_TIFF_COMP_LZW 5 /* lzw compression */
#define SNBD_TIFF_COMP_PACK 32773 /* pack bits compression */
#define SNBD_TIFF_COMP_JPEG 6 /* JPEG compression */
#define SNBD_TIFF_COMP_JPEG_GRAY 7 /* JPEG compression 8 bit

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

Chapter 17 - DWG and DXF Functions


This chapter describes the RasterMaster DLL DWG and DXF functions. This chapter contains
the following topics:

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

int SNBDAPI IMGLOW_set_cad_background(int r, int g, int b);

Remarks

Table 17.1: IMGLOW_set_cad_background Function Variables

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

int SNBDAPI IMGLOW_set_cad_input(int dpi, int bits_pix);

Remarks

Table 17.2: IMGLOW_set_cad_input Function Variables

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

int SNBDAPI IMGLOW_set_cad_size(int width, int height);

Remarks

Table 17.3: IMGLOW_set_cad_size Function Variables

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

Chapter 18 - HTML Functions


This chapter describes the RasterMaster DLL HTML functions. This chapter contains the fol-
lowing topics:

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:

l Enables or disables image capabilities for the HTML renderer.


l Enables or disables JavaScript capabilities for the HTML renderer.
l Enables or disables the use of the page size ratio capability of the HTML document.
l Enables or disables the exclusive use of print page breaks to signal page boundaries.
l Sets the ratio of the width to the height of the pages extracted from the HTML document.

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

int SNBDAPI IMGLOW_set_html_capabilities(int isImageEnabled, int


isJavascriptEnabled, int isRatioEnabled, int isPageBreaksExclusive,

169
Chapter 18 - HTML Functions

double ratio);

Remarks

Table 18.1: IMGLOW_set_html_capabilities Function Variables

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

int SNBDAPI IMGLOW_set_html_home_dir(char* dir);

Remarks

Table 18.2: IMGLOW_set_html_home_dir Function Variables

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

int SNBDAPI IMGLOW_set_html_image_capability(int isEnabled);

Remarks

Table 18.3: IMGLOW_set_html_image_capability Function Variables

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

int SNBDAPI IMGLOW_set_html_input(int print_dpi, int bits_pix);

Remarks

Table 18.4: IMGLOW_set_html_input Function Variables

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

int SNBDAPI IMGLOW_set_html_javascript_capability(int isEnabled);

Remarks

Table 18.5: IMGLOW_set_html_javascript_capability Function Variables

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

int SNBDAPI IMGLOW_set_html_page_size(int w, int h);

172
Chapter 18 - HTML Functions

Remarks

Table 18.6: IMGLOW_set_html_page_size Function Variables

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

int SNBDAPI IMGLOW_set_html_page_size_ratio(int ratio);

Remarks

Table 18.7: IMGLOW_set_html_page_size_ratio Function Variables

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

int SNBDAPI IMGLOW_set_html_page_size_ratio_capability(int isEn-


abled);

Remarks

Table 18.8: IMGLOW_set_html_page_size_ratio_capability Function Variables

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

int SNBDAPI IMGLOW_set_html_screen_dpi(double screen_dpi);

Remarks

Table 18.9: IMGLOW_set_html_screen_dpi Function Variables

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

int SNBDAPI IMGLOW_set_html_use_page_breaks_exclusively(int isEn-


abled);

Remarks

Table 18.10: IMGLOW_set_html_use_page_breaks_exclusively Function Variables

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

int SNBDAPI IMGLOW_set_html_utf_bom(int utf_bom);

Remarks

Table 18.11: IMGLOW_set_html_utf_bom Function Variables

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

Table 18.12: Representations of byte order marks by encoding

Representation Representaition Representation


Encoding
(hexadecimal) (hexadecimal) (ISO-8859-1)
UTF_8 EF BB BF 1 239 187 191 
UTF_16BE FE FF 254 255 þÿ
UTF_16LE FF FE 255 254 ÿþ
??þÿ (? is the ascii null
UTF_32BE 00 00 FE FF 0 0 254 255
character)
ÿþ?? (? is the ascii null
UTF_32LE FF FE 00 00 255 254 0 0
character)
2B 2F 76, and one of 43 47 118, and one of
+/v, and one of the fol-
UTF_72 the following: the following:
lowing: 8 9 + /
[ 38 | 39 | 2B | 2F ] [56 | 57 | 43 | 47 ]
UTF_1 F7 64 4C 247 100 76 ÷dL
UTF_EBCDIC DD 73 66 73 221 115 102 115 Ýsfs
SCSU 0E FE FF3 14 254 255 ?þÿ (? is the ascii "shift

176
Chapter 18 - HTML Functions

Representation Representaition Representation


Encoding
(hexadecimal) (hexadecimal) (ISO-8859-1)
out" character)
FB EE 28 optionally fol- 251 238 40 optionally ûî( optionally followed by
BOCU_1
lowed by FF4 followed by 255 ÿ
□1■3 (□ and ■ are
GB_18030 84 31 95 33 132 49 149 51 unmapped ISO-8859-1
characters)

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

Chapter 19 - Open Office 2007 XML


(OOXML) Functions
This chapter describes the RasterMaster DLL Office Open XML (OOXML) format 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.

The IMG_decompress_bitmap() function will automatically detect OOXML format documents


and process them when the Aspose.Words library has been installed and registered with
RasterMaster. If the Aspose library is not found by RasterMaster, the system will return the
error code DLL_NOT_LOADED (-24).

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

int IMGLOW_set_ooxml_license(char* licenseFile);

Remark

Table 19.1: IMGLOW_set_ooxml_license Function Variable

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

int IMGLOW_ooxml_license_enable(char* licensePath, int


nPathLength);

Remark

Table 19.2: IMGLOW_ooxml_license_enable Function Variable

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

int IMGLOW_set_ooxml_licenseW(wchar_t* licenseFile);

Remark

Table 19.3: IMGLOW_set_ooxml_licenseW Function Variable

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

Previous Word 2007 Open Office XML (OOXML) Func-


tions
The functions below were replaced by the current functions IMGLOW_set_ooxml_license() and
IMGLOW_set_ooxml_licenseW() and were previously used to load license files:

IMGLOW_get_ooxml_license_location()
This function gets the location of the OOXML license file.

Syntax

int IMGLOW_get_ooxml_license_location(wchar_t* location, int loc-


ationLength, int* locationRequiredLength);

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

Table 19.4: IMGLOW_get_ooxml_license_location Function Variable

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

int IMGLOW_set_ooxml_license_filename(char* licenseFilename);

180
Chapter 19 - Open Office 2007 XML (OOXML) Functions

Remark

Table 19.5: IMGLOW_set_ooxml_license_filename Function Variables

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

int IMGLOW_set_ooxml_license_filenameW(wchar_t* licenseFilename);

Note:
This function supports wide characters. If you are using wide characters, then Windows
Unicode UTF-16LE is supported.

Remark

Table 19.6: IMGLOW_set_ooxml_license_filenameW Function Variables

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

int IMGLOW_set_ooxml_license_path(char* licensePath);

Remark

Table 19.7: IMGLOW_set_ooxml_license_path function variable descriptions.

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

int IMGLOW_set_ooxml_license_pathW(wchar_t* licensePath);

Note:
This function supports wide characters. If you are using wide characters, then Windows
Unicode UTF-16LE is supported.

Remark

Table 19.8: IMGLOW_set_ooxml_license_pathW Function Variables

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

Chapter 20 - DocClean Functions


This chapter describes theRasterMaster DLL DocClean functions. DocClean is an optional
extension of RasterMaster that provides a group of functions that are useful for cleaning up
scanned color, grayscale and black and white images. This chapter contains the following top-
ics:

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

int SNBDAPI IMG_auto_orient(int hdib, int *p_angle);

Remark

Table 20.1: IMG_auto_orient Function Variables

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

int SNBDAPI IMG_deskew_bitmap(int hdib, int *p_angle, int deskew_


angle_start, int deskew_angle_end);

Remark

Table 20.2: IMG_deskew_bitmap Function Variables

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 deskew_angle_end int hdib,

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.

Example 20.1: IMG_deskew_bitmap

nRes = ::IMG_deskew_bitmap(nHandle, nAngle);

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

int SNBDAPI IMG_despeckle_bitmap(int hdib, int quality);

Remark

Table 20.3: IMG_despeckle_bitmap Function Variables

Variable Description
hdib Standard RasterMaster image handle.
Sets the coarseness of the amount of data to be filtered or removed.

quality Quality factor 1 - 100


1 = Remove only single pixels
100 = Removes large black areas

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.

Example 20.2: IMG_despeckel_bitmap

nRes = ::IMG_despeckel_bitmap(nHandle, _ttoi(dd.m_strDespQu-


ality));

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

int SNBDAPI IMGLOW_auto_invert(int hdib, int red, int green, int


blue, int colourTolerance, double mismatchTolerance);

Remark

Table 20.4: IMGLOW_auto_invert Function Variable

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

double SNBDAPI IMGLOW_detect_blank_page(int hdib,


char autodetect, int red, int green, int blue, int tolerance, char
isLowQuality, char isLowMemory);

Remark

Table 20.5: IMGLOW_detect_blank_page Function Variable

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

int SNBDAPI IMGLOW_remove_halftone(int hdib, int minSize, int maxS-


ize);

Remark

Table 20.6: IMGLOW_remove_halftone Function Variable

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

int SNBDAPI IMGLOW_remove_holepunch(int hdib,


int autoDetectFillColour, int red, int green, int blue,
int autoFindHoles, IMG_RECT* holes, int holeNum, IMG_RECT* ROIs,
int ROIsNum, int minHoleDiameter, int maxHoleDiameter);

Remark

Table 20.7: IMGLOW_remove_holepunch Function Variable

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

Chapter 21 - Image Processing Functions


This chapter describes the RasterMaster DLL image-processing functions. This chapter con-
tains the following topics:

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

int SNBDAPI IMG_apply_profile(int imghandle, char *input_ profile,


char *output_profile, int mode);

Remark

Table 21.1: IMG_apply_profile Function Variables

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.

Table 21.2: IMG_apply_profile Modes

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.*

* Mode settings do not change the original image data.

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

int SNBDAPI IMG_cmyk_to_rgb(int hdib);

Remark

Table 21.3: IMG_cmyk_to_rgb Function Variable

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.

Example 21.1: IMG_cmyk_to_rgb

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.

If you experience diminished quality when resizing, try calling IMG_create_thumbnail to


look at neighboring pixels when resizing for better quality.

Use IMG_create_thumbnail to preserve aspect ratio when converting to a thumbnail. This


will create a gray scale aliased bitmap that must be saved with TIFF_LZW or TIFF_JPEG.

Syntax

int SNBDAPI IMG_create_thumbnail(int imghandle, int xsize, int


ysize);

Remark

Table 21.4: IMG_create_thumbnail Function Variables

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

int SNBDAPI IMG_deskew_bitmap(int imghandle, int angle);

Remark

Table 21.5: IMG_deskew_bitmap Function Variables

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

nRes = ::IMG_deskew_bitmap(nHandle, nAngle);

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

int SNBDAPI IMG_despeckle_bitmap(int imghandle, int value);

Remark

Table 21.6: IMG_despeckle_bitmap Function Variable

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

Example 21.3: IMG_despeckel_bitmap

nRes = ::IMG_despeckel_bitmap(nHandle, _ttoi(dd.m_strDespQu-


ality));

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

int SNBDAPI IMG_display_fit_to_height(int hdib, IMGPORT hdc, HWND


hwnd, int xs, int ys, int xsize, int ysize);

Remark

Table 21.7: IMG_display_fit_to_height Function Variables

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.

Example 21.4: IMG_display_fit_to_height

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

int SNBDAPI IMG_display_fit_to_width(int hdib, IMGPORT hdc, HWND


hwnd, int xs, int ys, int xsize, int ysize);

Remark

Table 21.8: IMG_display_fit_to_width Function Variables

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.

Example 21.5: IMG_display_fit_to_width

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

int SNBDAPI IMG_flip_bitmapx(int imghandle);

Remark

Table 21.9: IMG_flip_bitmapx Function Variable

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.

Example 21.6: IMG_flip_bitmapx

void CSnowBndView::FlipBitmap(BitmapFlip FlipDir)


{
if(FlipDir==XDir)
SnowBndFuncCall(::IMG_flip_bitmapx);
else //(FlipDir==YDir)
SnowBndFuncCall(::IMG_flip_bitmapy);
}

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

int SNBDAPI IMG_flip_bitmapy(int imghandle);

Remark

Table 21.10: IMG_flip_bitmapy Function Variable

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.

Example 21.7: IMG_flip_bitmapy

void CSnowBndView::FlipBitmap(BitmapFlip FlipDir)


{
if(FlipDir==XDir)
SnowBndFuncCall(::IMG_flip_bitmapx);
else //(FlipDir==YDir)
SnowBndFuncCall(::IMG_flip_bitmapy);
}

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

int SNBDAPI IMG_get_deskew_angle(int imghandle, int *angle, int


start_angle, int stop_angle);

Remark

Table 21.11: IMG_get_deskew_angle Function Variables

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

Example 21.8: IMG_get_deskew_angle

nRes = ::IMG_get_deskew_angle(nHandle, &nAngle, -20, 20);

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

char * SNBDAPI IMG_get_profile(char *bm_name, int page, int


*length);

Remark

Table 21.12: IMG_get_profile Function Variables

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

int SNBDAPI IMG_histogram_equalize(int hdib);

Remark

Table 21.13: IMG_histogram_equalize Function Variable

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

int SNBDAPI IMG_invert_bitmap(int imghandle);

Remark

Table 21.14: IMG_invert_bitmap Function Variable

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

int SNBDAPI IMG_process_bitmap(int imghandle, int type, char *mat-


rix);

Remark

Table 21.15: IMG_process_bitmap Function Variables

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.

Example 21.9: IMG_process_bitmap

nRes = ::IMG_process_bitmap(nHandle, sd.m_nSobelOption+1, 0);

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.

To preserve aspect ratio:

hres is the destination width.


vres the destination height.

Set the width and height to the original width and height of the image after decompress as
shown in the following example:

Example 21.10: Preserving Aspect Ratio

vres = (int)((long)height * hres / width);


IMG_resize_bitmap(hres,vres);

201
Chapter 21 - Image Processing Functions

Syntax

int SNBDAPI IMG_resize_bitmap(int imghandle, int width, int


height);

Remark

Table 21.16: IMG_resize_bitmap Function Variables

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.

Example 21.11: IMG_resize_bitmap

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.

If this function returns an error such as PIXEL_DEPTH_UNSUPPORTED or PALETTE_IMAGES_


NOT_ALLOWED, then try using IMG_create_thumbnail() function because that will take a wider
variety of input bit-depths than IMG_resize_bitmap_bicubic function.

Syntax

int SNBDAPI IMG_resize_bitmap_bicubic(int imghandle, int xsize, int


ysize);

Remark

Table 21.17: IMG_resize_bitmap_bicubic Function Variables

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

int SNBDAPI IMG_resize_bitmap_interp(int imghandle, int width, int


height);

Remark

Table 21.18: IMG_resize_bitmap_interp Function Variables

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 a FORMAT_NOT_ALLOWED error message for images with a bit-depth of 4. Returns a


PALETTE_IMAGES_NOT_ALLOWED error message for color 8-bit images. May return an OUT_
OF_MEMORY error message. See Appendix E, Snowbound Error Codes for a list of error codes.

Example 21.12: IMG_resize_bitmap_interp

nRes = ::IMG_resize_bitmap_interp(nHandle, rd.m_nHorz, rd.m_


nVert);

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

int SNBDAPI IMG_resize_to_gray(int imghandle, int hres, int vres);

Remark

Table 21.19: IMG_resize_to_gray Function Variables

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

int SNBDAPI IMG_rgb_to_cmyk(int hdib);

Remark

Table 21.20: IMG_rgb_to_cmyk Function Variable

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.

Example 21.13: IMG_rgb_to_cmyk

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

int SNBDAPI IMG_rotate_bitmap(int imghandle, int angle);

Remark

Table 21.21: IMG_rotate_bitmap Function Variables

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.

Example 21.14: IMG_rotate_bitmap

if(nImageHandle>=-1 && nAngle>0)

{
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

int SNBDAPI IMG_set_gamma(int imghandle, int gamma);

Remark

Table 21.22: IMG_set_gamma Function Variables

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

int SNBDAPI IMG_set_lut(int imghandle, int contrast, int bright-


ness);

Remark

Table 21.23: IMG_set_lut Function Variables

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.

Example 21.15: IMG_set_lut

IMG_set_lut( nHandle, _ttoi((LPCTSTR)ad.m_strContrast), _ttoi


((LPCTSTR)ad.m_strBrightness) );

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

int SNBDAPI IMG_sharpen_bitmap(int imghandle, int sharpness);

Remark

Table 21.24: IMG_sharpen_bitmap Function Variables

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.

Example 21.16: IMG_sharpen_bitmap

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

Table 21.25: IMG_window_level Function Variables

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

int SNBDAPI IMGLOW_get_auto_detect(int type);

Remark

Table 21.26: IMGLOW_get_auto_detect Function Variable

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

int SNBDAPI IMGLOW_get_fileinfo_fd(int fh, LPDIB_HEADER lpbi);

Remark

Table 21.27: IMGLOW_get_fileinfo_fd Function Variables

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.

l 1-bit images = 2 entries


l 4-bit images = 16 entrie
l 8/24-bit images = 256 entries

24-bit images have no palettes but the autocolor or rainbow palette is returned.

Syntax

int SNBDAPI IMGLOW_get_palette(int imghandle, char *prgb);

Remark

Table 21.28: IMGLOW_get_palette Function Variables

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.

l 1-bit images = 2 entries


l 4-bit images = 16 entries
l 8/24-bit images = 256 entries

210
Chapter 21 - Image Processing Functions

Syntax

int SNBDAPI IMGLOW_put_palette(int imghandle, char *prgb);

Remark

Table 21.29: IMGLOW_put_palette Function Variables

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

int SNBDAPI IMGLOW_read_pixel(int hdib, int xpos, int ypos);

Remark

Table 21.30: IMGLOW_read_pixel Function Variables

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

int SNBDAPI IMGLOW_set_auto_detect(int type);

Remark

Table 21.31: IMGLOW_set_auto_detect Function Variable

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

int SNBDAPI IMGLOW_set_decompsize(int width, int height);

Remark

Table 21.32: IMGLOW_set_decompsize Function Variables

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

int SNBDAPI IMGLOW_set_decomp_rect(int xstart, int ystart, int


xsize, int ysize);

Remark

Table 21.33: IMGLOW_set_decomp_rect Function Variables

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

int SNBDAPI IMGLOW_set_decomp_reduction(int bits_per_pix);

Remark

Table 21.34: IMGLOW_set_decomp_reduction Function Variable

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

Codes for a list of error codes.

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

int SNBDAPI IMGLOW_set_dithermode(int dither_mode);

Remark

Table 21.35: IMGLOW_set_dithermode Function Variable

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.

Screen Display Dither Mode Constants

Example 21.17: Screen Display Dither Mode Constants

DITHER_NONE 0 /* Allows for Windows to do the color reduction.


This is not recommended, but available. */
DITHER_BAYER 1 /* Uses the Bayer dithering algorithm for color
reduction. */
DITHER_DIFFUSION 2 /* Use error diffusion for color reduction.
*/

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

int SNBDAPI IMGLOW_set_fast_convert(int off_on, int format);

Remark

Table 21.36: IMGLOW_set_fast_convert Function Variables

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

int SNBDAPI IMGLOW_set_imnet_page_size(int xsize, int ysize, int


dpi);

Remark

Table 21.37: IMGLOW_set_imnet_page_size Function Variables

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

int SNBDAPI IMGLOW_set_pcl_input(int dpi, int bits_pix);

Remark

Table 21.38: IMGLOW_set_pcl_input Function Variables

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

int SNBDAPI IMGLOW_unset_auto_detect(int type);

Remark

Table 21.39: IMGLOW_unset_auto_detect Function Variable

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

Chapter 22 - Bit Depth Conversion Func-


tions
This chapter describes the RasterMaster DLL bit depth conversion functions. This chapter con-
tains the following topics:

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

int SNBDAPI IMG_bayer_color(int imghandle);

Remark

Table 22.1: IMG_bayer_color Function Variable

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.

Example 22.1: IMG_bayer_color

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

int SNBDAPI IMG_bayer_mono(int imghandle);

Remark

Table 22.2: IMG_bayer_mono Function Variable

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.

Example 22.2: IMG_bayer_mono

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

int SNBDAPI IMG_color_gray(int imghandle);

Remark

Table 22.3: IMG_color_gray Function Variable

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.

Example 22.3: IMG_color_gray

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

int SNBDAPI IMG_dib_to_runs(int imghandle);

Remark

Table 22.4: IMG_dib_to_runs Function Variable

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

int SNBDAPI IMG_diffusion_color(int imghandle);

Remark

Table 22.5: IMG_diffusion_color Function Variable

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.

Example 22.4: IMG_diffusion_color

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

int SNBDAPI IMG_diffusion_mono(int imghandle);

Remark

Table 22.6: IMG_diffusion_mono Function Variable

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.

Example 22.5: IMG_diffusion_mono

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

int SNBDAPI IMG_halftone_mono(int imghandle);

Remark

Table 22.7: IMG_halftone_mono Function Variable

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

Example 22.6: IMG_halftone_mono

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

int SNBDAPI IMG_mediancut_color(int imghandle);

Remark

Table 22.8: IMG_mediancut_color Function Variable

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.

Example 22.7: IMG_mediancut_color

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

int SNBDAPI IMG_octree_color(int imghandle, int bits_per_pixel,


IMG_RGBQUAD *input_prgb, int entries);

223
Chapter 22 - Bit Depth Conversion Functions

Remark

Table 22.9: IMG_octree_color Function Variables

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.

Example 22.8: IMG_octree_color

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

int SNBDAPI IMG_popularity_color(int imghandle);

Remark

Table 22.10: IMG_popularity_color Function Variable

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.

Example 22.9: IMG_popularity_color

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

int SNBDAPI IMG_runs_to_dib(int imghandle);

Remark

Table 22.11: IMG_runs_to_dib Function Variable

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.

Example 22.10: IMG_runs_to_dib

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

int SNBDAPI IMG_thresh_mono(int imghandle, int thresh);

Remark

Table 22.12: IMG_thresh_mono Function Variables

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

int SNBDAPI IMGLOW_get_filetype_mem(char *filename);

Remark

Table 22.13: IMGLOW_get_filetype_mem Function Variable

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

int SNBDAPI IMGLOW_get_raster(int imghandle, char *destination_ptr,


int ypos, int bytes);

Remark

Table 22.14: IMGLOW_get_raster Function Variables

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

int SNBDAPI IMGLOW_put_raster(int imghandle, char *source_ptr, int


ypos, int bytes);

Remark

Table 22.15: IMGLOW_put_raster Function Variables

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

int SNBDAPI IMGLOW_set_alias_quality(int quality);

Remark

Table 22.16: IMGLOW_set_alias_quality Function Variable

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

Chapter 23 - Document Conversion and


Text Extraction
This chapter describes the functions used for document conversion and text extraction. The
chapter contains the following topics:

Document Conversion and Text Extraction

IMGLOW_extract_text()

IMGLOW_extract_text_mem()

IMG_save_document()

IMG_save_document_mem()

Document Conversion and Text Extraction Overview


The document conversion DLL extracts and converts vector or document file formats such as
AFP/MO:DCA, PCL, and MS Word to vector PDF format. The PDF file will be in a true vector
format, meaning that it will not be in a bitmap format. The PDF file will retain the original text
and graphics commands. Font information such as the font typeface, font height, and bold/Italic
attributes will remain the same. This allows the output PDF file to be created as text search-
able. The PDF file created can be searched for words or phrases with the use of a text search-
ing application.

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.

2. The IMG_save_document() function takes a buffer passed in with text, graphics,


and position information to create the document file output. The output file contains
searchable text. Normally, the IMG_save_bitmap() functions only create a bitmap
file. This only supports the PDF file as an output file. See IMG_save_document() 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 Save Searchable PDF

l Vector_Convert

Syntax

int SNBDAPI IMGLOW_extract_text(char *bm_name, char **ptr, int


*length, int page);

Remarks

Table 23.1: IMGLOW_extract_text Function Variables

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

Table 23.2: Extracted Text Variables

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

int SNBDAPI IMGLOW_extract_text_mem(char *image_ptr, char **ptr,


int *length, int page);

231
Chapter 23 - Document Conversion and Text Extraction

Remarks

Table 23.3: IMGLOW_extract_text_mem Function Variables

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 Save Searchable PDF

l Vector Convert

Syntax

int SNBDAPI IMG_save_document(char *bm_name, void *vbuff, int file-


type);

Remark

Table 23.4: IMG_save_document Function Variables

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

The coordinates system is originated at the upper left.

X - Represents a floating point argument. As in 12.012, all of


these
arguments are in points of 1/72 of an inch.

Text - Represents an ascii string argument.

Note:
Each of the tags below should be followed by a new line.

Example 23.2:STREAM COMMANDS and format of extracted file

%%SOF Start of file


/PageNumber X Page number being extracted.
/PageWidth X Width of page in pixels. (1/72 of an inch)
/PageHeight X Height of page in pixels. (1/72 of an inch)
/Xdpi X Dots-per-inch in the horizontal plane
/Ydpi X Dots-per-inch in the vertical plane
%%EOF Marks the end of this file. No more data to
process.
/Font Start of font data and attributes.
/FontName Text Standard font face name.
/FontHeight X Font height in points (1/72 of an inch).
/FontBold X Set to 1 for bold font otherwise 0.
/FontItalic X Set to 1 for Italic font otherwise 0.
/Xpos X X starting coordinate of text string.
/Ypos X Y starting coordinate of text string.
%%SOT Start of a text string after the carriage return.
Text Data here

233
Chapter 23 - Document Conversion and Text Extraction

%%EOT Ends a text string.


/Image Start of image data and attributes.
/ImageWidth=X Width in pixels of the image data.
/ImageHeight=X Height in pixels of the image data.
/Bitsperpixel=X Number of bits per pixel.
/Compression=Text Compression type used. CCITT_G4, JPEG, or
NONE.
/Length=X Length of binary image data.
%%SOI Starts the binary image data.
Binary data here
%%EOI Ends the binary image data.
/DrawImage Xs Ys Width Height Draws the last defined image at
the
location specified by the arguments.
/Moveto XS YS Moves current graphics drawing position.
/Line XS YS Draws a line from current graphics drawing
position to a location specified by the
arguments.
/Rectangle XS YS WIDTH HEIGHT Draws a rectangle at the spe-
cified
coordinates.
/Curve X1 Y1 X2 Y2 X3 Y3 Draws a curve from the current graph-
ics
drawing position to the end coordinates
using the first 4 arguments as guide
points.

Example 23.3:Save Searchable PDF

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.

You can find this sample in the following directory C:\Program


Files\Snowbound Software\RasterMaster® DLL Evalu-
ation\DLL\Samples.

import Snow.SNBD_SEARCH_RESULT;

public class saveSearchablePdf

public static void main(String[] args) {


String fileName="h:\\testfiles\\input_file.afp";
Snow.Snowbnd snow;

234
Chapter 23 - Document Conversion and Text Extraction

snow = new Snow.Snowbnd();


int[] length = new int[1];
int[] error = new int[1];
int[] errorA = new int[1];
length[0] = 0;
error[0] = 0;
errorA[0] = 0;
SNBD_SEARCH_RESULT[] mSearchResults = null;0

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++) {

byte extractedText[] = snow.IMGLOW_extract_text(fileName,


length,
error,
page);
int saveStatus = 0;

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

int SNBDAPI IMG_save_document_mem(char *image_ptr, char *vbuff, int


filetype);

Remark

Table 23.5: IMG_save_document_mem Function Variables

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

Chapter 24 - AFP Font Mapping Functions


This chapter describes the snbd_map.fnt file and the functions used for AFP font mapping.
The chapter contains the following topics:

AFP Font Mapping

Format of Font Mapping Data

IMGLOW_set_fontmap_path()

IMGLOW_set_fontmap()

AFP Font Mapping


AFP files can use specific fonts to achieve a particular look. If you find that the fidelity of the out-
put for your AFP documents is lacking, particularly in regards to text size and spacing or bar-
codes, then you can customize RasterMaster to use particular fonts when processing your
AFP files. RasterMaster is easy to customize to improve the look of your AFP documents.
Snowbound Software allows you to map the fonts in your AFP/MODCA document to fonts on
your system using a mapping file named snbd_map.fnt. The snbd_map.fnt file is custom craf-
ted to specify the fonts used in your AFP files and on your system. If you provide a rep-
resentative sample AFP document to Snowbound Software by entering a support issue at
http://support.snowbound.com, we will provide you with a custom snbd_map.fnt file usually in
a few business days that will improve the display and print quality of your AFP documents.

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

The following functions allow you to set font mapping:

1. The IMGLOW_set_fontmap_path() function sets the path of the font mapping file. See
IMGLOW_set_fontmap_path() for more information.

2. The IMGLOW_set_fontmap() function programmatically sets the font mapping. See


IMGLOW_set_fontmap() for more information.

Format of Font Mapping Data


Any AFP font name can now be mapped to the following:

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

C0CGT12S,Times New Roman,14,0,1

Table 24.1: Description of a sample entry in the snbd_map.fnt file

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.

Color Documents Rendered as Black and White


AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and
white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in
these documents, you may use IMGLOW_set_document_input(300,24) before calling
IMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information
and using a relatively high resolution of 300 DPI will considerably increase the memory required
to process the document, increase the size of the output document and decrease performance.

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

int SNBDAPI IMGLOW_set_fontmap_path(char *path);

238
Chapter 24 - AFP Font Mapping Functions

Remark

Table 24.2: IMGLOW_set_fontmap_path Function Variables

Variable Description
A string pointer to the path to
look for the snbd_map.fnt file.

The snbd_map.fnt file will be


appended to the path name.
path IMGLOW_set_fontmap_
path("c:\\temp");.

This variable is limited to 50


bytes. Therefore, the path
must be below 50 characters.

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

int SNBDAPI IMGLOW_set_fontmap(char *font_map, int maplength);

Remark

Table 24.3: IMGLOW_set_fontmap Function Variables

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

Chapter 25 - Standard UNIX and XWindows


Specific Functions
This chapter describes the UNIX functions and XWindows-specific functions. These functions
have different arguments from the Windows and Macintosh versions. They do perform sub-
stantially the same function, but the arguments are customized to meet the needs of the host
platform. The chapter contains the following topics:

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

void SNBDAPI *IMG_global_get_Xdisplay(void);

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

int SNBDAPI IMG_global_set_Xdisplay(void *display);

Remark

Table 25.1: IMG_global_set_Xdisplay Function Variable

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

int SNBDAPI IMG_global_get_Xscreen(void *display);

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

int SNBDAPI IMG_global_set_Xscreen(int screen);

Remark

Table 25.2: IMG_global_set_Xscreen Function Variable

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

int SNBDAPI IMG_global_get_Xreserved_colors(void)

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

int SNBDAPI IMG_global_set_Xreserved_colors(int reserved);

Remark

Table 25.3: IMG_global_set_Xreserverd_colors Function Variable

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

int SNBDAPI IMG_repaint_scroll(int imghandle, HWND window, int


scroll_dir, int xrange, int yrange);

Remark

Table 25.4: IMG_repaint_scroll Function Variables

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

int SNBDAPI IMG_scroll_bitmap(int imghandle, HWND window, int ori-


entation, int amount, int xrange, int yrange);

Remark

Table 25.5: IMG_scroll_bitmap Function Variables

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

int SNBDAPI IMG_zoom_bitmap(int imghandle, HWND window, int zoom_


factor, int *x_pos, int *y_pos, int *x_range, int *y_range, int x_
normal, int y_normal);

Remark

Table 25.6: IMG_zoom_bitmap Function Variables

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

int SNBDAPI IMG_zoom_bitmap_1_to_1(int imghandle, HWND Window, int


zoom_level, int center_flag, int *x_pos, int *y_pos, int *x_range,
int *y_range, int x_normal, int y_normal);

Remark

Table 25.7: IMG_zoom_bitmap_1_to_1 Function Variables

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

int SNBDAPI IMG_zoom_bitmap_rect(int imghandle, HWND window, LPIMG_


RECT lprect, int mode, int *x_pos, int *y_pos, int *x_range, int
*y_range);

247
Chapter 25 - Standard UNIX and XWindows Specific Functions

Remark

Table 25.8: IMG_zoom_bitmap_rect Function Variables

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

Chapter 26 - Macintosh High Level and


Image Management Functions
The chapter describes the high level functions as well as several image management functions
for the Macintosh. This chapter contains the following topics:

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

int SNDBDAPI IMG_dib_to_GWorld(int hdib, GWorldPtr, *gWorldRef, int


xsize, int ysize, GWorldFlags flags);

Remark

Table 26.1: IMG_dib_to_GWorld Function Variables

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

int SNDBDAPI IMG_dib_to_GWorld_bitDepth(int hdib, GWorldPtr,


*gWorldRef, int xsize, int ysize, GWorldFlags flags, int bitDepth);

Remark

Table 26.2: IMG_dib_to_GWorld_bitDepth Function Variable

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

int SNBDAPI IMG_GWorld_to_dib(int *hdib, GWorldPtr gWorldPtr);

250
Chapter 26 - Macintosh High Level and Image Management Functions

Remark

Table 26.3: IMG_GWorld_to_dib Function Variables

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

int SNBDAPI IMG_display_bitmap_aspect(int hdib, WindowPtr, theWin-


dow, int xs, int ys, int xsize, int ysize, int zoom, ControlHandle
vertScroll, ControlHandle horizScroll);

Remark

Table 26.4: IMG_display_bitmap_aspect Variables

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

int SNBDAPI IMG_repaint_scroll(int hib, WindowPtr theWindow, int


scroll_dir, Rect *paint)

Remark

Table 26.5: IMG_repaint_scroll Function Variables

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

int SNBDAPI IMG_scroll_bitmap(int handle, WindowPtr theWindow,


Point mouseLocation, ControlHandle vertScroll, ControlHandle hor-
izScroll);

Remark

Table 26.6: IMG_scroll_bitmap Function Variables

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

int SNBDAPI IMG_set_croprect_scroll(int hdib, WindowPtr, the Win-


dow, int xs, int ys, int xe, int ye, int aspect, ControlHandle ver-
tScroll, ControlHandle horizScroll);

Remark

Table 26.7: IMG_set_croprect_scroll Function Variables

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

int SNBDAPI IMG_zoom_bitmap(int handle, WindowPtr the Window, int


zoom, ControlHandle vertScroll, ControlHandle horizScroll);

Remark

Table 26.8: IMG_zoom_bitmap Function Variables

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

int SNBDAPI IMG_zoom_bitmap_rect(int handle, WindowPtr theWindow,


LPIMG_RECT lprect, LPIMG_RECT lplast, int mode, ControlHandle ver-
tScroll, ControlHandle horizScroll);

Remark

Table 26.9: IMG_zoom_bitmap_rect Function Variables

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

int SNBDAPI IMG_zoom_bitmap_1_to_1(int handle, WindowPtr theWindow,


int zoom, int center, ControlHandle vertScroll, ControlHandle hori-
zonScroll);

Remark

Table 26.10: IMG_zoom_bitmap_1_to_1 Function Variables

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

Chapter 27 - Format for Decompressed


Images
This chapter describes the formats for decompressed images. All high-level and low-level func-
tions which decompress or import images convert the data and store it in memory as the MS-
Windows DIB format (Device Independent Bitmap).

The chapter contains the following topics:

Overview of Data Formats

Extended Product

MS_Windows DIB Header Format

MS_Windows DIB Palette Format

MS_Windows DIB Image Data Format

Overview of Data Formats


This DIB format consists of a header (BITMAPINFOHEADER), a palette, and the image data.

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.

RasterMaster Plus Options


typedef short WORD:
typedef unsigned short UWORD;
typedef long DWORD;
typedef unsigned long UDWORD;

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

Example 27.1:RasterMaster Plus Options

For a raster of width 100.

DWORDINT 0 = 24 Total byte count.


DWORDINT 1 = 5 White until pixel 5.
DWORDINT 2 = 10 Black from pixel 5 to pixel 10.
DWORDINT 3 = 100 White to end of raster.
DWORDINT 4 = 100
DWORDINT 5 = 100

MS_Windows DIB Header Format


All images stored in memory start with the following header.

Example 27.2:DIB Header Format

typedef struct tagBITMAPINFOHEADER{


DWORD biSize;- Size of this structure, always 40.
DWORD biWidth;- Width of the image in pixels.
DWORD biHeight;- Height of the image in pixels.
WORD biPlanes;- Always 1. (as per Microsoft)
WORD biBitCount;- Bits per pixel 1,4,8 or 24.
DWORD biCompression;- 0 or 99 for 1 bit runs images.
DWORD biSizeImage;- Height of the image X size of a raster in
bytes.
‘ DWORD biXPelsPerMeter;- Use this field to store dots per
inch.
DWORD biYPelsPerMeter;- Use this field to store dots per inch.
DWORD biClrUsed;- Always set to 0.
DWORD biClrImportant;- Always set to 0.
} BITMAPINFOHEADER;

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.

MS_Windows DIB Palette Format


All images stored in memory except for 24-bit images have a series of the following RGBQUAD
structures. An RGBQUAD structure exists for each possible color.

Image Size RGBQUAD Entries


1-bit 2
4 bit 16
8 bit 256
24-bit No Entries

All images stored in memory have the following palette format:

Example 27.3: DIB Palette Format

typedef struct tagRGBQUAD


{
unsigned char rgbBlue; - Blue entry.
unsigned char rgbGreen; - Green entry.
unsigned char rgbRed; - Red entry.
unsigned char rgbReserved; - Not used. Always set to zero.
}
RGBQUAD;

MS_Windows DIB Image Data Format


1, 4, 8, and 24-bit images are stored as packed uncompressed raster data.

Image Size Byte Size


1-bit 8 pixels
4-bit 2 pixels
8- bit 1 pixel
3 bytes equals 1 pixel, starting with the blue,
24-bit
green, then red values

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

Chapter 28 - Annotation and Redlining


Toolkit
This chapter describes the annotation and redlining toolkit and library.

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.

The chapter contains the following topics:

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

Example 28.1: ANN_GRAPHIC_STRUCT

typedef struct _graphic_struct


{
char FAR *next;
char FAR *prev;
SANN_RECT rc;
char FAR *text;
long edit_hwnd;
long data_size;
long fhmem;
long hmem;
long thmem;
long imghandle;
char font_name[48];
short int italic;
short int bold;
short int font_height;
short int fred;
short int fgreen;
short int fblue;
short int bred;
short int bgreen;
short int bblue;
short int width;
short int height;
short int bits_pix;
short int transp;
short int graphic_id;
short int line_width;
short int line_style;
}
ANN_GRAPHIC_STRUCT;

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

int SNBDAPI SANN_activate_all_objects(int hann);

Remark

Table 28.2: SANN_activate_all_objects Function Variable

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

int SNBDAPI SANN_activate_object(int hann, int graphic_num);

Remark

Table 28.3: SANN_activate_object Function Variables

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

int SNBDAPI SANN_add_object(int hann, int graphic_id, RECT *rc,


char *data, long data_size);

Remark

Table 28.4: SANN_add_object Function Variables

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

int SNBDAPI SANN_choose_color(int hann);

Remark

Table 28.5: SANN_choose_color Function Variable

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

int SNBDAPI SANN_choose_font(int hann);

Remark

Table 28.6: SANN_choose_font Function Variable

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

int SNBDAPI SANN_choose_line_style(int hann);

Remark

Table 28.7: SANN_choose_line_style Function Variable

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

int SNBDAPI SANN_choose_line_width(int hann);

Remark

Table 28.8: SANN_choose_line_width Function Variable

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

int SNBDAPI SANN_create_ann(int width, int height, HWND hWnd);

Remark

Table 28.9: SANN_create_ann Function Variables

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

int SNBDAPI SANN_deactivate_all_objects(int hann);

Remark

Table 28.10: SANN_deactivate_all_objects Function Variable

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

int SNBDAPI SANN_deactivate_object(int hann, int graphic_num);

Remark

Table 28.11: SANN_deactivate_object Function Variables

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

int SNBDAPI SANN_delete_all_objects(int hann);

Remark

Table 28.12: SANN_delete_all_objects Function Variable

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

int SNBDAPI SANN_delete_object(int hann, int graphic_num);

Remark

Table 28.13: SANN_delete_object Function Variables

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

int SNBDAPI SANN_display_annotations(int hann, HDC hDC, int xs, int


ys, int xz, int yz);

Remark

Table 28.14: SANN_display_annotations Function Variables

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

int SNBDAPI SANN_draw_object(int hann, HDC hDC, int graphic_num,


int xs, int ys, int xz, int yz);

Remark

Table 28.15: SANN_draw_object Function Variables

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

Table 28.16: SANN_get_croprect Function Variables

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

int SNBDAPI SANN_get_object_bounds(int hann, int graphic_num, RECT


FAR *rc);

Remark

Table 28.17: SANN_get_object_bounds Function Variables

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

int SNBDAPI SANN_get_object_data(int hann, int graphic_num, char


*data);

Remark

Table 28.18: SANN_get_object_data Function Variables

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

ANN_GRAPHIC_STRUCT SANN_get_object_info(int hann, int graphic_num);

270
Chapter 28 - Annotation and Redlining Toolkit

Remark

Table 28.19: SANN_get_object_info Function Variables

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

int SNBDAPI SANN_get_object_num(int hann, HWND hWnd, int xpos, int


ypos);

Remark

Table 28.20: SANN_get_object_num Function Variables

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

int SNBDAPI SANN_highlight_object(int hann, HWND hWnd, int graphic_


num);

Remark

Table 28.21: SANN_highlight_object Function Variables

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

int SNBDAPI SANN_map_image_to_wnd(int hann, RECT *disprect, int FAR


*xs, int *ys);

Remark

Table 28.22: SANN_map_image_to_wnd Function Variables

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

int SNBDAPI SANN_map_wnd_to_image(int hann, RECT *disprect, int FAR


*xs, int *ys);

Remark

Table 28.23: SANN_map_wnd_to_image Function Variables

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

int SNBDAPI SANN_merge_ann(char *filename, int hann);

Remark

Table 28.24: SANN_merge_ann Function Variables

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

int SNBDAPI SANN_mouse(HWND hWnd, UINT msg, WPARAM wParam, LPARAM


lParam, int hann, int *graphic_id, char *textbuff);

Remark

Table 28.25: SANN_mouse Function Variables

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

int SNBDAPI SANN_move_object(int hann, int graphic_num, RECT *rc);

Remark

Table 28.26: SANN_move_object Function Variables

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

int SNBDAPI SANN_print_annotations(int hann, HDC hDC, int xs, int


ys, int xz, int yz);

Remark

Table 28.27: SANN_print_annotations Function Variables

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

int SNBDAPI SANN_read_ann(char *filename, HWND hWnd);

Remark

Table 28.28: SANN_read_ann Function Variables

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

int SNBDAPI SANN_resize_object(int hann, int graphic_num, int RECT


FAR *rc);

Remark

Table 28.29: SANN_resize_object Function Variables

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

int SNBDAPI SANN_rotate(int hann, int angle);

Remark

Table 28.30: SANN_rotate Function Variables

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

int SNBDAPI SANN_set_bcolor(int hann, int red, int green, int


blue);

Remark

Table 28.31: SANN_set_bcolor Function Variables

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

Table 28.32: SANN_set_croprect Function Variables

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

int SNBDAPI SANN_delete_flag(int on_off);

Remark

Table 28.33: SANN_delete_flag Function Variable

Variable Description
0 = on
on_off
1 = off

SANN_set_fcolor()
This function sets the current foreground drawing color for all graphics.

Syntax

int SNBDAPI SANN_set_fcolor(int hann, int red, int green, int


blue);

Remark

Table 28.34: SANN_set_fcolor Function Variables

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

int SNBDAPI SANN_set_font(int hann, char *name, int italic, int


bold, int font_height);

Remark

Table 28.35: SANN_set_font Function Variables

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

int SNBDAPI SANN_set_line_style(int hann, int style);

Remark

Table 28.36: SANN_set_line_style Function Variables

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

int SNBDAPI SANN_set_line_width(int hann, int width);

Remark

Table 28.37: SANN_set_line_width Function Variables

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

int SNBDAPI SANN_set_size(int hann, int width, int height);

Remark

Table 28.38: SANN_set_size Function Variables

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

int SNBDAPI SANN_write_ann(int hann, char *filename, int extra_


size, char *extra_data);

Remark

Table 28.39: SANN_write_ann Function Variables

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:

Table 28.40: Annotation Constants

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

Chapter 29 - Working with PDF and Other


Document File Formats
This chapter describes how to work with PDF and other document file formats in Snowbound
Software’s RasterMaster Imaging SDK products. The chapter contains the following topics:

Working with Document File Formats

Reading and Writing Support for PDF File Formats

Reading or Decompressing a PDF Document

Saving to a PDF Document

Changing Output Page Size

Performance

Working with Document File Formats


Snowbound Software supports many document file formats in most of its viewing, converting,
and RasterMaster SDK products.

The supported file formats include:

l PDF - Adobe portable file


l PCL - Hewlett Packard printer format
l DOC - Microsoft Word processor format
l XLS - Microsoft Excel spreadsheet format
l PPT - Microsoft PowerPoint presentation format
l RTF - Rich text file format
l AFP and MODCA - IBM advanced printing format

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

Table 29.1: IMGLOW_set_document_input Function Variable

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);

Table 29.2: IMGLOW_set_pdf_output Function Variables

Variable Description
double xsize Width of image in points.
double ysize Height of image in points.

Reading and Writing Support for PDF File Formats


Reading and writing support for PDF formats is included in the following RasterMaster Imaging
SDK products:

l RasterMaster Imaging SDK for Windows DLL


l RasterMaster Imaging SDK for ActiveX
l RasterMaster Imaging SDK for .NET
l RasterMaster Imaging SDK for the Java™ Platform

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

Reading or Decompressing a PDF Document


To read in or decompress a PDF document, use any of the decompression calls such as IMG_
decompress_bitmap(). For ActiveX, use the Image property. All RasterMaster Imaging
SDK products automatically detect the file format and do not use the extension on the file
name.

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.

Saving to a PDF Document


All RasterMaster Imaging SDK products support writing PDF files. To save a file as PDF, use
any of the saving calls such as IMG_save_bitmap() with the file format set to PDF or the file
type constant number 59.

Working with Black and White Images

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.

Working with Color Images

For color bitmaps, a PDF will be created with JPEG compression.

Changing Output Page Size


The default page size is set to 8.5 x 11. The bitmap image saved is centered at this page. To
alter the output page size use the call IMGLOW_set_pdf_output. For RasterMaster Imaging
SDK for ActiveX, use the PdfXPageSize and PdfYPageSize properties. The double
xsize and double ysize parameters are the page size in points or 1/72 of an inch.

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

Appendix A - Supported File Formats


This appendix describes the file type number and read/write capabilities of all 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.

Table A.1: File Format Key

File Format Description


1-bit Black and white or monochrome images
Grayscale images, that may appear to be black and
4-bit, 8-bit, 16-bit white, but contain much more information, and are much
larger than 1-bit
8-bit, 16-bit,24-bit, 32-bit Full color images

When saving to a format, if the error returned is PIXEL_DEPTH_UNSUPPORTED (-21), the


output format does not support the current bits per pixel of the image you are trying to save. The
chart below will help you identify formats with compatible bit depths.

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.

Descriptions of Supported File Formats


You can find out the format of any file by calling IMGLOW_get_filetype(). It will return a file type
number which you can look up in Table A-2.

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.

Table A.2: Supported File Format Descriptions

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
IBM image compression for scanned checks.
ABIC (reading) * 46 1 1 Note: Not yet supported with RasterMaster
.NET x64 or RasterMaster DLL x64.
AFP (MO:DCA) * 74 1, 24 1 See MO:DCA. This is a multi-page file format.
Snowbound reads in ASCII text files and con-
verts them to a bitmap. The ASCII text format
is not auto-detected by default. You may get a
-7 FORMAT_NOT_ALLOWED error when trying
ASCII 38 1 No 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.
BMP_ Originated by Microsoft, BMP supports 1, 4,
12 4, 8 4, 8
COMPRESSED 8, and 24-bit images.
BMP_
1, 4, 8, 1, 4, 8, Originated by Microsoft, BMP supports 1, 4,
UNCOMPRESSE- 1
16, 24 16, 24 8, and 24-bit images.
D
BROOK_TROUT 29 1 1 Brooktrout FAX format.

CALS 18 1 1 Government specified format.

Group 3 compression for bitonal (1-bit) image


CCITT_G3 33 1 1
data.

Group 3 compression for bitonal (1-bit) image


CCITT_G3_FO 53 1 1
data.

Group 4 compression for bitonal (1-bit) image


CCITT_G4 34 1 1
data.

Group 4 compression for bitonal (1-bit) image


CCITT_G4_FO 52 1 1
data.
Compact Font Format is a lossless com-
CFF 83 1 , 8, 24 1 , 8, 24 paction of the Type 1 format using Type 2
charstrings. It is designed to use less storage

285
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
space than Type 1 fonts by using operators
with multiple arguments, various pre-defined
default values, more efficient allotment of
encoding values and shared subroutines
within a FontSet (family of fonts).
Camera Image File Format is a raw image
CIFF 81 1 , 8, 24 1 , 8, 24
format designed by Canon.

Check Image Management System.


CIMS (ABIC) 80 1 No
Developed by Carreker. Same as ABIC.
1, 4, 8, 1, 4, 8,
CLIP 27 Microsoft Windows clipboard format.
24 24, 32
COD 72 1 No Liberty IMS black and white format.
Cut images are only 8 bits per pixel and the
CUT 31 8 No palette is stored in a separate file. Originated
by Media Cybernetics.
The DCS format is a standard Quark Express
DCS 62 32 32 Format. Each plane is stored as an EPS
record.
Intel created this format as a multi-page .PCX
1, 4, 8, format. Each page is a .PCX file in whole
DCX 11 1, 4, 8, 24
24 which can be 1, 4, 8, and 24-bit. This is a
multi-page file format.
1, 4, 8, 1, 4, 8, Standard Windows Device Independent Bit-
DIB 48
24 16, 24, 32 map. Supports 1, 4, 8 and 24-bits.

Medical image format supporting 1, 12, 16,


DICOM 55 8, 16, 24 No
and 24 pixel images.
Microsoft Word format. Supports Microsoft
Word 97, version 8 or later. Supports 1-bit
images. Cannot decompress (view) doc-
ument while open in MS Word. The following
features have not yet been implemented:
right-to-left text flow, underlined URLs, sec-
1, 8, 24,
DOC * 86 No tion and paragraph borders and shading, text
32
boxes, multi-column paragraph, Windows
Meta Files (WMF) clip art, autoshapes, and
embedded OLE objects. Inconsistencies
exist between MS Word and the Word plugin
with regards to character and line spacing.
Reading support only.This is a multi-page file

286
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth

format.

The .docx format is part of a family of open


office XML-based formats developed by
Microsoft. It is the default document format
1, 8, 24,
DOCX * 93 No for saving applications in Microsoft Word start-
32
ing with Office 2007. It is based on XML rather
than Microsoft’s .doc format. Reading support
only. This is a multi-page file format.
Autodesk® AutoCAD® format. Used for com-
puter aided design (CAD) data and metadata.
DWG 90 0 24
Note: Not yet supported with RasterMaster
.NET x64 or RasterMaster DLL x64.
Autodesk® AutoCAD® format. Used for com-
puter aided design (CAD) data and metadata.
DXF 91 0 24 See the following, for the full specification:
http://usa.autodesk.com/adsk/servlet/item?
siteID=123112&id=8446698

EMAIL * 89 1 1 E-mail message created with MS Outlook.

Encapsulated Postscript originated by Adobe.


Postscript is an interpreted language. Snow-
1, 4, 8, 1, 8, 24, bound does not support full Postscript but will
EPS (preview) 14
24 32 extract an embedded .TIF file in the image.
Sometimes called a bitmap representation
file.
EPS Compressed bitmap format. It is an
11, 8, 24,
EPS_BITMAP 63 8, 24, 32 Adobe encapsulated Postscript file with either
321
G4 or JPEG data embedded.

EPS Compressed bitmap format. It is an


1, 8, 24,
EPS_BITMAP_G4 64 No Adobe encapsulated Postscript file with either
321
G4 or JPEG data embedded.

1, 8, 24, EPS Compressed bitmap format. It is an


EPS_BITMAP_
69 No 321, 8, Adobe encapsulated Postscript file with either
LZW
24, 32 G4 or JPEG data embedded.

FILENET 78 1 1 Image format developed by FileNet Cor-

287
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth

poration for viewing documents.

24-bit tiled JPEG format that includes multiple


FLASHPIX 54 8, 24 No
resolution images.

Created by CompuServe for compressing 2,


2, 3, 4,
GIF 4 4, 8 3, 4, 5, 6, 7, and 8-bit palette images. Uses
5, 6, 7, 8
the LZW algorithm.
1, 2, 3,
GIF_ Same as GIF except stores the raster data in
44 4, 5, 6, 4, 8
INTERLACED an interlaced order.
7, 8
Originated by Brightbill Roberts for ShowPart-
ner DOS applications. Supports 4 and 8-bit
GX2 22 4, 8 No
images. Simple run length encoding tech-
nique.

Hyperlink Text Markup Language (HTML) is a


tag-based language used to create doc-
HTML * 82 0 24 uments for the Web. HTML forms are often
used to capture information from web sites.
Full HTML, Javascript and CSS support.

Microsoft icon format. Contains a standard


ICONTYPE 25 1, 4 No device independent bitmap. Supports 1 and 4
bits uncompressed.

Used on the Commodore Amiga computers


1, 4, 8,
IFF_ILBM 26 1, 4, 8, 24 for native bitmap format. Uses a run length
24
format for 1, 4, and 8-bit palette images.
Originated by Digital Research for storing 1-
IMG 28 1 No
bit images.
IMNET 42 1 No IMNET G4 compressed format.
Image object content architecture. IBM format
which uses CCITT G3, G4, and IBM MMR
IOCA (MO:DCA) * 24 1, 24 1
formats. 1-bit only. This is a multi-page file
format.
Joint bi-level Image Experts Group. This is a
1 (with highly compressed format which is stored in a
JBIG * 71 1
plugin) * TIFF header. It supports 1 or 8-bit gray scale
images.

JBIG2 77 1 1 (with JBIG2 is a highly-compressed black and

288
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
white image format that uses symbol recog-
nition and substitution for very dramatic com-
pression results. Snowbound's viewers and
conversion programs can be used to directly
plugin) * view JBIG2 documents or convert those doc-
uments to a variety of output formats.

Note: Not yet supported with RasterMaster


.NET x64 or RasterMaster DLL x64.
US Military CCITT G4 tiled image format for
JEDMICS 56 1 1 storing Government documents and draw-
ings. Supports 1-bit per pixel.
Joint Photographics Experts Group. This was
a group spearheaded by Kodak for 24, 32, and
8-bit gray scale lossy compression. This is by
JPEG 13 8, 24, 32 8, 24, 32
far the best compression available for these
types of images supported in the current
Snowbound library.
JPEG 2000 specification. This is similar to
JPEG but produces much better compression
JPEG2000 * 70 8, 24 8, 24 with better quality. It is supported as a sep-
arate plugin. An option exists to set the com-
pression level for saving.

KOFAX 23 1 No Kofax Format.

Compression for documents originated by


LASERDATA 19 1 No
LaserData Corp. 1-bit images only.

Presents data for each variable on a single


LINE_DATA 75 1 1
line.

Original Apple bitmap file format. All MacPaint


MACPAINT 21 1 No
images are 720 x 576 pixels 1 bit.

MAG 61 1 No Mag Format.


Image object content architecture. IBM format
which uses CCITT G3, G4, and IBM MMR
MODCA_IOCA * 49 1, 24 1
formats. 1-bit only. This is a multi-page file
format.
Microsoft Paint program bitmap file format.
MSP 30 1 No Supports 1-bit images. Uses a type of RLE
compression found also in compressed .BMP

289
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth

files.

NCR 65 1 No A simple header with CCITT group 4 data.


Open Document Format is an XML-based file
format for representing electronic documents
ODF 98 No No
such as spreadsheets, charts, presentations
and word processing documents.
ODP 101 No No Open Document Format for presentations.

ODS 97 No No Open Document Format for spreadsheets.


Open Document Format for word processing
ODT 96 No No
(text) documents.
Office Open Extended Markup Language or
Office Open XML (also informally known as
OOXML or OpenXML) is a zipped, XML-
based file format developed by Microsoft for
OOXML * 94 No No
representing spreadsheets, charts, present-
ations and word processing documents that is
intended for use with the 2007 and later ver-
sions of the Microsoft Office suite.
Hewlett Packard printer file format. Support
PCL_1 (with plu- for color and grayscale output. Supported as a
57 1, 24 1
gin) * separate plugin. This is a multi-page file
format.
Hewlett Packard printer file format. Raster-
PCL_1 (without plu- Master converts all images to a 1-bit raster
57 No 1
gin) * image. Supported as a separate plugin. This
is a multi-page file format.
Hewlett Packard printer file format. Support
PCL_5 * 76 No 1 for color and grayscale output. This is a multi-
page file format.
Zsoft bitmap file format. Similar to pack bits
1, 4, 8,
PCX 2 1, 4, 8, 24 compression. Supports 1, 4, 8, and 24-bit
24
images.
Portable Document Format. File format
1, 2, 4, developed by Adobe to capture formatting
PDF(with plugin) * 59 8, 16, 1, 24 information from a variety of desktop pub-
24, 32 lishing applications. It allows the user to send
formatted documents and have them appear

290
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
on the recipient's monitor or printer as they
were intended. Compatible with the PDF/A
specification and conforms to PDF v1.4.
Does not currently support JPEG2000 in PDF
for Java. Supports some types of Adobe spe-
cified PDF annotations, however does not
support XFA annotations. Does not support
corrupt PDF documents. Snowbound Soft-
ware requires that the fonts needed be avail-
able on the system. This is a multi-page file
format.
Portable Document Format. File format
developed by Adobe to capture formatting
information from a variety of desktop pub-
lishing applications. It allows the user to send
formatted documents and have them appear
on the recipient's monitor or printer as they
PDF (without plu- were intended. Compatible with the PDF/A
59 No 1, 24
gin) specification. Supports some types of Adobe
specified PDF annotations, however does not
support XFA annotations. Does not support
corrupt PDF documents. Snowbound Soft-
ware requires that the fonts needed be avail-
able on the system. This is a multi-page file
format.
Portable Document Format. File format
developed by Adobe to capture formatting
information from a variety of desktop pub-
lishing applications. It allows the user to send
formatted documents and have them appear
on the recipient's monitor or printer as they
were intended. Compatible with the PDF/A
specification. Supports some types of Adobe
PDF_15 79 No 1, 24 specified PDF annotations, however does not
support XFA annotations. Does not support
corrupt PDF documents. Snowbound Soft-
ware requires that the fonts needed be avail-
able on the system. This is a multi-page file
format.

Note: Only supported with RasterMaster


.NET or RasterMaster DLL. This format is not
yet supported in Rastermaster Java.

291
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
Portable Document Format. File format
developed by Adobe to capture formatting
information from a variety of desktop pub-
lishing applications. It allows the user to send
formatted documents and have them appear
on the recipient's monitor or printer as they
were intended. Compatible with the PDF/A
specification. Supports some types of Adobe
PDF_16 92 No 1, 24 specified PDF annotations, however does not
support XFA annotations. Does not support
corrupt PDF documents. Snowbound Soft-
ware requires that the fonts needed be avail-
able on the system. This is a multi-page file
format.

Note: Only supported with RasterMaster


.NET or RasterMaster DLL. This format is not
yet supported in Rastermaster Java.
Kodak photo CD format. Supports only 24-bit
images. This format contains at least 5
images. Get these images as you would a
multi-page file format.

Page 0 - 768 x 512

Page 1 - 384 x 256

Page 2 - 192 x 128


PhotoCD 39 24 No Page 3 - 1536 x 1024

Page 4 - 3072 x 2048

Images are uncompressed until the 1536 x


1024 images or greater. All images are stored
as YCC data which is luminance then blue
and red chrominance channels. The large
image must be built from the smaller images
by interpolation then adding the residual data
stored by Huffman encoding.
Adobe Photoshop format for storing 1, 4, 8,
1, 4, 8, 1, 8, 24, 16, 24, and 32-bit images. Can be com-
Photoshop 41
24, 32 32 pressed or uncompressed. Images may also
be stored as CMYK data or RGB.

1, 2, 4, Apple Macintosh bitmap file format. These


PICT 15 1, 4, 8, 24 images may contain vector information such
8, 16,

292
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth

as lines and circles. Only the bitmap portion of


data is decompressed. Uses pack bits com-
24, 32
pression. Supports 1, 2, 3, 4, 8, 16, 24, and
32-bit images.

Originated by CompuServe to replace the


1, 4, 8, .GIF file format. Uses the Huffman encoding
1, 4, 8,
PNG 43 16, 24, variant. Supports 1, 4, 8, 15, 16, 24, and 32-bit
16, 24, 32
32 images. Also supports interlaced and trans-
parency.
Microsoft PowerPoint Binary File Format
which is the binary file format used by
1, 8, 24, Microsoft PowerPoint 97, Microsoft Power-
PPT * 85 No
32 Point 2000, Microsoft PowerPoint 2002, and
Microsoft Office PowerPoint 2003. Reading
support only. This is a multi-page file format.
The .pptx format is part of a family of open
office XML-based formats developed by
Microsoft. It is the default document format
1, 8, 24, for saving applications in Microsoft Power-
PPTX * 100 No
32 Point starting with Office 2007. It is based on
XML rather than Microsoft's .ppt format. Read-
ing support only. This is a multi-page file
format.
Sun raster format. Supports 1, 8, 24, and 32-
RAST 37 1, 8, 24 1, 8, 24
bits. Run length encoded format.
The Rich Text Format is a method of encod-
1, 8, 24, ing formatted text and graphics for easy trans-
RTF * 87 No
32 fer between applications. This is a multi-page
file format.
The SCITEX format is a proprietary format ori-
ginated from SCITEX Corporation. Gray scale
SCITEX 60 24, 32 24, 32
color and CMYK color images. Usually com-
pressed.
8, 16, 8, 16, 24, The SCITEX format is a proprietary format ori-
TARGA 3
24, 32 32 ginated from SCITEX Corporation.

The SCITEX format is a proprietary format ori-


TARGA16 32 16 24, 32
ginated from SCITEX Corporation.
Tagged image file format. Created by an inde-
TIFF_2D 17 1 No pendent group and was supported by Aldus.

293
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
.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. This is a multi-page
file format.
TIFF file with Arithmetic Binary encoding.
Requires a special ABIC version of our tools.
Very popular for check imaging. BW is used
TIFF_ABIC 46 4, 8 No
for 1-bit bi-level and TIFF_ABIC is for 4-bit
gray scale images. This is a multi-page file
format.
TIFF file with Arithmetic Binary encoding.
Requires a special ABIC version of our tools.
Very popular for check imaging. BW is used
TIFF_ABIC_BW 47 1 No
for 1-bit bi-level and TIFF_ABIC is for 4-bit
gray scale images. This is a multi-page file
format.
ANSI baseline Group 3 or Group 4 com-
TIFF_G3_FAX 8 1 1 pression embedded in a TIFF. This is a multi-
page file format.
ANSI baseline Group 3 or Group 4 com-
TIFF_G4_FAX 10 1 1 pression embedded in a TIFF. This is a multi-
page file format.
ANSI baseline Group 3 or Group 4 com-
TIFF_G4_FAX_FO51 1 1 pression embedded in a TIFF. This is a multi-
page file format.
ANSI baseline Group 3 or Group 4 com-
TIFF_G4_FAX_
67 No 1 pression embedded in a TIFF. This is a multi-
STRIP
page file format.
TIFF file compressed using the Huffman com-
TIFF_HUFFMAN 7 1 1 pression algorithm. This is a multi-page file
format.
Standard ANSI baseline JBIG compression
TIFF_JBIG 66 1 1 embedded in a TIFF. This is a multi-page file
format.
TIFF_JPEG
Standard ANSI baseline JPEG embedded in a
If you have issues 40 8, 24 8, 24, 32
TIFF. This is a multi-page file format.
viewing, please

294
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth
see Appendix F,
Troubleshooting.
Black and white gray scale format. This is a
TIFF_JPEG7 73 1, 8 1, 8
multi-page file format.
TIFF file compressed using the LZW com-
pression algorithm. The LZW algorithm
1, 4, 8, 1, 4, 8,
TIFF LZW 9 includes the look-up table of codes as part of
24, 32 16, 24, 32
the compressed file. This is a multi-page file
format.
1, 4, 8,
Simple run length encoding algorithm. This is
TIFF_PACK 16 16, 24, 1, 8
a multi-page file format.
32
TIFF 1, 2, 4,
1, 4, 8, Uncompressed raw binary data. This is a
UNCOMPRESSE- 0 8, 16,
16, 24, 32 multi-page file format.
D 24, 32
Snowbound reads in ASCII text files and con-
verts them to a bitmap. The ASCII text format
is not auto-detected by default. You may get a
-7 FORMAT_NOT_ALLOWED error when trying
TXT 38 1 No 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.
WBMP 68 1 1 Windows file format for wireless devices.
A simple header with CCITT group 3 com-
WINFAX 58 1 No
pression.
Microsoft Windows Metafile format. These
may contain vector information such as lines
and circles. Only the bitmap data is extracted.
1, 4, 8, 1, 4, 8,
WMF 6 This is in the form of a standard windows
24 16, 24, 32
DIB. May be 1, 4, 8, and 24-bit. The 4 and 8-
bit images may be compressed using
Microsoft RLE compression as in .BMP files.

WordPerfect’s metafile format. This is similar


1, 4, 8, to the WMF file format in that it may contain
WPG 5 1, 4, 8
24 vector information. Supports 1, 4, 8, and 24-
bit images. Only the bitmap data is extracted.

Xwindows file format which encodes each


XBM 20 1 1
pixel as an ASCII byte. Only supports 8-bits

295
Appendix A - Supported File Formats

File Input Output


File Format Type Bit Bit Description
Number Depth Depth

per pixel.

Xerox_EPS 45 1 No Encapsulated Postscript for Xerox.

Microsoft Excel Spreadsheet format for struc-


turing and analyzing data. This is the binary
1, 8, 24, file format used by Microsoft Excel 97,
XLS * 84 No
32 Microsoft Excel 2000, Microsoft Excel 2002,
and Microsoft Office Excel 2003. Reading sup-
port only. This is a multi-page file format.
The .xlsx format is part of a family of open
office XML-based formats developed by
Microsoft. It is the default document format
1, 8, 24,
XLSX * 95 No for saving applications in Microsoft Excel
32
starting with Office 2007. It is based on XML
rather than Microsoft's .xls format. Reading
support only. This is a multi-page file format.
Xwindows bitmap file format stored as ASCII
XPM 35 1, 4, 8 8
data. Each pixel is stored as an ASCII byte.

1, 8, 24, UNIX XWD Raster format. Each pixel is


XWD 36 1, 4, 8
32 stored as an ASCII byte.

* = optional only

File Type Constants Listed by File Type Number


Table A.3: File Type Constants listed by File Type Number

File Type Number File Type Name


0 TIFF_UNCOMPRESSED
1 BMP_UNCOMPRESSED
2 PCX
3 TARGA
4 GIF
5 WPG
6 WMF
7 TIFF_HUFFMAN
8 TIFF_G3_FAX

296
Appendix A - Supported File Formats

File Type Number File Type Name


9 TIFF_LZW
10 TIFF_G4_FAX
11 DCX
12 BMP_COMPRESSED
13 JPEG
14 EPS
15 PICT
16 TIFF_PACK
17 TIFF_2D
18 CALS
19 LASER_DATA
20 XBM
21 MACPAINT
22 GX2
23 KOFAX
24 IOCA
25 ICONTYPE
26 IFF_ILBM
27 CLIP
28 IMG
29 BROOK_TROUT
30 MSP
31 CUT
32 TARGA16
33 CCITT_G3
34 CCITT_G4
35 XPM
36 XWD
37 RAST
38 ASCII
39 PHOTOCD
40 TIFF_JPEG
41 PHOTOSHOP
42 IMNET
43 PNG
44 GIF_INTERLACED
45 Xerox_EPS
46 TIFF_ABIC
47 TIFF_ABIC_BW
48 DIB
49 MO:DCA_IOCA
51 TIFF_G4_FAX_FO
52 CCITT_G4_FO
53 CCITT_G3_FO

297
Appendix A - Supported File Formats

File Type Number File Type Name


54 FLASHPIX
55 DICOM
56 JEDMICS
57 PCL_1
58 WINFAX
59 PDF
60 SCITEX
61 MAG
62 DCS
63 EPS_BITMAP
64 EPS_BITMAP_G4
65 NCR
66 TIFF_JBIG
67 TIFF_G4_FAX_STRIP
68 WBMP
69 EPS_BITMAP_LZW
70 JPEG2000
71 JBIG
72 COD
73 TIFF_JPEG7
74 AFP
75 LINE_DATA
76 PCL_5
77 JBIG2
78 FILENET
79 PDF_15
80 CIMS
81 CIFF
82 HTML
83 CFF
84 XLS
85 PPT
86 DOC
87 RTF
88 PDF_LZW
89 EMAIL
90 DWG
91 DXF
92 PDF_16
93 DOCX
94 OOXML
95 XLSX
96 ODT
97 ODS

298
Appendix A - Supported File Formats

File Type Number File Type Name


98 ODF
100 PPTX
101 ODP

299
Appendix B - Software Installation

Appendix B - Software Installation


This appendix describes how to install the evaluation or full copy of the RasterMaster DLL Ima-
ging SDK software. The appendix contains the following topics:

Overview of the Installation Process

Installing the Software

Directory Structure

Installed Files

Overview of the Installation Process


RasterMaster DLL is easy to install as an evaluation, developer, or run-time version. The eval-
uation copy is delivered as a .zip archive that can be manually extracted to an installation dir-
ectory chosen by the user.

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.

When a distribution license is purchased, all banners disappear.

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.

Redistributing Snowbound Files

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.

What to Expect When Installing an Evaluation Version


Your evaluation is a full version of the product with the following limitations:

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.

What to Expect in a Production Version


When you purchase RasterMaster DLL, you will receive a set of fully licensed binary files. The
files will include snbd*.dll and .lib and .dlls for each purchased option. Please see Installed Files
for a list of the files installed with RasterMaster DLL

Installing the Production Version of RasterMaster DLL


Install and configure the evaluation version of the product on your target production system.
Ensure it is working as you intended. Extract the binary files from the production version pack-
age and use those to replace the same files in the evaluation version that you have installed.
Once the production files are in place you will no longer see banners or Xs. You will only see
expiration messages if you try to view a document of a type that you did not purchase, for
example MS Office or AFP/MO:DCA.

301
Appendix B - Software Installation

Installing the Software

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.

To install RasterMaster DLL:

1. Double-click on the downloaded executable. In this example, double-click on Snow-


bound-RMExtDLL.exe to display the DLL Setup dialog.

2. After reading the dialog, click Next to display the License Agreement dialog.

302
Appendix B - Software Installation

3. Read the license agreement.

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

8. Once installation is complete, the Setup Complete dialog displays.


9. Click Finish to complete the 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.

Main Directory Files

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.

Table B.1: RasterMaster DLL Default Directory Files

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.

Docs Directory Files

The files installed into the Docs directory are defined in Table B-2.

Table B.2: RasterMaster DLL Imaging SDK Docs Directory Files

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.

Marketing Directory Files

The files installed into the Marketing directory are defined in Table B-3.

Table B.3: RasterMaster DLL Marketing Directory Files

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.

Sample Directory Files

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

Table B.4: RasterMaster DLL MFC_Sample Directory

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.

Table B.5: RasterMaster DLL Imaging SDK C_Samples Directory

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

Scroll through an image

Rotate to screen and Rotate to


screen
aspect
Convert screen coordinates to
images coordinates

Use display with corrected


aspect ratio

See Aspect for more inform-


ation.
Sample showing how to use
callback
Snowbound Image Library for

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

Scroll through an image

310
Appendix B - Software Installation

Sample Description
Rotate to screen

See Zoom for more information.

311
Appendix C - RasterMaster DLL Samples

Appendix C - RasterMaster DLL Samples


This appendix describes the samples available with the RasterMaster DLL.

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.

The appendix contains the following sample topics:

Alpha

Animate

Annotate

Aspect

Callback

Encrypt

Fit

Format Conversion

Load

MFC_Sample

MFC_TextSearch_TextExtract_Sample

Multi-page Splitting and Saving

OCR

Page

Print

Save Searchable PDF

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL into memory.

IMG_unload_lib() removes DLL from memory.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_decompress_bitmap() loads an image from the disk.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_repaint_scroll() repaints the area after scrolling.

IMG_bitmap_palette() forces the image palette to be used as the system palette.

IMG_scroll_bitmap() scrolls bitmap.

IMG_display_bitmap_aspect() displays the current bitmap with corrected aspect ratio.

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL into memory.

IMG_unload_lib() removes DLL from memory.

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.

IMGLOW_get_fileinfo() gets information about an image by filling in the lpbih structure.

IMGLOW_get_tiff_tag() reads a TIFF tag from the file specified.

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL into memory.

IMG_unload_lib() removes DLL from memory.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_get_croprect() returns the crop rectangle for the image handle.

IMG_repaint_scroll() repaints the area after scrolling.

IMG_bitmap_palette() forces the image palette to be used as the system palette.

IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.

IMG_scroll_bitmap() scrolls bitmap.

IMG_set_statusbar() turns callbacks for implementing the status bar.

IMG_print_bitmap() prints the image.

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

IMG_bitmap_info() obtains information about the decompressed image.

IMG_decompress_bitmap() loads an image from disk.

314
Appendix C - RasterMaster DLL Samples

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_rotate_bitmap() rotates image data.

IMG_set_display_angle() forces rotation of the image at display time only.

IMG_repaint_scroll() repaints the area after scrolling.

IMG_bitmap_palette() forces the image palette to be used as the system palette.

IMG_scroll_bitmap() scrolls bitmap.

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.

IMG_get_croprect() returns the crop rectangle for the image handle.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

IMGLOW_map_wnd_to_image() translates window coordinates to image coordinates for the


displayed image.

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL into memory.

IMG_unload_lib() removes DLL from memory.

IMG_ifl_version() gets the version number.

IMGLOW_decompress_bitmap() gets raw image data from the callbacks.

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL into memory.

315
Appendix C - RasterMaster DLL Samples

IMG_unload_lib() removes DLL from memory.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_bitmap_palette() forces image palette to be used as the system palette.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_save_bitmap() saves the image to disk in any desired format.

IMG_display_bitmap_transp() displays transparent GIF images.

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.

Listed below are the functions used in this sample.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_bitmap_palette() forces the image palette to be used as the system palette.

IMG_display_bitmap() displays the image.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_repaint_scroll() repaints the area after scrolling.

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.

IMG_scroll_bitmap() scrolls bitmap.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

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

Listed below are the functions used in this sample.

IMG_decompress_bitmap() loads an image from disk.

IMG_save_bitmap() saves the image to disk in any desired format.

IMGLOW_get_filetype() returns the image file type Snowbound integer.

IMG_bitmap_info() obtains information about the decompressed image.

IMGLOW_get_pages() retrieves the page count of an image file.

IMG_decompress_bitmap_fd() loads an image from the currently open file handle.

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.

Listed below are the functions used in this sample.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_bitmap_palette() forces the image palette to be used as the system palette.

IMG_display_bitmap() displays the image.

IMG_bitmap_info() obtains information about the decompressed image.

IMGLOW_set_alias() effectively displays the scaled-down 1-bit and color images.

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.

Listed below are the functions used in this sample.

IMGLOW_set_pdf_input( ) converts PDF files into a raster image when being decompressed
into RasterMaster products.

IMGLOW_set_alias() effectively displays the scaled-down 1-bit and color images.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMGLOW_get_filetype() returns the image file type Snowbound integer.

317
Appendix C - RasterMaster DLL Samples

IMG_decompress_bitmap_page() decompressed PDF images.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_save_bitmap() saves the image to disk in any desired format.

IMG_get_croprect() gets the image’s current cropping rectangle.

IMG_repaint_scroll() repaints the area after scrolling.

IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.

IMG_scroll_bitmap() scrolls bitmap.

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.

Listed below are the functions used in this sample.

IMGLOW_set_pdf_input() converts PDF files into a raster image when being decompressed
into RasterMaster products.

IMGLOW_set_alias() effectively displays the scaled-down 1-bit and color images.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMGLOW_get_pages() retrieves the page count of an image file.

IMG_decompress_bitmap_page() decompressed PDF images.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_save_bitmap() saves the image to disk in any desired format.

IMG_get_croprect() gets the image’s current cropping rectangle.

318
Appendix C - RasterMaster DLL Samples

IMG_repaint_scroll() repaints the area after scrolling.

IMG_display_bitmap_aspect() displays the current bitmap with the corrected aspect ratio.

IMG_scroll_bitmap() scrolls bitmap.

IMGLOW_map_image_to_wnd() translates the image coordinates passed in to reflect the win-


dow coordinates for the displayed image.

IMGLOW_map_wnd_to_image() translates window coordinates to image coordinates for the


displayed image.

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.

IMGLOW_extract_text() extracts text from a file.

IMGLOW_search_text() returns an array of SNBD_SEARCH_RESULT structures specifying the


location of each instance of the search_string found in the specified character buffer.

Multi-page Splitting and Saving


This sample accomplishes two tasks: splits a given multi-page file into single page files and/or
saves all images from a directory into one multi-page file.

You can find the samples in the following directory C:\Program Files\Snowbound Soft-
ware\RasterMaster® DLL Evaluation\DLL\Samples.

Listed below are the functions used in this sample.

IMGLOW_get_filetype() returns the image file type Snowbound integer.

IMGLOW_get_pages_fd() retrieves the page count of an image file.

IMGLOW_get_pages() retrieves the page count of an image file.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap_fd() loads an image from the currently open file handle.

IMG_save_bitmap() saves the image to disk in any desired format.

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

This sample command line takes:

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

l width_crop: The width of the zone of OCR interest, in pixels

l height_crop: The height of the zone of OCR interest in pixels

Example C.1: Command Line

OCRSample.exe "e:/code/ocrplugsrc/release/SnowOCRData/" "e:/-


code/test images/page.tif" page 2195 2600 350 550

app-name.exe ocr_data_directory input_image input_page x_crop


y_crop width_crop height_crop

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.

Listed below are the functions used in this sample:

IMG_decompress_bitmap_page() decompressed PDF images.

IMG_get_croprect() gets the current cropping rectangle of the current image.

IMG_bitmap_info() loads DLL into memory.

320
Appendix C - RasterMaster DLL Samples

IMG_save_bitmap_mem() saves an image to memory in the desired format.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMGLOW_extract_text_mem() extracts text 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.

Listed below are the functions used in this sample.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_decompress_bitmap_fd() loads an image from the currently open file handle.

IMG_bitmap_palette() makes the images palette the current system palette.

IMG_display_bitmap() displays the image.

IMG_bitmap_info() obtains information about the decompressed image.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

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.

Listed below are the functions used in this sample.

IMG_delete_bitmap() loads an image from disk.

IMG_decompress_bitmap() frees up the library handle and removes the image from memory.

IMG_bitmap_palette() forces the image handle to be used as the system palette.

IMG_display_bitmap() displays the image.

IMG_set_statusbar() turns callbacks for implementing the status bar.

IMG_get_croprect() gets the image’s current cropping rectangle.

IMG_set_croprect() sets the images’ current cropping rectangle.

IMG_bitmap_info() obtains information about the decompressed image.

321
Appendix C - RasterMaster DLL Samples

IMG_print_bitmap() prints the image.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

Save Searchable PDF


This 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 vari-
able. You can find the samples in the following directory C:\Program Files\Snowbound
Software\RasterMaster® DLL Evaluation\DLL\Samples.

Listed below are the functions used in this sample.

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_get_pages() returns the number of pages for a multi-page file.

IMGLOW_extract_text() extracts text from PTOCA, PCL, PDF, MS Word, AFP, and MS Excel
files.

IMGLOW_search_text() returns an array of structures of classes of the type, SNBD_


SEARCH_RESULT.

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.

Listed below are the functions used in this sample.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_scan_acquire() scans in the image on the currently installed device.

IMG_scan_acquire_feeder() scans in the image from the feeder on the currently installed
device.

IMG_scan_feeder_close() closes the feeder on the currently installed device.

IMG_scan_set_caps() allows for setting of a group of TWAIN parameters.

IMG_scan_set_cap() allows for setting of individual TWAIN parameters.

IMG_scan_get_cap() retrieves settings of an individual TWAIN parameter.

IMG_bitmap_palette() forces the image’s palette to be used as the system palette.

IMG_display_bitmap() displays the image.

IMG_bitmap_info() obtains information about the decompressed image.

322
Appendix C - RasterMaster DLL Samples

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

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.

Listed below are the functions used in this sample.

IMG_init_lib() loads DLL in memory.

IMG_unload_lib() removes DLL from memory.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from the disk.

IMG_bitmap_palette() forces the image’s palette to be used as the system palette.

IMG_bitmap_info() obtains information about the decompressed image.

IMGLOW_get_tiff_tag() reads a TIFF tag from the file specified.

IMGLOW_get_transp_color() gets the GIF image’s background color if the information is not
available in the header.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

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.

Listed below are the functions used in this sample.

IMG_bitmap_info() loads DLL into memory.

IMG_unload_lib() removes DLL from memory.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_decompress_bitmap() loads an image from disk.

IMG_bitmap_palette() forces the image’s palette to be used as the system palette.

IMG_display_bitmap_transp() displays tranparent GIF images.

IMG_bitmap_info() obtains information about the decompressed image.

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.

Example C.2: Vector_Convert

vextract.exe <input_file to be converted> <ouput_name>


<integer format value - either PDF=59 or converted> TEXT=100).

Listed below are the functions used in this sample.

IMGLOW_get_pages() retrieves the page count of an image file.

IMGLOW_extract_text() extracts text from a file.

IMG_save_document() writes vector data to a PDF file.

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

Listed below are the functions used in this sample.

IMG_bitmap_info() obtains information about the decompressed image.

IMG_get_croprect() gets the current cropping rectangle of the current image.

IMG_set_croprect_scroll() enables and disables the scroll bar and sets the cropping rectangle.

324
Appendix C - RasterMaster DLL Samples

IMG_decompress_bitmap() loads an image from disk.

IMG_delete_bitmap() frees up the library handle and removes the image from memory.

IMG_rotate_bitmap() rotates the image data.

IMG_set_display_angle() sets the angle for rotation by the IMG_display_bitmap().

IMG_zoom_bitmap_rect() zooming function for a rectangle.

IMG_repaint_scroll() repaints the area after scrolling.

IMG_bitmap_palette() forces the image’s palette to be used as the system palette.

IMG_display_bitmap() displays the current bitmap.

IMG_display_bitmap_aspect() displays the current bitmap with corrected aspect ratio.

IMG_scroll_bitmap() scrolls bitmap.

IMGLOW_set_alias() effectively displays scaled-down 1-bit and color images.

IMGLOW_map_wnd_to_image() translates window coordinates to image coordinates for the


displayed image.

325
Appendix D - TIFF Tags

Appendix D - TIFF Tags


This appendix describes the tags in the header and in Image File Directories (IFDs) used by
TIFF (tagged image file format) files to declare and describe their content. Each TIFF file begins
with an image file header which points to one or more image file directories which contain the
image data and image information.

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 .

Sources for Tag Specifications


The following are descriptions of the types of the sources of the tags:

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.

Descriptions of Tags in Numerical Order


Table D.1: TIFF Tags in Numerical Order1

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.

Currently defined values for the bitmap are:


254 00FE NewSubfileType 0 - Image is reduced of another TIFF image Baseline
in this file

1 - Image is a single page of a multi-page

2 - Image is a transparency mask for


another image in this file.

The default is 0.
A general indication of the kind of data that
is contained in this subfile.

Currently defined values are:


255 00FF SubfileType Baseline
A general indication of the kind of data that
is contained in this subfile.

Currently defined values are:

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.

2 = reduced resolution image data -


ImageWidth, ImageLength, and StripOff-
sets are required fields. It is further
assumed that a reduced resolution image is
a reduced version of the entire extent of the
corresponding full resolution data.

3 = single page of a multi-page image (see


the PageNumber tag description).

Continued use of this field is not recom-


mended. Writers should instead use the
new and more general NewSubfileType
field.
The image's width, in pixels (X:horizontal).
256 0100 ImageWidth Baseline
The number of columns in the image.
The image's length (height) in pixels (Y:ver-
257 0101 ImageLength tical). The number of rows (sometimes Baseline
described as "scan lines") in the image.
Number of bits per sample. Note that this
tag allows a different number of bits per
sample for each sample corresponding to a
258 0102 BitsPerSample pixel. For example, RGB color data could Baseline
use a different number of bits per sample for
each of the three color planes.

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.

2 = CCITT Group 3 1-Dimensional Modified


Huffman run length encoding. See
ALGRTHMS.txt BitsPerSample must be 1,
since this type of compression is defined

328
Appendix D - TIFF Tags

Code
Name Description Source of Tag
Dec Hex
only for bilevel images (like FAX images...)

3 = Facsimile-compatible CCITT Group 3,


exactly as specified in "Standardization of
Group 3 facsimile apparatus for document
transmission," Recommendation T.4,
Volume VII, Fascicle VII.3, Terminal Equip-
ment and Protocols for Telematic Services,
The International Telegraph and Telephone
Consultative Committee (CCITT), Geneva,
1985, pages 16 through 31. Each strip must
begin on a byte boundary. (But recall that an
image can be a single strip.) Rows that are
not the first row of a strip are not required to
begin on a byte boundary. The data is stored
as bytes, not words - byte-reversal is not
allowed. See the Group3Options field for
Group 3 options such as 1D vs 2D coding.

4 = Facsimile-compatible CCITT Group 4,


exactly as specified in "Facsimile Coding
Schemes and Coding Control Functions for
Group 4 Facsimile Apparatus," Recom-
mendation T.6, Volume VII, Fascicle VII.3,
Terminal Equipment and Protocols for
Telematic Services, The International Tele-
graph and Telephone Consultative Com-
mittee (CCITT), Geneva, 1985, pages 40
through 48. Each strip must begin on a byte
boundary. Rows that are not the first row of
a strip are not required to begin on a byte
boundary. The data is stored as bytes, not
words. See the Group4Options field for
Group 4 options.

5 = LZW Compression, for grayscale,


mapped color, and full color images. See
ALGRTHMS.txt

32773 = PackBits compression, a simple


byte oriented run length scheme for 1-bit
images.

Data compression only applies to raster


image data, as pointed to by StripOffsets.

The default value is 1.


262 0106 Pho- 0 = For bilevel and grayscale images: 0 is Baseline

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.

1 = For bilevel and grayscale images: 0 is


imaged as black. 2**BitsPerSample-1 is
imaged as white. If GrayRe-
sponseCurveexists, it overrides the Pho-
tometricInterpretation value.

2 = RGB. In the RGB model, a color is


described as a combination of the three
primary colors of light (red, green, and blue)
inparticular concentrations. For each of the
three samples, 0 represents minimum
intensity, and 2**BitsPerSample - 1 rep-
resents maximum intensity. For PlanarCon-
figuration = 1, the samples are stored in the
indicated order: first Red, hen Green, then
Blue. For PlanarConfiguration = 2, the
StripOffsets for the sample planes are
stored in the indicated order: first the Red
tomet-
sample plane StripOffsets, then the Green
ricInterpretation
plane StripOffsets, then the Blue plane
StripOffsets.

3 = "Palette color." In this mode, a color is


described with a single sample. The sample
is used as an index into ColorMap. The
sample is used to index into each of the red,
green and blue curve tables to retrieve an
RGB triplet defining an actual color. When
this PhotometricInterpretation value is
used, the color response curves must also
be supplied. SamplesPerPixel must be 1.

4 = Transparency Mask. This means that


the image is used to define an irregularly
shaped region of another image in the same
TIFF file. SamplesPerPixel and Bit-
sPerSample must be 1. PackBits com-
pression is recommended. The 1-bits define
the interior of the region; the 0-bits define
interior of the region; the 0-bits define the
exterior of the region. The Transparency
Mask must have the same ImageLength

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.

2 = a "dithered" scan, usually of continuous


263 0107 Threshholding Baseline
tone data such as photographs. Bit-
sPerSample 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

Mandatory for TIFF/EP.


For each strip, the byte offset of that strip.
The offset is specified with respect to the
beginning of the TIFF file. Note that this
implies that each strip has a location inde-
273 0111 StripOffsets pendent of the locations of other strips. This Baseline
feature may be useful for editing applic-
ations. This field is the only way for a reader
to find the image data, and hence must
exist.
The orientation of the image with respect to
the rows and columns.

1 = The 0th row represents the visual top of


274 0112 Orientation Baseline
the image, and the 0th column represents
the visual left hand side.

2 = The 0th row represents the visual top of

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.

3 = The 0th row represents the visual bot-


tom of the image, and the 0th column rep-
resents the visual right hand side.

4 = The 0th row represents the visual bot-


tom of the image, and the 0th column rep-
resents the visual left hand side.

5 = The 0th row represents the visual left


hand side of the image, and the 0th column
represents the visual top.

6 = The 0th row represents the visual right


hand side of the image, and the 0th column
represents the visual top.

7 = The 0th row represents the visual right


hand side of the image, and the 0th column
represents the visual bottom.

8 = The 0th row represents the visual left


hand side of the image, and the 0th column
represents the visual bottom.

It is extremely costly for most readers to per-


form image rotation "on the fly", i.e., when
importing and printing; and users of most
desktop publishing applications do not
expect a file imported by the application to
be altered permanently in any way.

The default value is 1.


The number of samples per pixel.
SamplesPerPixel is 1 for bilevel, grayscale,
277 0115 SamplesPerPixel Baseline
and palette color images. SamplesPerPixel
is 3 for RGB images.
The number of rows per strip. The image
data is organized into strips for fast access
to individual rows when the data is com-
pressed - though this field is valid even if the
278 0116 RowsPerStrip data is not compressed. Baseline

The default is 2**32 - 1, which is effectively


infinity. That is, the entire image is one strip.
Recomended is a strip size of 8K.
279 0117 StripByteCounts For each strip, the number of bytes in that Baseline

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.

2 = The samples are stored in separate


"sample planes." The values in StripOffsets
and StripByteCounts are then arranged as a
2-dimensional array, with SamplesPerPixel
rows and StripsPerImage columns. (All of
PlanarCon- the columns for row 0 are stored first, fol-
284 011C Baseline
figuration lowed by the columns of row 1, and so on.)
PhotometricInterpretation describes the
type of data that is stored in each sample
plane. For example, RGB data is stored
with the Red samples in one sample plane,
the Green in another,and the Blue in
another.

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 = Number represents tenths of a unit.

2 = Number represents hundredths of a unit.

3 = Number represents thousandths of a


unit.
GrayRe-
290 0122 Baseline
sponseUnit 4 = Number represents ten-thousandths of a
unit.

5 = Number represents hundred-thou-


sandths of a unit.

For historical reasons, the default is 2.


However, for greater accuracy, 3 is recom-
mended.
For grayscale data, the optical density of
each possible pixel value.

GrayRe- The purpose of the gray response curve and


291 0123 the gray units is to provide more exact pho- Baseline
sponseCurve
tometric interpretation information for gray
scale image data, in terms of optical dens-
ity.
Those options are for fax-images stored in
TIFF format. This field is made up of a set of
32 flag bits. 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.

292 0124 Group3Options Bit map: Extended


0 - 2-dimensional coding used.

1 - Image is uncompressed

2 - Fill bits have been added before EOL


codes, so that EOL always ends on a byte
boundary.

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.

For 2-D coding, each strip is encoded as if it


were a separate image. In particular, each
Group4Options
293 0125 strip begins on a byte boundary; and the cod-Extended
ing for the first row of a strip is encoded inde-
pendently of the previous row, using
horizontal codes, as if the previous row is
entirely white. Each strip ends with the 24-
bit end-of-facsimile block (EOFB).

Bit map:

0 - reserved (unused)

1 - uncompressed mode is used

2-31 - reserved
To be used with XResolution and YRes-
olution.

1 = No absolute unit of measurement. Used


for images that may have a non-square
aspect ratio, but no meaningful absolute
dimensions. The drawback of Res-
olutionUnit=1 is that different applications
will import the image at different sizes.
Even if the decision is quite arbitrary, it
296 0128 ResolutionUnit might be better to use dots per inch or dots Baseline
per centimeter, and pick XResolution and
YResolution such that the aspect ratio is
correct and the maximum dimension of the
image is about four inches (the "four" is
quite arbitrary.)

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.

317 013D Predictor To be used when Compression=5 (LZW). Extended


1 = No prediction scheme used before cod-
ing.

2 = Horizontal differencing.
Gives TIFF color image readers a better
idea of what kind of color image it is. There
will be borderline cases.

1 = Continuous tone, natural image.

2 = Synthetic image, using a greatly restric-


318 013E ColorImageType Extended
ted range of colors.

Such images are produced by most color


paint programs. See ColorList for a list of
colors used in this image.

The default value is 1.


A list of colors that are used in this image.
319 013F ColorList Use of this field is only practical for images Extended

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.

The list is organized as an array of RGB


triplets, with no pad. The RGB triplets are
not guaranteed to be in any particular order.
Note that the red, green, and blue com-
ponents can either be a BYTE or a word in
length. BYTE should be sufficient for most
applications.
This tag defines a Red-Green-Blue color
map for palette color images. The palette
color pixel value is used to index into all 3
subcurves. The subcurves are stored
sequentially. The Red entries come first, fol-
lowed by the Green entries, followed by the
320 0140 ColorMap Blue entries. The width of each entry is 16 Baseline
bits, as implied by the type of word. 0 rep-
resents the minimum intensity, and 65535
represents the maximum intensity.

ColorMap must be included in all palette


color images.
Conveys to the halftone function the range
321 0141 HalftoneHints of gray levels within a colorimetrically-spe- Extended
cified image that should retain tonal detail.
The tile width in pixels. This is the number
322 0142 TileWidth Extended
of columns in each tile.
The tile length (height) in pixels. This is the
323 0143 TileLength Extended
number of rows in each tile.
For each tile, the byte offset of that tile, as
324 0144 TileOffsets Extended
compressed and stored on disk.
For each tile, the number of (compressed)
325 0145 TileByteCounts Extended
bytes in that tile.
Used in the TIFF-F standard, denotes the
326 0146 BadFaxLines number of 'bad' scan lines encountered by Extended
the facsimile device.
Used in the TIFF-F standard, indicates if
'bad' lines encountered during reception are
327 0147 CleanFaxData Extended
stored in the data, or if 'bad' lines have been
replaced by the receiver.
Con- Used in the TIFF-F standard, denotes the
328 0148 sec- maximum number of consecutive 'bad' Extended
utiveBadFaxLine- scanlines received.

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.

340 0154 SMinSampleValu-Specifies the minimum sample value. Extended


e
SMaxSampleVal-
341 0155 Specifies the maximum sample value. Extended
ue
342 0156 TransferRange Expands the range of the TransferFunction. Extended
Mirrors the essentials of PostScript's path
343 0157 ClipPath Extended
creation functionality.
The number of units that span the width of
344 0158 XClipPathUnits the image, in terms of integer ClipPath Extended
coordinates.
The number of units that span the height of
345 0159 YClipPathUnits the image, in terms of integer ClipPath Extended
coordinates.
Aims to broaden the support for indexed
346 015A Indexed images to include support for any color Extended
space.
347 015B JPEGTables JPEG quantization and/or Huffman tables. Extended
351 015F OPIProxy OPI-related. Extended
Used in the TIFF-FX standard to point to an
Glob-
400 0190 IFD containing tags that are globally applic- Extended
alParametersIFD
able to the complete TIFF file.
Used in the TIFF-FX standard, denotes the
401 0191 ProfileType Extended
type of data stored in this file or IFD.
Used in the TIFF-FX standard, denotes the
402 0192 FaxProfile Extended
'profile' that applies to this file.
Used in the TIFF-FX standard, indicates
403 0193 CodingMethods Extended
which coding methods are used in the file.
Used in the TIFF-FX standard, denotes the
404 0194 VersionYear Extended
year of the standard specified by the

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

373- Type of image sensor. TIFF/EP spec, p.


9217 SensingMethod
99 Mandatory in TIFF/EP. 22
375-
927C MakerNote Manufacturer specific information. Exif Private IFD
00
375- Keywords or comments on the image; com-
9286 UserComment Exif Private IFD
10 plements ImageDescription.
375- A tag used to record fractions of seconds for
9290 SubsecTime Exif Private IFD
20 the DateTime tag.
375- Sub- A tag used to record fractions of seconds for
9291 Exif Private IFD
21 secTimeOriginal the DateTimeOriginal tag.
375- Sub- A tag used to record fractions of seconds for
9292 Exif Private IFD
22 secTimeDigitized the DateTimeDigitized tag.
377- ImageSourceDat-
935C Used by Adobe Photoshop. Private
24 a
The Flashpix format version supported by a
409-
A000 FlashpixVersion FPXR file., Exif Private IFD
60
Mandatory in the Exif IFD
The color space information tag is always
409- recorded as the color space specifier.
A001 ColorSpace Exif Private IFD
61
Mandatory in the Exif IFD.
409- Specific to compressed data; the valid
A002 PixelXDimension Exif Private IFD
62 width of the meaningful image.
409- Specific to compressed data; the valid
A003 PixelYDimension Exif Private IFD
63 height of the meaningful image.
409- RelatedSoundFil- Used to record the name of an audio file
A004 Exif Private IFD
64 e related to the image data.
409- Interoperability A pointer to the Exif-related Interoperability
A005 Private
65 IFD IFD.
414- A20B FlashEnergy Indicates the strobe energy at the time the Exif Private IFD

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

Appendix E - Snowbound Error Codes


This appendix describes the error codes that are returned by function execution problems.

Detailed Status/Error Codes


Table E.1: Error Codes

Error Error Code Description


Failed on memory allocation. Problem
with a standard memory allocation.
OUT_OF_MEMORY -1 Please see Determining Memory Require-
ments in Chapter 2 for more information
on the amount of memory required.
Open call failed when trying to decom-
FILE_NOT_FOUND -2
press an image.
CORRUPTED_FILE -3 File format bad, or unreadable.
BAD_STRING -4 String passed in is null or invalid.
Internal DLL problem. Submit a support
issue at http://support.snowbound.com
BAD_RETURN -5
and attach the document you were pro-
cessing when you received this error.
Fail on saving when attempting to create a
CANT_CREATE_FILE -6
new file.
Image was not recognized as a format the
library can decompress. Please see
FORMAT_NOT_ALLOWED -7 Appendix A, Supported File Formats, to
see if the file format is optional or requires
special handling.
Getobject() call failed to return bitmap
header for using DDB functions or may be
NO_BITMAP_FOUND -8 returned in formats that can contain vector
information such as .WPG, .WMF and
.PCT if no bitmap information is found.
Error writing data to the disk. Standard file
DISK_FULL -9
i/o write failed.
Tried to display with negative coordinates
BAD_DISPLAY_AREA -10
or out of range.
Used for multi-page file format support
when attempting to access a page which
does not exist. This error code provides
PAGE_NOT_FOUND -11
information of an empty Word-page which
is not converted to an empty page in PDF
or TIFF.
DISK_READ_ERROR -12 File format was truncated and tried to read

353
Appendix E - Snowbound Error Codes

Error Error Code Description


past end of file. Standard read i/o function
failed.
Application passed bad image handle. Not
BAD_HANDLE -13
a valid Snowbound library image handle.
NO_CLIPBOARD_IMAGE -14 Image not found on clipboard.
TWAIN scanner driver not installed or not
NO_SCANNER_FOUND -15
found (TWAIN.DLL).
Bad scanner driver or driver not configured
ERROR_OPENING_SCANNER -16
properly.
TWAIN scanner driver not installed or not
CANT_FIND_TWAIN_DLL -17
found (TWAIN.DLL).
Cancel out of low level save or low level
USER_CANCEL -18 decompress. Usually not an error but ter-
mination of a function intentionally.
Date on an evaluation copy of the Snow-
EVAL_TIMEOUT -19
bound product has expired.
USING_RUNTIME -20 Version not allowed for design mode.
Tried to save an image to a format that
does not support the image’s bits per
pixel. Or tried to perform an image pro-
PIXEL_DEPTH_UNSUPPORTED -21 cessing function on an image whose bits
per pixel is not allowed. Please see
Appendix A, Supported File Format for the
pixel depths of each supported format.
PALETTE_IMAGES_NOT_ Some image processing operations does
-22
ALLOWED not work on palette images.
NO_LZW_VERSION -23 No LZW or GIF code in this version.
DLL_NOT_LOADED -24 DLL not loaded for Win 3.x version.
Format will not support on the fly decom-
FORMAT_WILL_NOT_OTFLY -25
pression.
NO_TCOLOR_FOUND -26 No transparency color information found.
COMPRESSION_NOT_ Currently not supporting this compression
-27
SUPPORTED format.
Returned when scanning has completed
NO_MORE_PAGES -28
all pages in the document feeder.
FEEDER_NOT_READY -29 No more pages ready in document feeder.
No delay time was found for the animated
NO_DELAY_TIME_FOUND -30
GIF.
TIFF_TAG_NOT_FOUND -31 Could not find the .TIF tag.
NOT_A_TILED_IMAGE -32 Not recognized as a TIFF tiled image.
You are using a version that does not sup-
port this function. You do not have support
NOT_SUPPORTED_IN_THIS_
-33 for this file format. You may contact sup-
VERSION
port or your account representative to get
information on the RasterMaster option

354
Appendix E - Snowbound Error Codes

Error Error Code Description


that will allow you to process the file
format.
AUTOFEED_FAILED -34 Autofeed fail in the TWAIN Scanner.
NO_FAST_TWAIN_SUPPORTED -35 TWAIN driver cannot do fast transfer.
NO_PDF_VERSION -36 No PDF code in this version.
NO_ABIC_VERSION -37 No ABIC plug-in code in this version.
Internal error. An exception occurred dur-
ing processing. Please enter a support
ticket at http://support.snowbound.com
providing the document that was being
EXCEPTION_ERROR -38 processed and the Java console log out-
put. If the RasterMaster function being
called was not a decompress bitmap, then
please include a small sample program
that can be used to reproduce the issue.
NO_VECTOR_CAPABILITY -39 No vector plug-in found in this version.
NO_PCL_VERSION -40 No PCL plug-in found in this version.
NO JPEG2000 plug-in found in this ver-
NO_JPEG2000_VERSION -41
sion.
SEARCH_STRING_NOT_FOUND -42 Did not find attempted search string.
NO_WORD_VERSION -43 NO MS Word plug-in found in this version.
PASSWORD_PROTECTED_PDF -44 This file was password protected.
The Snowbound method was not found.
METHOD_NOT_FOUND -45 Please check the spelling of the method
name and Snowbound library version.
Access denied. Please check the security
ACCESS_DENIED -46
permissions.
BAD_LICENSE_PRIMARY Primary level license loaded is bad. Sec-
-47
BAD_LICENSE_SECONDARY ondary level license loaded is bad.
This file was password protected for Word
PASSWORD_PROTECTED_FILE -48
or other formats.
PDF_PACKAGE_NOT_ You are using a version that does not sup-
-50
SUPPORTED port PDF packages.
The OOXML Aspose license file was not
OOXML_LICENSE_NOT_FOUND -52
found.
The OOXML Aspose license file expired
OOXML_LICENSE_EXPIRED -53
or is otherwise invalid.

355
Appendix E - Snowbound Error Codes

General Error Define Values Retrieved from Status Prop-


erty
Table E.2: General Error Define Values Retrieved from Status Property

Value Error Code Description


GENERAL_STATUS.SYSTEM_ If an internal exception is thrown, this is
-100
CRASH the resulting value.
GENERAL_STATUS.DELETE_
-101 Image data of the object failed
ERROR
GENERAL_STATUS.DEFAULT -102 What the internal values are initially set to
GENERAL STATUS.SNOWBND_
1 Operation completed successfully
OK
GENERAL STATUS.SNOWBND_ Operation failed. See StatusDetails prop-
-1
ERROR erty.
GENERAL_STATUS.IMAGE_ Internal image data unavailable when try-
-103
NOT_AVAILABLE ing to complete an operation
GENERAL STATUS.SNOWBND_
-104 API is not implemented
API_NOT_AVAILABLE
GENERAL STATUS.NOT_VALID -105 Parameter is not valid
GENERAL STATUS.DISPLAY_
-106 General error display
ERROR

General Status/Error Codes


Table E.3: General Status/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.

Receiving an Error Code When Loading, Saving, or Con-


verting a Document
If you receive an error code when trying to load, save or convert a document with RasterMaster
DLL, please check the list of error codes and their descriptions in Appendix E, Snowbound Error
Codes to determine the source of the issue. If you still cannot resolve the issue after looking at
the list of error codes, please submit a support ticket at http://support.snowbound.com and
include the error code and the document that you were trying to load, save or convert when you
got the error message.

Output Document Differs from Original Document


When you convert a document and the output document is different from the original document,
please create a support ticket at http://support.snowbound.com and attach the document along
with a screenshot of the output document in RasterMaster. Some examples of the differences
that may occur include missing data, missing text, distorted graphics or displaying an incorrect
or different font. We can test the document with the latest release of RasterMaster which con-
tains fixes which may resolve your issue.

Output Document Has Much Larger File Size than the


Original Document
The file size of your output document may be much larger than the original document if you are
converting or merging a PDF, Word document or other document into a raster image.
Appendix A, Supported File Formats shows a list of file formats and their supported bit depths.
Please see the following suggestions to reduce the file size:

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.

IMGLOW_set_document_input(int dpi, int bits_pix, int format) converts PDF,


Word, Excel, PCL and AFP formats. Please see IMGLOW_set_document_input()
for more information.

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.

IMG_diffusion_mono(int imghandle) converts 4, 8 or 24 bit images to 1-bit per


pixel bi-level images using the Stucky error diffusion technique. Please see IMG_dif-
fusion_mono() for more information.

Output Document Has Much Lower Quality than the Ori-


ginal Document
The first step in obtaining better quality conversions is to check the original images or doc-
uments in the application where they originated such as Adobe Acrobat or Microsoft Word. If
the original application is not available, try another viewer. If the quality is bad for the original
image, then you may not be able to obtain any better quality in the conversion.

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.

IMGLOW_set_document_input(int dpi, int bits_pix, int format) converts PDF,


Word, Excel, PCL and AFP formats. Please see IMGLOW_set_document_input()
for more information.

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.

Output Document Displays Incorrect or Missing Char-


acters
When you convert a document, the output document may display incorrect or missing char-
acters if the document contains special characters which are commonly found in Non-English
languages such as Chinese, Japanese and Thai. Make sure that your system is properly con-
figured to support these characters. For more information, please see Snowbound Software’s
Font Configuration Guide.

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.

IMG_diffusion_mono(int imghandle) converts 4, 8 or 24 bit images to 1-bit per


pixel bi-level images using the Stucky error diffusion technique. Please see IMG_dif-
fusion_mono() 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.

IMGLOW_set_document_input(int dpi, int bits_pix, int format) converts PDF,


Word, Excel, PCL and AFP formats. Please see IMGLOW_set_document_input()
for more information.

Identifying an Unknown File Format


To identify an unknown file format, you can use the IMGLOW_get_filetype() function in Raster-
Master DLL. This function returns a number that corresponds to a file type as defined in the
RasterMaster library. Please see Appendix A, Supported File Formats for a list of the Snow-
bound file type constants.

Receiving a -3 Corrupted File Error code


If you receive a -3 corrupted file error code, the input document may have become corrupt. To
resolve this issue, open the document in an editor and write it back out again.

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.

Overlay Resources Not Pulled into APF or MODCA Docu-


ment
If overlay resources such as signatures are not being pulled into an AFP or MODCA document,
then make sure that the resource filename does not have a filename extension. If the resource
filename has a filename extension, remove it.

Searching for Text in a Snowbound Software Generated


PDF
If you are having trouble finding text in a Snowbound Software generated searchable PDF,
please use Adobe Reader version 9.4 to do the search.

361
Appendix F - Troubleshooting

Some TIFF_JPEG Files Produced By RasterMaster Do


Not Open In Third Party Image Viewers
When converting a file to TIFF_JPEG with RasterMaster, you may see that the resulting TIFF
is blank when opened in a third party image viewer such as MS Office Document Imaging or
Windows Photo Viewer. In some cases, the viewer may also display an error message indic-
ating that the TIFF is corrupted or too large.

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.

Color Documents Rendered as Black and White 


AFP (MO:DCA), Word, Excel, and PowerPoint format documents are all read in as black and
white 1-bit per pixel by default to enhance performance. If you would like to preserve the color in
these documents, you may use IMGLOW_set_document_input(300,24) before calling
IMG_decompress_bitmap() to read in the documents. Preserving the 24-bit color information
and using a relatively high resolution of 300 DPI will considerably increase the memory required
to process the document, increase the size of the output document and decrease performance.

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

-22 error code 354


Index
-23 error code 354

-24 error code 354


-

-1 error code 353 -25 error code 354

-10 error code 353 -26 error code 354

-100 error code 356 -27 error code 354

-101 error code 356 -28 error code 354

-102 error code 356 -29 error code 354

-103 error code 356 -3 error code 353, 361

-104 error code 356 -30 error code 354

-105 error code 356 -31 error code 354

-106 error code 356 -32 error code 354

-11 error code 353 -33 error code 354

-12 error code 353 -34 error code 355

-13 error code 354 -35 error code 355

-14 error code 354 -36 error code 355

-15 error code 354 -37 error code 355

-16 error code 354 -38 error code 355

-17 error codee 354 -39 error code 355

-18 error code 354 -4 error code 353

-19 error code 354 -40 error code 355

-2 error code 353 -41 error code 355

-20 error code 354 -42 error code 355

-21 error code 354 -43 error code 355

364
Index: -44 error code – ASCIIPAGEHEIGHT

-44 error code 355 AFP troubleshooting

-45 error code 355 overlay 361

-46 error code 355 AFP/MO 229

-47 error code 355 Aliasing 53

-48 error code 355 Alpha 313

-5 error code 353 Animate 313

-50 error code 355 ANN_GRAPHIC_STRUCT 260

-52 error code 355 structure 260

-53 error code 355 Annlib.h 307

-6 error code 353 Annotate 314

-7 error code 353 Annotation Constants 279

-8 error code 353 ASCII 284-285

-9 error code 353 filter bit level support 284

ASCII Attribute Structure 125


1
ASCII file 127
1 error code 356
Path/filename 127
A
ASCII Formats 125
ABIC 285
ASCIICHARSPERLINE 126
abicplug.dll 307
ASCIII text format
ACCESS_DENIED error code 355
auto detection 125
AFP 238, 285, 362
ASCIIITALIC 126
AFP Font Mapping 237
ASCIILINESPERPAGE 126
AFP resource
ASCIIMARGIN 126
not displayed 361
ASCIIPAGEHEIGHT 126

365
Index: ASCIIPAGEWIDTH – CANT_CREATE_FILE error code

ASCIIPAGEWIDTH 126 automatically detecting

ASCIIPOINTSIZE 126 file formats 56

ASCIITABSTOP 126
B
ASCIITYPEFACE 126
BAD_DISPLAY_AREA error
ASCIIWEIGHT 126 code 353

ASCIIXDPI 126 BAD_HANDLE error code 354

ASCIIXSIZEENVELOPE 126 BAD_LICENSE_PRIMARY error


code 355
ASCIIXSIZEEXECUTIVE 126
BAD_LICENSE_SECONDARY error
ASCIIXSIZELEGAL 126
code 355
ASCIIXSIZELETTER 126
BAD_RETURN error code 353
ASCIIYDPI 126
BAD_STRING error code 353
ASCIIYSIZEENVELOPE 126
bit depth 135
ASCIIYSIZEEXECUTIVE 126
bits per pixel 135
ASCIIYSIZELEGAL 126
BMP 285
ASCIIYSIZELETTER 126
BMP_UNCOMPRESSED 285
Aspect Ratio Correction Functions 51
BOM 175
Aspose 178
BRK 285
Aspose.Total.Product.Family.lic 307
byte order mark 175
Aspose.Words.dll 307
C
Aspose.Words.lic 307
Callback 315
auto detection
Callback Routines 46
ASCII text format 125
CALS 285
AUTOFEED_FAILED error code 355
CANT_CREATE_FILE error code 353

366
Index: CANT_FIND_TWAIN_DLL error code – Encrypt

CANT_FIND_TWAIN_DLL error DELETE_ERROR error code 356


code 354
DIB 286
CCITT_G3 285
DICOM 286
CCITT_G3_FO 285
DISK_FULL error code 353
CCITT_G4 285
DISK_READ_ERROR error code 353
CCITT_G4_FO 285
Display Quality 53
CFF 285
DISPLAY_ERRORerror code 356
CIFF 286
Displaying 24-bit images 53
CIMS 286
Displaying Transparent Images 49
CLIP 286
DLL_NOT_LOADED error code 354
COD 286
DOC 286
color page input 57, 238, 362
DocClean functions 183
color page ouput 238, 362
docplug.dll 307
color reduction 58
Document Conversion 229
COMPRESSION_NOT_
Document File Formats 281
SUPPORTED error code 354
DOCX 287
conversion takes too long 58
DPI 56-57
CORRUPTED_FILE 361
DWG 287
CORRUPTED_FILE error code 353
dwgplug.dll 307
CUT 286
DXF 287
CXand 106
DXF Functions 167
D
E
DCS 286
EMAIL 287
DCX 286
Encrypt 315

367
Index: EPS – error code

EPS 287 -20 354

EPS_BITMAP 287 -21 354

EPS_BITMAP_G4 287 -22 354

EPS_BITMAP_LZW 287 -23 354

error code 361 -24 354

-1 353 -25 354

-10 353 -26 354

-100 356 -27 354

-101 356 -28 354

-102 356 -29 354

-103 356 -3 353

-104 356 -30 354

-105 356 -31 354

-106 356 -32 354

-11 353 -33 354

-12 353 -34 355

-13 354 -35 355

-14 354 -36 355

-15 354 -37 355

-16 354 -38 355

-17 354 -39 355

-18 354 -4 353

-19 354 -40 355

-2 353 -41 355

368
Index: error during conversion – error code

-42 355 CAN_CREATE_FILE 353

-43 355 CANT_FIND_TWAIN_DLL 354

-44 355 COMPRESSION_NOT_


SUPPORTED 354
-45 355
CORRUPTED_FILE 353
-46 355
DELETE_ERROR 356
-47 355
DISK_FULL 353
-48 355
DISK_READ_ERROR 353
-5 353
DISPLAY_ERROR 356
-52 355
DLL_NOT_LOADED 354
-53 355
ERROR_OPENING_
-6 353
SCANNER 354
-7 353
EVAL_TIMEOUT 354
-8 353
EXCEPTION_ERROR 355
-9 353
FEEDER_NOT_READY 354
1 356
FILE_NOT_FOUND 353
ACCESS_DENIED 355
FORMAT_NOT_ALLOWED 353
AUTOFEED_FAILED 355
FORMAT_WILL_NOT_
BAD_DISPLAY_AREA 353 OTFLY 354

BAD_HANDLE 354 GENERAL_

BAD_LICENSE_PRIMARY 355 STATUS.DEFAULT 356

BAD_LICENSE_ GENERAL_STATUS.DELETE_

SECONDARY 355 ERROR 356

BAD_RETURN 353 GENERAL_STATUS.DISPLAY_


ERROR 356
BAD_STRING 353

369
Index: error during conversion – error code

GENERAL_STATUS.IMAGE_ NO_TCOLOR_FOUND 354


NOT_AVAILABLE 356
NO_VECTOR_CAPABILITY 355
GENERAL_STATUS.NET_
NO_WORD_VERSION 355
VALID 356
NOT_A_TILED_IMAGE 354
GENERAL_
STATUS.SNOWBND_API_ NOT_SUPPORTED_IN_THIS_

NOT_AVAILABLE 356 VERSION 354

GENERAL_ NOT_VALID 356

STATUS.SNOWBND_ OOXML_LICENSE_
OK 356 EXPIRED 355

GENERAL_STATUS.SYSTEM_ OOXML_LICENSE_NOT_
CRASH 356 FOUND 355

IMAGE_NOT_AVAILABLE 356 OUT_OF_MEMORY 353

METHOD_NOT_FOUND 355 PAGE_NOT_FOUND 353

NO_ABIC_VERSION 355 PALETTE_IMAGE_NOT_

NO_BITMAP_FOUND 353 ALLOWED 354

NO_CLIPBOARD_IMAGE 354 PASSWORD_PROTECTED_


FILE 355
NO_DELAY_TIME_FOUND 354
PASSWORD_PROTECTED_
NO_FAST_TWAIN_
PDF 355
SUPPORTED 355
PDF_PACKAGE_NOT_
NO_JPEG2000_VERSION 355
SUPPORTED 355
NO_LZW_VERSION 354
PIXEL_DEPTH_
NO_MORE_PAGES 354 UNSUPPORTE 354

NO_PCL_VERSION 355 SEARCH_STRING_NOT_


FOUND 355
NO_PDF_VERSION 355
SNOWBND_API_NOT 356
NO_SCANNER_FOUND 354
SNOWBND_OK 357

370
Index: error during conversion – GENERAL_STATUS.SNOWBND_ERROR

SYSTEM_CRASH 357 filters.h 307

TIFF_TAG_NOT_FOUND 354 Fit 316

USER_CANCEL 354 FLASHPIX 288

USING_RUNTIME 354 Font Mapping Data 237

error during conversion 58 Format Conversion 37, 316

ERROR_OPENING_SCANNER error FORMAT_NOT_ALLOWED error


code 354 code 353

EVAL_TIMEOUT error code 354 FORMAT_WILL_NOT_OTFLY error


code 354
evaluation version

installing 301 G

Excel 238, 362 General Status Error 356

EXCEPTION_ERROR error code 355 GENERAL_STATUS.DEFAULT error


code 356
F
GENERAL_STATUS.DELETE_
FEEDER_NOT_READY error ERROR error code 356
code 354
GENERAL_STATUS.DISPLAY_
file formats ERROR error code 356

automatically detecting 56 GENERAL_STATUS.IMAGE_NOT_

FILE_NOT_FOUND error code 353 AVAILABLE error code 356

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

get hole punch

location of OOXML license file 180 remove 188

get_dib_data_Callback 150 HTML 288

GIF 288 HTML Functions 169

GIF_INTERLACED 288 HtmlHelper.dll 307

GlobalAlloc() 145 htmlplg.dll 307

GlobalLock() 145
I
GX2 288 ICO 288

GXand 106 icudt38.dll 307

GXandInverted 106 IFF 288

GXandReverse 106 image

GXclear 106 return orientation 183

GXcopy 106 rotate 184

GXcopyInverted 106 Image Compression 55

GXequiv 106 Image File Directories (IFDs) 326

GXinvert 106 Image Management System 286

GXnoop 106 Image Processing Functions 190

GXor 106 IMAGE_NOT_AVAILABLE error

GXorInverted 106 code 356

GXorReverse 106 IMG 288

GXxor 106 IMG_animate 60

372
Index: IMG_antique_effect – IMG_display_fit_to_width

IMG_antique_effect 61 IMG_decompress_bitmap_page 72

IMG_apply_profile 191 IMG_decompress_fax_mem 74

IMG_auto_orient 62 IMG_decompress_tiled_bitmap 74

IMG_auto_orient Function 183 IMG_delete_bitmap 75

IMG_autocrop_bitmap 61 IMG_delete_bitmap_keep 76

IMG_bayer_color 218 IMG_deskew_bitmap 193

IMG_bayer_mono 219 IMG_deskew_bitmap Function 184

IMG_bitmap_info 62 IMG_despeckle_bitmap 194

IMG_bitmap_palette 64 IMG_despeckle_bitmap Function 184

IMG_cmyk_to_rgb 192 IMG_dib_to_ddb 77

IMG_color_combine 65 IMG_dib_to_GWorld 249

IMG_color_gray 67 IMG_dib_to_GWorld_bitdepth 250

IMG_color_separate 66 IMG_dib_to_runs 220

IMG_create_handle 67 IMG_diffusion_color 221

IMG_create_handle_ddb 101 IMG_diffusion_mono 221

IMG_create_handle_keep 67 IMG_display_bitmap 77

IMG_create_handle_shell 68 IMG_display_bitmap_aspect 78

IMG_create_thumbnail 192 IMG_display_bitmap_dti 80

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

IMG_erase_rect 83 IMG_merge_bitmap 105

IMG_ERR.h 307 IMG_merge_bitmap_alpha 107

IMG_flip_bitmapx 196 IMG_merge_bitmap_handle 108

IMG_flip_bitmapy 197 IMG_octree_color 223

IMG_get_bitmap_palette 102 IMG_popularity_color 224

IMG_get_croprect 103 IMG_print_bitmap 84

IMG_get_deskew_angle 198 IMG_print_bitmap_fast 85

IMG_get_profile 199 IMG_process_bitmap 200

IMG_global_get_Xdisplay 241 IMG_promote_24 109

IMG_global_get_Xreserverd_ IMG_promote_32 110


colors 241
IMG_promote_8 109
IMG_global_get_Xscreen 242
IMG_RECT 127
IMG_global_set_Xdisplay 241
IMG_remove_red_eye 86
IMG_global_set_Xreserved_
IMG_repaint_scroll 252
colors 243
IMG_resize_bitmap 201
IMG_global_set_Xscreen 242
IMG_resize_bitmap_bicubic 202
IMG_GWorld_to_dib 250
IMG_resize_bitmap_interp 203
IMG_halftone_mono 222
IMG_resize_to_gray 204
IMG_histogram_equalize 199
IMG_rgb_to_cmyk 204
IMG_ifl_version 104
IMG_rotate_bitmap 205
IMG_ifl_version_ext 104
IMG_runs_to_dib 225
IMG_import_ascii 127
IMG_save_bitmap 86
IMG_init_lib 83
IMG_save_bitmap_fd 87
IMG_invert_bitmap 200
IMG_save_bitmap_mem 89
IMG_mediancut_color 223

374
Index: IMG_save_document – IMGLOW_get_fileinfo

IMG_save_document 232 IMG_unload_plugins 90

IMG_save_document_mem 235 IMG_window_level 208

IMG_scan_acquire 93 IMG_zoom_bitmap 246

IMG_scan_acquire_feeder 93 IMG_zoom_bitmap_1_to_1 246

IMG_scan_acquire_feeder_fast 94 IMG_zoom_bitmap_rect 247

IMG_scan_feeder_close 94 Imglib.h 307

IMG_scan_get_cap 97 IMGLOW_auto_invert Function 185

IMG_scan_open_source 95 IMGLOW_autocolor 131

IMG_scan_pages 95 IMGLOW_decompress_bitmap 132

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

IMGLOW_get_fileinfo_fd 209 IMGLOW_put_raster 227

IMGLOW_get_fileinfo_page 121 IMGLOW_read_pixel 211

IMGLOW_get_filetype 142 IMGLOW_remove_halftone


Function 187
IMGLOW_get_filetype_fd 142
IMGLOW_remove_holepunch Func-
IMGLOW_get_filetype_mem 226
tion 188
IMGLOW_get_image_orientation 143
IMGLOW_save_bitmap 149
IMGLOW_get_image_orientation_
IMGLOW_save_bitmap_mem 150
page 143
IMGLOW_search_text 151
IMGLOW_get_ooxml_license_location
Function 180 IMGLOW_set_alias_img 154

IMGLOW_get_pages 144 IMGLOW_set_alias_quality 228

IMGLOW_get_pages_fd 144 IMGLOW_set_ascii_attributes 129

IMGLOW_get_pages_mem 145 IMGLOW_set_auto_detect 212

IMGLOW_get_palette 210 IMGLOW_set_bitmap_name 154

IMGLOW_get_raster 227 IMGLOW_set_cad_background 167

IMGLOW_get_tiff_tag 146, 326 IMGLOW_set_cad_input 167

IMGLOW_get_tiff_tag_page 146 IMGLOW_set_cad_size 168

IMGLOW_get_tile_info 147 IMGLOW_set_comp_quality 155

IMGLOW_get_transp_color 148 IMGLOW_set_decomp_rect 213

IMGLOW_is_tiled_image 148 IMGLOW_set_decomp_reduction 213

IMGLOW_map_image_to_wnd 119 IMGLOW_set_decompsize 212

IMGLOW_map_wnd_to_image 119 IMGLOW_set_dispfunc 155

IMGLOW_ooxml_license_enable() IMGLOW_set_dithermode 214


178
IMGLOW_set_document_input 156,
IMGLOW_put_palette 210 238, 362

376
Index: IMGLOW_set_document_page_size – IMGLOW_set_wipedelay

IMGLOW_set_document_page_ IMGLOW_set_jpeg2000_comp_
size 157 ratio 158

IMGLOW_set_fast_convert 214 IMGLOW_set_jpeg2000_comp_ratio


Function 181
IMGLOW_set_fileinfo 120
IMGLOW_set_jpg_interleave 159
IMGLOW_set_fileio 123
IMGLOW_set_msg_render_pref-
IMGLOW_set_fontmap_path 238
erences 160
IMGLOW_set_html_capabilities 169
IMGLOW_set_ooxml_license() 178
IMGLOW_set_html_home_dir 170
IMGLOW_set_ooxml_license_file-
IMGLOW_set_html_image_ name Function 180
capability 171
IMGLOW_set_ooxml_license_file-
IMGLOW_set_html_input 171 nameW Function 181

IMGLOW_set_html_javascript_cap- IMGLOW_set_ooxml_license_path
ability 172 Function 181

IMGLOW_set_html_page_size 172 IMGLOW_set_ooxml_license_pathW

IMGLOW_set_html_page_size_ Function 182

ratio 173 IMGLOW_set_overlay_path 160

IMGLOW_set_html_page_size_ratio_ IMGLOW_set_pcl_input 216


capability 173
IMGLOW_set_pdf_input 161
IMGLOW_set_html_screen_dpi 174
IMGLOW_set_pdf_output 162
IMGLOW_set_html_use_page_
IMGLOW_set_pdf_password 162
breaks_exclusively 174
IMGLOW_set_rop 121
IMGLOW_set_html_utf_bom 175
IMGLOW_set_tiff_save_strips 163
IMGLOW_set_image_orientation 157
IMGLOW_set_tiff_tag 163, 326
IMGLOW_set_imnet_page_size 215
IMGLOW_set_transp_color 164
IMGLOW_set_jpeg_
decompression 158 IMGLOW_set_wipedelay 123

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

isPageBreaksExclusive 170 Macintosh High Level Functions 249

isRatioEnabled 170 MACPAINT 289

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

JPEG 289 MMR 289

JPEG2000 289 MO

DCA 238, 362

378
Index: MODCA resource – ODS

MODCA resource NO_JPEG2000_VERSION error


code 355
not displayed 361
NO_LZW_VERSION error code 354
MODCA troubleshooting
NO_MORE_PAGES error code 354
overlay 361
NO_PCL_VERSION error code 355
MS-Windows DIB 257
NO_PDF_VERSION error code 355
MS_Windows DIB Header
Format 257 NO_SCANNER_FOUND error
code 354
MS_Windows DIB Image Data
Format 257 NO_TCOLOR_FOUND error
code 354
MS_Windows DIB Palette Format 257
NO_VECTOR_CAPABILITY error
MSP 289
code 355
Multi-page Page Count 44
NO_WORD_VERSION error
Determining 44 code 355

Multi-page Splitting and Saving 319 Normal Printing 47

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

code 354 OCR 319

NO_FAST_TWAIN_SUPPORTED ODF 290


error code 355
ODP 290

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

get location 180 PASSWORD_PROTECTED_FILE


error code 355
set filename 180-181
PASSWORD_PROTECTED_PDF
OOXML_LICENSE_EXPIRED error
error code 355
code 355
path
OOXML_LICENSE_NOT_FOUND
error code 355 OOXML files 181-182

ooxmlplug.dll 307 PCL 290

orientation PCL_5 290

image 183 pclplug.dll 307

OUT_OF_MEMORY error code 353 PCX 290

output PDF 290, 361

color page 238, 362 filter bit level support 284

output quality PDF File Formats 281

low 57 PDF_15 291

overlay PDF_16 292

AFP troubleshooting 361 PDF_PACKAGE_NOT_


SUPPORTED error code 355
MODCA troubleshooting 361
pdfplug.dll 307

380
Index: performance – SANN_create_ann

performance RasterMaster

improving 360 version

PhotoCD 292 get 104

Photoshop 292 RasterMaster Annotation Toolkit 260

PICT 292 Read/Write Capabilities 284

pixel depth 57 redistributed Snowbound files 301

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

large documents 48 SANN_activate_all_objects 263

Printing Images 47 SANN_add_object 265

production version SANN_choose_color 265

installing 301 SANN_choose_font 265

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

SANN_deactivate_all_objects 266 SANN_set_fcolor 277

SANN_deactivate_object 267 SANN_set_font 277

SANN_delete_all_objects 267 SANN_set_line_style 278

SANN_delete_object 268 SANN_set_line_width 278

SANN_display_annotations 268 SANN_set_size 279

SANN_draw_object 269 SANN_write_ann 279

SANN_get_croprect 269 Saving Transparent Images 49

SANN_get_object_bounds 270 Scan 322

SANN_get_object_data 270 SCITEX 293

SANN_get_object_info 270 SEARCH_STRING_NOT_FOUND


error code 355
SANN_get_object_num 271
set
SANN_highlight_object 271
absolute path for OOXML files 181-
SANN_map_image_to_wnd 272
182
SANN_map_wnd_to_image 272
filename of OOXML license
SANN_merge_ann 272 file 180-181

SANN_mouse 273 Snbd_map.fnt file 237

SANN_move_object 274 Snbdan32.dll 308

SANN_print_annotations 274 snbdan32.lib 308

SANN_read_ann 274 snbdcm.dll 308

SANN_resize_object 275 sndbcm.lib 308

SANN_rotate 275 SNOWBND_API_NOT error code 356

SANN_set_bcolor 276 Snowbnd_Class.h 308

SANN_set_croprect 276 SNOWBND_OK error code 357

SANN_set_delete_flag 276 Snowbound ASCII 125

382
Index: Snowbound Error Codes – USING_RUNTIME error code

Snowbound Error Codes 353 TIFF_JPEG 294, 362

Supported File Format TIFF_JPEG7 295


Descriptions 284
TIFF_LZW 295
Supported Multi-page Functions 44
TIFF_PACK 295
SYSTEM_CRASH error code 357
TIFF_TAG_NOT_FOUND error
code 354
T
Transp 323
tag specifications 326
Transparency Overview 49
Tags 323
troubleshooting 358
TARGA 293
corrupted file error 361
TARGA16 293
error code 358
third party viewers 362
improving performance 360
TIFF
larger file size 358
read tag 326
lower quality 359
TIFF tags 326
missing characters 360
TIFF UNCOMPRESSED 295
output differs 358
TIFF_2D 293
overlay resources 361
TIFF_ABIC 294
third party viewers 362
TIFF_ABIC_BW 294
TIFF_JPEG 362
TIFF_G3_FAX 294
unknown file format 361
TIFF_G4_FAX 294
TXT 295
TIFF_G4_FAX_FO 294

TIFF_G4_FAX_STRIP 294 U

TIFF_HUFFMAN 294 USER_CANCEL error code 354

TIFF_JBIG 294 USING_RUNTIME error code 354

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

Word 238, 362

WPG 295

XBM 295

Xerox_EPS 296

XLS 281, 296

XLSX 296

XPM 296

XWD 296

filter bit level support 284

XWindows 241

384

You might also like