0% found this document useful (0 votes)
131 views389 pages

RMDLLProgrammers Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views389 pages

RMDLLProgrammers Guide

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 389

RasterMaster® SDK

Dynamic Link Library (DLL), Windows and UNIX V19.0


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: 19.0
RasterMaster® SDK Release Number: 19.0
Printing Date: June 2015
Published by Snowbound Software Corporation.
309 Waverley Oaks Road, Suite 401
Waltham, MA 02452 USA
phone: 617-607-2000
fax: 617-607-2002
©1996 - 2015 by Snowbound Software Corporation. All rights reserved.
Table of Contents
Chapter 1 - Additions and Improvements 35

Version 19.0 Additions and Improvements 35

New Features 35

Chapter 2 - Quick Start 38

Quickly Getting Started with the Format Conversion Sample 38

Viewing Samples Packaged with the Library 39

Reading and Displaying Images 40

Reading Images 40

Displaying an Image 41

Return Values and Error Codes 41

System Overview 42

Chapter 3 - Saving and Reading Multi-page Images 45

Multi-page Images 45

Supported Multi-page Formats 45

Decompressing a Multi-page Image 45

Determining Multi-page Page Count 45

Saving Multi-page File Formats 46

Multi-page Format Functions 46

Chapter 4 - Callback Routines 47

Overview of Callbacks 47

Decompressing Images 47

Saving Images 47

iii
Chapter 5 - Printing Images 48

Printing Overview 48

Printing Functions 48

Normal Printing 48

Fast Printing 48

Printing Large Documents 49

Servers 49

Clients 49

Solution 49

Chapter 6 - Displaying and Saving Transparent Images 50

Transparency Overview 50

Displaying Transparent Images 50

Changing Transparent Color 50

Saving a Modified Image 51

Chapter 7 - Aspect Ratio Correction Functions 52

Aspect Ratio Correction Functions 52

Chapter 8 - RasterMaster Library 53

Changing the DPI in the RasterMaster Library 53

Chapter 9 - Display Quality 54

Achieving the Best Display Quality 54

24-Bit Images Displayed on a 256 Color Adapter 54

Bi-Level and 1-Bit Per Pixel Images 54

Chapter 10 - Image Compression 56

Preferred Formats 56

iv
24-Bit Color Images 56

8-Bit Gray Scale Images 56

1-bit Bi-Level Images 56

Chapter 11 - File Format Conversion 57

Converting File Formats 57

Automatically Detecting File Formats 57

Input Document Quality: Resolution/DPI 57

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

Making Sure Input is Compatible with Output 58

Getting a Pixel_Depth_Unsupported Error 58

Adjusting Low Output Quality 58

Chapter 12 - High Level Functions 60

IMG_animate() 60

IMG_autocrop_bitmap() 60

IMG_auto_orient() 61

IMG_bitmap_info() 62

IMG_bitmap_palette() 63

IMG_color_combine() 65

IMG_color_separate() 65

IMG_color_gray() 66

IMG_create_handle() 66

IMG_create_handle_keep() 67

IMG_create_handle_shell() 68

IMG_decompress_bitmap() 68

v
IMG_decompress_bitmap_display() 69

IMG_decompress_bitmap_fd() 70

IMG_decompress_bitmap_mem() 71

IMG_decompress_bitmap_page() 72

IMG_decompress_fax() 73

IMG_decompress_fax_mem() 73

IMG_decompress_tiled_bitmap() 74

IMG_delete_bitmap() 75

IMG_delete_bitmap_keep() 76

IMG_dib_to_ddb() 76

IMG_display_bitmap() 77

IMG_display_bitmap_aspect() 78

IMG_display_bitmap_dti() 79

IMG_display_bitmap_iac() 80

IMG_display_bitmap_transp() 81

IMG_display_ddb() 82

IMG_erase_rect() 82

IMG_init_lib() 83

IMG_print_bitmap() 84

IMG_print_bitmap_fast() 85

IMG_remove_red_eye() 85

IMG_save_bitmap() 86

IMG_save_bitmap_fd() 87

IMG_save_bitmap_mem() 88

vi
IMG_save_mem() 89

IMG_set_encrypt() 90

IMG_unload_lib() 90

IMG_unload_plugins() 91

Chapter 13 - Scanning Functions 92

Scanning Constants 92

IMG_scan_acquire() 92

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

IMG_display_ddb_effect() 100

IMG_get_bitmap_palette() 101

IMG_get_croprect() 102

IMG_ifl_version() 103

IMG_ifl_version_ext() 103

vii
IMG_merge_bitmap() 104

IMG_merge_bitmap_alpha() 106

IMG_merge_bitmap_handle() 107

IMG_promote_8() 108

IMG_promote_24() 108

IMG_promote_32() 109

IMG_repaint_scroll() 110

IMG_scroll_bitmap() 111

IMG_set_croprect() 112

IMG_set_croprect_scroll() 113

IMG_set_display_angle() 114

IMG_set_statusbar() 115

IMG_zoom_bitmap() 116

IMG_zoom_bitmap_rect() 116

IMG_zoom_bitmap_1_to_1() 117

IMGLOW_map_image_to_wnd() 118

IMGLOW_map_wnd_to_image() 118

IMGLOW_get_fileinfo() 119

IMGLOW_get_fileinfo_page() 120

IMGLOW_set_rop() 120

IMGLOW_set_fileio() 122

IMGLOW_set_wipedelay() 122

Chapter 15 - ASCII Formats and Functions 124

ASCII Attribute Structure 124

viii
Standard Page Sizes 125

IMG_import_ascii() 126

IMG_RECT() 126

IMGLOW_get_ascii_attributes() 127

IMGLOW_get_ascii_page_width() 127

IMGLOW_set_ascii_attributes() 128

Chapter 16 - Low Level Functions 129

IMGLOW_autocolor() 129

IMGLOW_decompress_bitmap() 129

put_dib_data Callback Routines For IMGLOW_decompress_bitmap 130

set_header Callback Routine For IMGLOW_decompress_bitmap 131

IMGLOW_decompress_bitmap_mem() 131

put_dib_data Callback Routine For IMGLOW_decompress_bitmap_mem 132

set_header Callback Routine For IMGLOW_decompress_bitmap_mem 133

IMGLOW_detect_color() 133

IMGLOW_extract_text() 134

IMGLOW_extract_text_mem() 136

IMGLOW_get_anim_delay() 137

IMGLOW_get_bitmap_header() 137

IMGLOW_get_bitmap_name() 138

IMGLOW_get_custstring() 138

IMGLOW_get_display_rect() 139

IMGLOW_get_filetype() 139

IMGLOW_get_filetype_fd() 140

ix
IMGLOW_get_image_orientation() 141

IMGLOW_get_image_orientation_page() 141

IMGLOW_get_pages() 142

IMGLOW_get_pages_fd() 142

IMGLOW_get_pages_mem() 143

IMGLOW_get_tiff_tag() 143

IMGLOW_get_tiff_tag_page() 144

IMGLOW_get_tiff_tag_page_mem() 145

IMGLOW_get_tile_info() 145

IMGLOW_get_transp_color() 146

IMGLOW_is_tiled_image() 147

IMGLOW_save_bitmap() 147

get_dib_data Callback Routine For IMGLOW_save_bitmap 148

IMGLOW_save_bitmap_mem() 149

get_dib_data Callback Routine For IMGLOW_save_bitmap_mem 149

IMGLOW_search_text() 150

IMGLOW_set_alias() 151

IMGLOW_set_alias_img() 152

IMGLOW_set_bitmap_name() 153

IMGLOW_set_comp_quality() 153

IMGLOW_set_dispfunc() 154

IMGLOW_set_document_input() 154

IMGLOW_set_document_page_size() 155

IMGLOW_set_image_orientation() 156

x
IMGLOW_set_jpeg_decompression 157

IMGLOW_set_jpeg2000_comp_ratio() 157

IMGLOW_set_jpg_interleave() 158

IMGLOW_set_msg_render_preferences() 158

IMGLOW_set_overlay_path() 159

IMGLOW_set_pdf_input() 159

IMGLOW_set_pdf_output() 160

IMGLOW_set_pdf_password() 161

IMGLOW_set_tiff_save_strips 161

IMGLOW_set_tiff_tag() 162

IMGLOW_set_transp_color() 163

IMGLOW_write_tiff_stream() 163

Supported File Types 164

Chapter 17 - DWG and DXF Functions 165

IMGLOW_set_cad_background() 165

IMGLOW_set_cad_input() 165

IMGLOW_set_cad_size() 166

Chapter 18 - HTML Functions 167

IMGLOW_set_html_capabilities() 167

IMGLOW_set_html_home_dir() 168

IMGLOW_set_html_image_capability() 168

IMGLOW_set_html_input() 169

IMGLOW_set_html_javascript_capability() 169

IMGLOW_set_html_page_size() 170

xi
IMGLOW_set_html_page_size_ratio() 171

IMGLOW_set_html_page_size_ratio_capability() 171

IMGLOW_set_html_screen_dpi() 172

IMGLOW_set_html_use_page_breaks_exclusively() 172

IMGLOW_set_html_utf_bom() 173

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

IMGLOW_set_ooxml_license() 176

IMGLOW_ooxml_license_enable() 176

IMGLOW_set_ooxml_licenseW() 177

Previous Word 2007 Open Office XML (OOXML) Functions 178

IMGLOW_get_ooxml_license_location() 178

IMGLOW_set_ooxml_license_filename() 178

IMGLOW_set_ooxml_license_filenameW() 179

IMGLOW_set_ooxml_license_path() 179

IMGLOW_set_ooxml_license_pathW() 180

Chapter 20 - DocClean Functions 181

IMG_auto_orient() 181

IMG_deskew_bitmap() 181

IMG_despeckle_bitmap() 182

IMGLOW_auto_invert() 183

IMGLOW_detect_blank_page() 184

IMGLOW_remove_halftone() 185

IMGLOW_remove_holepunch() 186

Chapter 21 - Image Processing Functions 188

xii
IMG_apply_profile() 188

IMG_cmyk_to_rgb() 189

IMG_create_thumbnail() 189

IMG_deskew_bitmap() 190

IMG_despeckle_bitmap() 191

IMG_display_fit_to_height() 192

IMG_display_fit_to_width() 192

IMG_flip_bitmapx() 193

IMG_flip_bitmapy() 194

IMG_get_deskew_angle() 195

IMG_get_profile() 196

IMG_histogram_equalize() 196

IMG_invert_bitmap() 197

IMG_process_bitmap() 197

IMG_resize_bitmap() 198

IMG_resize_bitmap_bicubic() 199

IMG_resize_bitmap_interp() 200

IMG_resize_to_gray() 201

IMG_rgb_to_cmyk() 201

IMG_rotate_bitmap() 202

IMG_set_gamma() 203

IMG_set_lut() 204

IMG_sharpen_bitmap() 204

IMG_window_level() 205

xiii
IMGLOW_get_auto_detect() 206

IMGLOW_get_fileinfo_fd() 206

IMGLOW_get_palette() 207

IMGLOW_put_palette() 208

IMGLOW_read_pixel() 208

IMGLOW_set_auto_detect() 209

IMGLOW_set_decompsize() 209

IMGLOW_set_decomp_rect() 210

IMGLOW_set_decomp_reduction() 210

IMGLOW_set_dithermode() 211

IMGLOW_set_fast_convert() 212

IMGLOW_set_imnet_page_size() 213

IMGLOW_set_pcl_input() 213

IMGLOW_unset_auto_detect() 214

Chapter 22 - Bit Depth Conversion Functions 215

IMG_bayer_color() 215

IMG_bayer_mono() 215

IMG_color_gray() 216

IMG_dib_to_runs() 217

IMG_diffusion_color() 217

IMG_diffusion_mono() 218

IMG_halftone_mono() 219

IMG_mediancut_color() 219

IMG_octree_color() 220

xiv
IMG_popularity_color() 221

IMG_runs_to_dib() 222

IMG_thresh_mono() 222

IMGLOW_get_filetype_mem() 223

IMGLOW_get_raster() 223

IMGLOW_put_raster() 224

IMGLOW_set_alias_quality() 225

Chapter 23 - Document Conversion and Text Extraction 226

Document Conversion and Text Extraction Overview 226

IMGLOW_extract_text() 226

IMGLOW_extract_text_mem() 229

IMG_save_document() 229

IMG_save_document_mem() 233

Chapter 24 - AFP Font Mapping Functions 234

AFP Font Mapping 234

Format of Font Mapping Data 234

Color Documents Rendered as Black and White 235

IMGLOW_set_fontmap_path() 235

IMGLOW_set_fontmap() 236

IMGLOW_set_pdfa_font_path() 237

IMGLOW_set_pdfa_font_map() 237

Chapter 25 - Standard UNIX and XWindows Specific Functions 239

IMG_global_get_Xdisplay() 239

IMG_global_set_Xdisplay() 239

xv
IMG_global_get_Xscreen 240

IMG_global_set_Xscreen 240

IMG_global_get_Xreserverd_colors() 240

IMG_global_set_Xreserved_colors() 241

IMG_repaint_scroll() 241

IMG_scroll_bitmap() 242

IMG_zoom_bitmap() 243

IMG_zoom_bitmap_1_to_1() 244

IMG_zoom_bitmap_rect() 245

Chapter 26 - Macintosh High Level and Image Management Functions 247

IMG_dib_to_GWorld() 247

IMG_dib_to_GWorld_bitDepth() 247

IMG_GWorld_to_dib() 248

IMG_display_bitmap_aspect() 249

IMG_repaint_scroll 249

IMG_scroll_bitmap() 250

IMG_set_croprect_scroll() 251

IMG_zoom_bitmap 252

IMG_zoom_bitmap_rect() 253

IMG_zoom_bitmap_1_to_1() 254

Chapter 27 - Format for Decompressed Images 255

Overview of Data Formats 255

RasterMaster Plus Options 255

MS_Windows DIB Header Format 256

xvi
MS_Windows DIB Palette Format 257

MS_Windows DIB Image Data Format 257

Chapter 28 - Annotation and Redlining Toolkit 258

ANN_GRAPHIC_STRUCT Structure 258

Structure 258

Variables 259

SANN_activate_all_objects() 260

SANN_activate_object() 260

SANN_add_object() 261

SANN_choose_color() 261

SANN_choose_font() 262

SANN_choose_line_style() 262

SANN_choose_line_width() 262

SANN_create_ann() 263

SANN_deactivate_all_objects() 263

SANN_deactivate_object() 264

SANN_delete_all_objects() 264

SANN_delete_object() 264

SANN_display_annotations() 265

SANN_draw_object() 266

SANN_get_croprect() 266

SANN_get_object_bounds() 267

SANN_get_object_data() 267

SANN_get_object_info() 267

xvii
SANN_get_object_num() 268

SANN_highlight_object() 268

SANN_map_image_to_wnd() 269

SANN_map_wnd_to_image() 269

SANN_merge_ann() 270

SANN_mouse() 270

SANN_move_object() 271

SANN_print_annotations() 271

SANN_read_ann() 272

SANN_resize_object() 272

SANN_rotate() 272

SANN_set_bcolor() 273

SANN_set_croprect() 273

SANN_set_delete_flag() 274

SANN_set_fcolor() 274

SANN_set_font() 275

SANN_set_line_style() 275

SANN_set_line_width() 276

SANN_set_size() 276

SANN_write_ann() 276

Annotation Constants 277

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

Working with Document File Formats 278

Saving 279

xviii
Reading and Writing Support for PDF File Formats 279

Reading or Decompressing a PDF Document 280

Saving to a PDF Document 280

Working with Black and White Images 280

Working with Color Images 280

Changing Output Page Size 280

Performance 280

Appendix A - Supported File Formats 281

Descriptions of Supported File Formats 281

File Type Constants Listed by File Type Number 293

Appendix B - Software Installation 296

Overview of the Installation Process 296

Redistributing Snowbound Files 297

What to Expect When Installing an Evaluation Version 297

What to Expect in a Production Version 297

Installing the Production Version of RasterMaster DLL 297

Installing the Software 298

Directory Structure 302

Installed Files 302

Main Directory Files 303

Docs Directory Files 304

Marketing Directory Files 304

Sample Directory Files 304

Appendix C - RasterMaster DLL Samples 307

xix
Alpha 308

Animate 308

Annotate 309

Aspect 309

Callback 310

Encrypt 310

Fit 311

Format Conversion 311

Load 312

MFC_Sample 312

MFC_TextSearch_TextExtract_Sample 313

Multi-page Splitting and Saving 314

Page 314

Print 315

Save Searchable PDF 315

SaveMem 316

Scan 316

Tags 317

Transp 317

Vector_Convert 318

Zoom 318

Appendix D - TIFF Tags 320

Sources for Tag Specifications 320

Descriptions of Tags in Numerical Order 321

xx
Appendix E - Snowbound Error Codes 352

Detailed Status/Error Codes 352

General Error Define Values Retrieved from Status Property 355

General Status/Error Codes 355

Appendix F - Troubleshooting 357

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

Output Document Differs from Original Document 357

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

Output Document Has Much Lower Quality than the Original Document 358

Output Document Displays Incorrect or Missing Characters 359

Improving Performance 359

Identifying an Unknown File Format 360

Receiving a -3 Corrupted File Error code 360

Overlay Resources Not Pulled into APF or MODCA Document 360

Searching for Text in a Snowbound Software Generated PDF 360

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


Image Viewers 361

Color Documents Rendered as Black and White 361

xxi
List of Tables

Table 2.1: RasterMaster DLL MFC_Sample Directory 39

Table 2.2: RasterMaster DLL C_Samples Directory 39

Table 2.3: Memory Requirements Based on Image Size 44

Table 3.1: Supported Multi-page Functions 46

Table 7.1: Aspect Ratio Function Descriptions 52

Table 12.1: IMG_animate Function Variables 60

Table 12.2: IMG_autocrop_bitmap Function Variables 61

Table 12.3: IMG_bitmap_info Function Variables 63

Table 12.4: IMG_bitmap_palette Function Variables 64

Table 12.5: IMG_color_combine Function Variables 65

Table 12.6: IMG_color_separate Function Variables 65

Table 12.7: IMG_color_gray Function Variable 66

Table 12.8: IMG_create_handle Function Variable 67

Table 12.9: IMG_create_handle_keep Function Variable 67

Table 12.10: IMG_create_handle_shell Function Variable 68

Table 12.11: IMG_decompress_bitmap Function Variable 69

Table 12.12: IMG_decompress_bitmap_display Function Variables 70

Table 12.13: IMG_decompress_bitmap_fd Function Variables 71

Table 12.14: IMG_decompress_bitmap_mem Function Variables 71

Table 12.15: IMG_decompress_bitmap_page Function Variables 72

Table 12.16: IMG_decompress_fax Function Variables 73

Table 12.17: IMG_decompress_fax_mem Function Variables 74

xxii
Table 12.18: IMG_decompress_tiled_bitmap Function Variables 74

Table 12.19: IMG_delete_bitmap Function Variable 76

Table 12.20: IMG_delete_bitmap_keep Function Variable 76

Table 12.21: IMG_dib_to_ddb Function Variables 77

Table 12.22: IMG_display_bitmap Function Variables 78

Table 12.23: IMG_display_bitmap_aspect Variables 79

Table 12.24: IMG_display_bitmap_dti Function Variables 79

Table 12.25: IMG_display_bitmap_iac Function Variables 80

Table 12.26: IMG_display_bitmap_transp Function Variables 81

Table 12.27: IMG_display_ddb Function Variables 82

Table 12.28: IMG_erase_rect Function Variables 82

Table 12.29: IMG_print_bitmap Function Variables 84

Table 12.30: IMG_print_bitmap_fast Function Variables 85

Table 12.31: IMG_remove_red_eye Function Variables 86

Table 12.32: IMG_save_bitmap Function Variables 87

Table 12.33: IMG_save_bitmap_fd Function Variables 88

Table 12.34: IMG_save_bitmap_mem Function Variables 88

Table 12.35: IMG_save_mem Function Variables 89

Table 12.36: IMG_set_encrypt Function Variables 90

Table 13.1: IMG_scan_acquire Function Variables 93

Table 13.2: IMG_scan_acquire_feeder Function Variables 93

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 95

xxiii
Table 13.6: IMG_scan_page_fast Function Variables 96

Table 13.7: IMG_scan_get_cap Function Variables 97

Table 13.8: IMG_scan_set_cap Function Variables 97

Table 13.9: IMG_scan_set_caps Function Variable 98

Table 13.10: IMG_scan_setup Function Variable 98

Table 14.1: IMG_create_handle_ddb Function Variables  100

Table 14.2: IMG_display_ddb_effect Function Variables 100

Table 14.3: IMG_get_bitmap_palette Function Variable 101

Table 14.4: IMG_get_croprect Function Variables  102

Table 14.5: IMG_ifl_version Function Variables 103

Table 14.6: IMG_ifl_version_ext Function Variables 104

Table 14.7: IMG_merge_bitmap Function Variables 104

Table 14.8: IMG_merge_bitmap_alpha Function Variables 106

Table 14.9: IMG_merge_bitmap_handle Function Variables 107

Table 14.10: IMG_promote_8 Function Variable 108

Table 14.11: IMG_promote_24 Function Variable 108

Table 14.12: IMG_promote_32 Function Variable 109

Table 14.13: IMG_repaint_scroll Function Variables 110

Table 14.14: IMG_scroll_bitmap Function Variables 112

Table 14.15: IMG_set_croprect Function Variables 112

Table 14.16: IMG_set_croprect_scroll Function Variables 114

Table 14.17: IMG_set_display_angle Function Variables 114

Table 14.18: IMG_set_statusbar Function Variables 115

Table 14.19: IMG_zoom_bitmap Function Variables 116

xxiv
Table 14.20: IMG_zoom_bitmap_rect Function Variables 117

Table 14.21: IMG_zoom_bitmap_1_to_1 Function Variables 117

Table 14.22: IMGLOW_map_image_to_wnd Function Variables 118

Table 14.23: IMGLOW_map_wnd_to_image Function Variables 119

Table 14.24: IMGLOW_get_fileinfo Function Variables 119

Table 14.25: IMGLOW_get_fileinfo_page Function Variables 120

Table 14.26: IMGLOW_set_rop Function Variables 120

Table 14.27: IMGLOW_set_fileio Function Variables 122

Table 14.28: IMGLOW_set_wipedelay Function Variable 122

Table 15.1: ASCIITEXTATTR Function Flags 125

Table 15.2: IMG_import_ascii Function Variables 126

Table 15.3: IMG_RECT Function Variables 126

Table 15.4: IMGLOW_get_ascii_attributes Function Variable 127

Table 15.5: IMGLOW_get_ascii_page_width Function Variable 127

Table 15.6: IMGLOW_set_ascii_attributes Function Variable 128

Table 16.1: IMGLOW_autocolor Function Variable 129

Table 16.2: IMGLOW_decompress_bitmap Function Variables 130

Table 16.3: put_dib_data Callback Routine Variables  130

Table 16.4: set_header Callback Routine Variables 131

Table 16.5: IMGLOW_decompress_bitmap_mem Function Variables  131

Table 16.6: put_dib_data Callback Routine Variables 132

Table 16.7: set_header Callback Routine Variables 133

Table 16.8: IMGLOW_extract_text Function Variables 135

Table 16.9: Extracted Text Variables 135

xxv
Table 16.10: IMGLOW_extract_text_mem Function Variables 136

Table 16.11: IMGLOW_get_anim_delay Function Variable 137

Table 16.12: IMGLOW_get_bitmap_header Function Variables 137

Table 16.13: IMGLOW_get_bitmap_name Function Variables 138

Table 16.14: IMGLOW_get_custstring Function Variable 138

Table 16.15: IMGLOW_get_display_rect Function Variables 139

Table 16.16: IMGLOW_get_filetype Function Variable 140

Table 16.17: IMGLOW_get_filetype_fd Function Variable 140

Table 16.18: IMGLOW_get_image_orientation Function Variable 141

Table 16.19: IMGLOW_get_image_orientation_page Function Variables 141

Table 16.20: IMGLOW_get_pages Function Variable 142

Table 16.21: IMGLOW_get_pages_fd Function Variable 143

Table 16.22: IMGLOW_get_pages_mem Function Variable 143

Table 16.23: IMGLOW_get_tiff_tag Function Variables 144

Table 16.24: IMGLOW_get_tiff_tag_page Function Variables 144

Table 16.25: IMGLOW_get_tiff_tag_page_mem Function Variables 145

Table 16.26: IMGLOW_get_tile_info Function Variables 146

Table 16.27: IMGLOW_get_transp_color Function Variable 147

Table 16.28: IMGLOW_save_bitmap Function Variables 148

Table 16.29: get_dib_data Callback Routine Variables 148

Table 16.30: IMGLOW_save_bitmap_mem Function Variables 149

Table 16.31: get_dib_data Callback Routine Variables 149

Table 16.32: IMGLOW_search_text Function Variables 150

Table 16.33: IMGLOW_set_alias Function Variable 152

xxvi
Table 16.34: IMGLOW_set_alias_img Function Variables 152

Table 16.35: IMGLOW_set_bitmap_name Function Variables 153

Table 16.36: IMGLOW_set_comp_quality Function Variable 153

Table 16.37: IMGLOW_set_dispfunc Function Variable 154

Table 16.38: IMGLOW_set_document_input Function Variable 155

Table 16.39: IMGLOW_set_document_page_size Function Variable 156

Table 16.40: IMGLOW_set_image_orientation Function Variable 156

Table 16.41: IMGLOW_set_jpeg_decompression Function Variable 157

Table 16.42: W_set_jpeg2000_comp_ratio Function Variable 157

Table 16.43: IMGLOW_set_jpg_interleave Function Variables 158

Table 16.44: IMGLOW_set_msg_render_preferences Function Variables 159

Table 16.45: IMGLOW_set_pdf_input Function Variables 160

Table 16.46: IMGLOW_set_pdf_output Function Variables 161

Table 16.47: IMGLOW_set_pdf_password Function Variables 161

Table 16.48: IMGLOW_set_tiff_save_strips Function Variable 162

Table 16.49: IMGLOW_set_tiff_tag Function Variables 162

Table 16.50: IMGLOW_set_transp_color Function Variables 163

Table 16.51: IMGLOW_write_tiff_stream Function Variables 164

Table 17.1: IMGLOW_set_cad_background Function Variables 165

Table 17.2: IMGLOW_set_cad_input Function Variables 165

Table 17.3: IMGLOW_set_cad_size Function Variables 166

Table 18.1: IMGLOW_set_html_capabilities Function Variables  167

Table 18.2: IMGLOW_set_html_home_dir Function Variables 168

Table 18.3: IMGLOW_set_html_image_capability Function Variables 169

xxvii
Table 18.4: IMGLOW_set_html_input Function Variables 169

Table 18.5: IMGLOW_set_html_javascript_capability Function Variables 170

Table 18.6: IMGLOW_set_html_page_size Function Variables 170

Table 18.7: IMGLOW_set_html_page_size_ratio Function Variables 171

Table 18.8: IMGLOW_set_html_page_size_ratio_capability Function Variables 171

Table 18.9: IMGLOW_set_html_screen_dpi Function Variables 172

Table 18.10: IMGLOW_set_html_use_page_breaks_exclusively Function Variables 172

Table 18.11: IMGLOW_set_html_utf_bom Function Variables 173

Table 18.12: Representations of byte order marks by encoding 174

Table 19.1: IMGLOW_set_ooxml_license Function Variable 176

Table 19.2: IMGLOW_ooxml_license_enable  Function Variable 177

Table 19.3: IMGLOW_set_ooxml_licenseW Function Variable 177

Table 19.4: IMGLOW_get_ooxml_license_location Function Variable 178

Table 19.5: IMGLOW_set_ooxml_license_filename Function Variables 179

Table 19.6: IMGLOW_set_ooxml_license_filenameW Function Variables 179

Table 19.7: IMGLOW_set_ooxml_license_path function variable descriptions. 179

Table 19.8: IMGLOW_set_ooxml_license_pathW Function Variables 180

Table 20.1: IMG_auto_orient Function Variables 181

Table 20.2: IMG_deskew_bitmap Function Variables 182

Table 20.3: IMG_despeckle_bitmap Function Variables 183

Table 20.4: IMGLOW_auto_invert Function Variable 183

Table 20.5: IMGLOW_detect_blank_page Function Variable 184

Table 20.6: IMGLOW_remove_halftone Function Variable 185

Table 20.7: IMGLOW_remove_holepunch Function Variable 186

xxviii
Table 21.1: IMG_apply_profile Function Variables 188

Table 21.2: IMG_apply_profile Modes 188

Table 21.3: IMG_cmyk_to_rgb Function Variable 189

Table 21.4: IMG_create_thumbnail Function Variables 190

Table 21.5: IMG_deskew_bitmap Function Variables 190

Table 21.6: IMG_despeckle_bitmap Function Variable 191

Table 21.7: IMG_display_fit_to_height Function Variables 192

Table 21.8: IMG_display_fit_to_width Function Variables 193

Table 21.9: IMG_flip_bitmapx Function Variable 193

Table 21.10: IMG_flip_bitmapy Function Variable 194

Table 21.11: IMG_get_deskew_angle Function Variables 195

Table 21.12: IMG_get_profile Function Variables 196

Table 21.13: IMG_histogram_equalize Function Variable 196

Table 21.14: IMG_invert_bitmap Function Variable 197

Table 21.15: IMG_process_bitmap Function Variables 197

Table 21.16: IMG_resize_bitmap Function Variables 199

Table 21.17: IMG_resize_bitmap_bicubic Function Variables 199

Table 21.18: IMG_resize_bitmap_interp Function Variables 200

Table 21.19: IMG_resize_to_gray Function Variables 201

Table 21.20: IMG_rgb_to_cmyk Function Variable 201

Table 21.21: IMG_rotate_bitmap Function Variables 202

Table 21.22: IMG_set_gamma Function Variables 203

Table 21.23: IMG_set_lut Function Variables 204

Table 21.24: IMG_sharpen_bitmap Function Variables 205

xxix
Table 21.25: IMG_window_level Function Variables 206

Table 21.26: IMGLOW_get_auto_detect Function Variable 206

Table 21.27: IMGLOW_get_fileinfo_fd Function Variables 207

Table 21.28: IMGLOW_get_palette Function Variables 207

Table 21.29: IMGLOW_put_palette Function Variables 208

Table 21.30: IMGLOW_read_pixel Function Variables 209

Table 21.31: IMGLOW_set_auto_detect Function Variable 209

Table 21.32: IMGLOW_set_decompsize Function Variables 210

Table 21.33: IMGLOW_set_decomp_rect Function Variables 210

Table 21.34: IMGLOW_set_decomp_reduction Function Variable 211

Table 21.35: IMGLOW_set_dithermode Function Variable 211

Table 21.36: IMGLOW_set_fast_convert Function Variables 212

Table 21.37: IMGLOW_set_imnet_page_size Function Variables 213

Table 21.38: IMGLOW_set_pcl_input Function Variables 213

Table 21.39: IMGLOW_unset_auto_detect Function Variable 214

Table 22.1: IMG_bayer_color Function Variable 215

Table 22.2: IMG_bayer_mono Function Variable 216

Table 22.3: IMG_color_gray Function Variable 216

Table 22.4: IMG_dib_to_runs Function Variable 217

Table 22.5: IMG_diffusion_color Function Variable 217

Table 22.6: IMG_diffusion_mono Function Variable 218

Table 22.7: IMG_halftone_mono Function Variable 219

Table 22.8: IMG_mediancut_color Function Variable 219

Table 22.9: IMG_octree_color Function Variables 220

xxx
Table 22.10: IMG_popularity_color Function Variable 221

Table 22.11: IMG_runs_to_dib Function Variable 222

Table 22.12: IMG_thresh_mono Function Variables 222

Table 22.13: IMGLOW_get_filetype_mem Function Variable 223

Table 22.14: IMGLOW_get_raster Function Variables 224

Table 22.15: IMGLOW_put_raster Function Variables 224

Table 22.16: IMGLOW_set_alias_quality Function Variable 225

Table 23.1: IMGLOW_extract_text Function Variables 227

Table 23.2: Extracted Text Variables 228

Table 23.3: IMGLOW_extract_text_mem Function Variables 229

Table 23.4: IMG_save_document Function Variables 230

Table 23.5: IMG_save_document_mem Function Variables 233

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

Table 24.2: IMGLOW_set_fontmap_path Function Variables  236

Table 24.3: IMGLOW_set_fontmap Function Variables 236

Table 24.4: IMGLOW_set_pdfa_font_path(String pdfaFontPath) Method Variables 237

Table 24.5: IMGLOW_set_pdfa_font_map Method Variables 238

Table 25.1: IMG_global_set_Xdisplay Function Variable 239

Table 25.2: IMG_global_set_Xscreen Function Variable 240

Table 25.3: IMG_global_set_Xreserverd_colors Function Variable 241

Table 25.4: IMG_repaint_scroll Function Variables  242

Table 25.5: IMG_scroll_bitmap Function Variables 243

Table 25.6: IMG_zoom_bitmap Function Variables 244

Table 25.7: IMG_zoom_bitmap_1_to_1 Function Variables 244

xxxi
Table 25.8: IMG_zoom_bitmap_rect Function Variables 245

Table 26.1: IMG_dib_to_GWorld Function Variables 247

Table 26.2: IMG_dib_to_GWorld_bitDepth Function Variable 248

Table 26.3: IMG_GWorld_to_dib Function Variables 248

Table 26.4: IMG_display_bitmap_aspect Variables 249

Table 26.5: IMG_repaint_scroll Function Variables 250

Table 26.6: IMG_scroll_bitmap Function Variables 251

Table 26.7: IMG_set_croprect_scroll Function Variables 252

Table 26.8: IMG_zoom_bitmap Function Variables 252

Table 26.9: IMG_zoom_bitmap_rect Function Variables 253

Table 26.10: IMG_zoom_bitmap_1_to_1 Function Variables 254

Table 28.1: ANN_GRAPHIC_STRUCT Class Variables 259

Table 28.2: SANN_activate_all_objects Function Variable 260

Table 28.3: SANN_activate_objectFunction Variables 261

Table 28.4: SANN_add_object Function Variables 261

Table 28.5: SANN_choose_color Function Variable 261

Table 28.6: SANN_choose_font Function Variable 262

Table 28.7: SANN_choose_line_style Function Variable 262

Table 28.8: SANN_choose_line_width Function Variable 263

Table 28.9: SANN_create_ann Function Variables 263

Table 28.10: SANN_deactivate_all_objects Function Variable 263

Table 28.11: SANN_deactivate_object Function Variables 264

Table 28.12: SANN_delete_all_objects Function Variable 264

Table 28.13: SANN_delete_object Function Variables 265

xxxii
Table 28.14: SANN_display_annotations Function Variables 265

Table 28.15: SANN_draw_object Function Variables 266

Table 28.16: SANN_get_croprect Function Variables 266

Table 28.17: SANN_get_object_bounds Function Variables 267

Table 28.18: SANN_get_object_dataFunction Variables 267

Table 28.19: SANN_get_object_info Function Variables 268

Table 28.20: SANN_get_object_numFunction Variables 268

Table 28.21: SANN_highlight_object Function Variables 268

Table 28.22: SANN_map_image_to_wnd Function Variables 269

Table 28.23: SANN_map_wnd_to_image Function Variables 269

Table 28.24: SANN_merge_ann Function Variables 270

Table 28.25: SANN_mouse Function Variables 270

Table 28.26: SANN_move_object Function Variables 271

Table 28.27: SANN_print_annotations Function Variables 271

Table 28.28: SANN_read_ann Function Variables 272

Table 28.29: SANN_resize_object Function Variables 272

Table 28.30: SANN_rotate Function Variables 273

Table 28.31: SANN_set_bcolor Function Variables 273

Table 28.32: SANN_set_croprect Function Variables 273

Table 28.33: SANN_delete_flag Function Variable 274

Table 28.34: SANN_set_fcolor Function Variables 274

Table 28.35: SANN_set_font Function Variables 275

Table 28.36: SANN_set_line_style Function Variables 275

Table 28.37: SANN_set_line_width Function Variables 276

xxxiii
Table 28.38: SANN_set_size Function Variables 276

Table 28.39: SANN_write_ann Function Variables 277

Table 28.40: Annotation Constants 277

Table 29.1: IMGLOW_set_document_input Function Variable 279

Table 29.2: IMGLOW_set_pdf_output Function Variables 279

Table A.1: File Format Key 281

Table A.2: Supported File Format Descriptions 282

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

Table B.1: RasterMaster DLL Default Directory Files 303

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

Table B.3: RasterMaster DLL Marketing Directory Files 304

Table B.4: RasterMaster DLL Imaging SDK C_Samples Directory 304

Table D.1: TIFF Tags in Numerical Order1 321

Table E.1: Error Codes 352

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

Table E.3: General Status/Error Codes 355

xxxiv
Chapter 1 - Additions and Improvements

Chapter 1 - Additions and Improvements


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

Version 19.0 Additions and Improvements


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

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

Format Fixes

l
Enhancements and bug fixes to the AFP file format.

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

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

Office Enhancements

l
Added support for tab lead, paragraph border, and shading to extracted text buffer. Also
fixed center aligned images in extracted content used for searchable PDF output.

l
An XLSX document created by an application other than Microsoft Excel contained a
double byte null in the CONTINUE portion of a definition in the strings table. This is a
very unusual, but valid, construct. Enhanced RasterMaster to accept the double byte
NULL in the string definitions.

l
Added support for XLS custom and locale-specific date formats. In xls_use_format()
added support for the following custom date format:

[$-F800]dddd, mmmm dd, yyyy

PDF/A 1b with Embedded Fonts Beta Support

l
Added beta support for PDF/A 1b with Embedded Fonts. Snowbound’s PDF/A 1b-com-
pliant output files use the basic fonts included with the Snowbound product. This may
result in the PDF output document looking slightly different than the original. You may
have additional fonts that you are licensed to embed in documents. You can tell Raster-
Master to use these additional fonts by calling IMGLOW_set_pdfa_fontpath to specify
the directory where the fonts are located.

35
Chapter 1 - Additions and Improvements

You can also tell RasterMaster to substitute one font for another using IMGLOW_set_
pdfa_fontmap. For example, if your documents use Arial but you own the Helvetica font
and want to use that instead, you could map Arial to Helvetica using this method.

The following two methods are available to make it possible for clients to have a bit of
control over the fonts:

IMGLOW_set_pdfa_fontpath tells us where to look for the base fonts. If this function is
not called, the fonts are expected to be in c:\fonts. The path is limited to one directory.

IMGLOW_set_pdfa_fontmap. allows the client to provide a stream of bytes defining the


mapping from one font/style to another. The remapData stream should contain multiple
entries separated by a newline character. The len parameter indicates how many bytes
are in the stream.

Enhanced Support for MS Office 2013 File Formats

l
Enhanced support for MS Office 2013 file formats.

DWG Support for the 64-bit Library

l
Added DWG support for the 64-bit library.

UTF-8 Text Format Improvements for .NET

l
The Text format now supports auto-detection and handling of UTF-8 and UTF-16 text for
better support of international documents. UTF-16 text must be preceded by a Byte
Order Marker (BOM).

Added Support for Page Width Auto-grow

l Added functionality to auto-grow page width to accommodate files with many columns.
To set auto-grow in width to true set the page width parameter to -1 as shown in the fol-
lowing example:

IMGLOW_set_document_page_size(-1.0, 11, XLS)

Setting the width to -1 for auto-grow defaults the page width to US Letter (8.5").
The page width will auto-grow to fit all columns and image data in the file.

This is supported for XLS, XLSX. It should have no affect on DOC, DOCX, PPT,
PPTX, HTML or PDF files.

Currently there is no auto-grow in page height. Setting the page height to -1 will
not auto-grow the height, but instead set the height to a default value. For
example: US Letter 11”.

Right-to-Left (RTL) Text Searching

l Improved searching for Right-to-Left (RTL) text such as Hebrew and Arabic.

36
Chapter 1 - Additions and Improvements

Note:
Mixing Right-to-Left, numbers, and Left-to-Right characters on the same line may result
in unexpected results. We recommend not mixing the direction of characters.

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

38
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
TextSearch extract 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
animate
information.
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

39
Chapter 2 - Quick Start

Sample Description
Use display with corrected aspect ratio

See Aspect for more information.


Sample showing how to use Snowbound Image
callback Library for low-level call-back for decompress. See
Callback for more information.
Sample showing how to use the Snowbound Library
encrypt for a 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-ali-
page
asing if desired. See Page for more information.
Sample for printing and status bar. See Print for
print
more information.
Sample for scanning images. See Scan for more
scan
information.
Sample for converting image formats. See Format
simpleformatconversion
Conversion for more information.
Sample for saving multi-page images. See Multi-
simplemutlipagsplitting
page Splitting and Saving for more information.
Sample showing how to use Snowbound Library for
tags
reading .TIF tags. See Tags for more information.
Sample showing how to use Snowbound Library for
transp a 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.

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

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

42
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,

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

59
Chapter 12 - High Level Functions

Chapter 12 - High Level Functions


This chapter describes the RasterMaster DLL high-level functions.

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

60
Chapter 12 - High Level Functions

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

Remark

Table 12.2: 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.

61
Chapter 12 - High Level Functions

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.

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 Page

l Print

l Scan

l Tags

62
Chapter 12 - High Level Functions

l Transp

l Zoom

Syntax

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


*height, int *bits_per_pixel);

Remark

Table 12.3: IMG_bitmap_info Function Variables

Variable Description
Standard image handle obtained from a decompress function
imghandle
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

63
Chapter 12 - High Level Functions

l Aspect

l Encrypt

l Fit

l Load

l Page

l Print

l Scan

l Tags

l Transp

l Zoom

Syntax

int SNBDAPI IMG_bitmap_palette(int imghandle, IMGPORT hdc);

Remark

Table 12.4: 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);

64
Chapter 12 - High Level Functions

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.5: IMG_color_combine Function Variables

Variable Description
Standard image handle for 8-bit gray-scale image which
blue_handle
represents the blue plane (cyan).
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.6: IMG_color_separate Function Variables

65
Chapter 12 - High Level Functions

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

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

66
Chapter 12 - High Level Functions

Syntax

int SNBDAPI IMG_create_handle(LPDIB_HEADER lpbih);

Remark

Table 12.8: 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.

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

67
Chapter 12 - High Level Functions

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

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

68
Chapter 12 - High Level Functions

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.11: IMG_decompress_bitmap Function Variable

Variable Description
filename File or path/filename of the image to load

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.

69
Chapter 12 - High Level Functions

Syntax

int SNBDAPI IMG_decompress_bitmap_display(char *filename, IMGPORT


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

Remark

Table 12.12: 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.

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

l Page

Syntax

int SNBDAPI IMG_decompress_bitmap_fd(int fd, unsigned long offset,


int page);

70
Chapter 12 - High Level Functions

Remark

Table 12.13: 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.

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

71
Chapter 12 - High Level Functions

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 MFC_Sample

l MFC_TextSearch_TextExtract_Sample

Note:
Only use this function when utilizing the optional Adobe PDF plugin.

Syntax

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

Remark

Table 12.15: 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.

72
Chapter 12 - High Level Functions

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

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

73
Chapter 12 - High Level Functions

Remark

Table 12.17: 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.

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

74
Chapter 12 - High Level Functions

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

l MFC_TextSearch_TextExtract_Sample

l Multi-page Splitting and Saving

l Page

l Print

l Scan

l Tags

l Transp

l Zoom

Syntax

int SNBDAPI IMG_delete_bitmap(int imghandle);

75
Chapter 12 - High Level Functions

Remark

Table 12.19: 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);

Remark

Table 12.20: 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);

76
Chapter 12 - High Level Functions

Remark

Table 12.21: 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.

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

77
Chapter 12 - High Level Functions

Remark

Table 12.22: 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.

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

78
Chapter 12 - High Level Functions

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

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.24: IMG_display_bitmap_dti Function Variables

79
Chapter 12 - High Level Functions

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.

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

80
Chapter 12 - High Level Functions

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

Remark

Table 12.26: 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.

81
Chapter 12 - High Level Functions

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

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

82
Chapter 12 - High Level Functions

Variable Description
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

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.

83
Chapter 12 - High Level Functions

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.29: 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
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);

84
Chapter 12 - High Level Functions

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

85
Chapter 12 - High Level Functions

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

86
Chapter 12 - High Level Functions

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

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

87
Chapter 12 - High Level Functions

Remark

Table 12.33: 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.

Syntax

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


type);

Remark

Table 12.34: 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

88
Chapter 12 - High Level Functions

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_save_mem()
The function allows saving to a memory buffer which is returned. It calculates the size of the
memory buffer and grows it appropriately.

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

Syntax

int SNBDAPI IMG_save_mem(int hdib, int initial_size, int buff_inc,


int comp_type, int *data_size, int *error);

Remark

Table 12.35: IMG_save_mem Function Variables

Variable Description
hdib Snowbound handle referencing image to save.
initial_size Starting size of buffer to allocate.
Amount to grow the buffer if more space is needed to
buff_inc
save.
Compression type to save to. See Appendix A, Supported
comp_type
File Formats for all image types allowed.
An integer size array with one value of the final size of the
*data_size
saved buffer.
*error A one integer array to return an error code if failing.

Returns

Returns the memory buffer. 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_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.

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

90
Chapter 12 - High Level Functions

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

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.

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;

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

92
Chapter 13 - Scanning Functions

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

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.

93
Chapter 13 - Scanning Functions

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

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.

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.

94
Chapter 13 - Scanning Functions

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.

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

95
Chapter 13 - Scanning Functions

Variable Description
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
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

96
Chapter 13 - Scanning 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_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);

Remark

Table 13.8: IMG_scan_set_cap Function Variables

Variable Descripition
hwnd Handle of parent window for the source dialog

97
Chapter 13 - Scanning Functions

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

Remark

Table 13.10: IMG_scan_setup Function Variable

98
Chapter 13 - Scanning Functions

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.

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

100
Chapter 14 - Image Management Functions

Variable Description
xpos Starting X coordinate for display of image
ypos Starting Y coordinate for display of image
Display the following effect:

1 - (Default) Display image with no image effects

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 ver-
tical lines

4 - Displays image in the Window from the left to the right side using ver-
tical lines

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

101
Chapter 14 - Image Management Functions

Returns

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

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

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

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

104
Chapter 14 - Image Management Functions

Variable Description
ROP opcode obtained from the list below or the Windows
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.

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

105
Chapter 14 - Image Management Functions

Variable Description
map.

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

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

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

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

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

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

111
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

112
Chapter 14 - Image Management Functions

Variable Description
Standard image handle obtained from a decompress func-
imghandle
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);

113
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

114
Chapter 14 - Image Management Functions

Variable Description
Standard image handle obtained from a decompress func-
imghandle
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
private_data wants 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

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

IMG_zoom_bitmap_rect()
This function is most effective for resizing a window. It turns the scroll bars on or off to allow
scrolling.

116
Chapter 14 - Image Management Functions

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.

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

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
imghandle Standard image handle obtained from a decompress func-

117
Chapter 14 - Image Management Functions

Variable Description
tion such as IMG_decompress_bitmap()
hwnd Active window handle
zoom_level Amount to zoom
center_flag Recenters image if set to 1

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.

118
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 following samples:

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

119
Chapter 14 - Image Management Functions

Variable Description
filename Any valid existing image on the disk
lpbih Pointer to a BITMAPINFOHEADER structure

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
imghandle Standard image handle obtained from a decompress func-

120
Chapter 14 - Image Management Functions

Variable Description
tion such as IMG_decompress_bitmap().
Boolean opcode to use when displaying the image. See
the list below for the available opcode or consult your
Windows SDK manual.

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

121
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

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

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

124
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,

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

126
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

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

128
Chapter 16 - Low Level Functions

Chapter 16 - Low Level Functions


This chapter describes the RasterMaster DLL low-level functions.

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

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.

129
Chapter 16 - Low Level Functions

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.

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.

130
Chapter 16 - Low Level Functions

Variable Description
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
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_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

131
Chapter 16 - Low Level Functions

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

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.

132
Chapter 16 - Low Level Functions

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

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

133
Chapter 16 - Low Level Functions

contains 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_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

134
Chapter 16 - Low Level Functions

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

%%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
%%SOI
%%EOI

Table 16.9: Extracted Text Variables

135
Chapter 16 - Low Level Functions

Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster
will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters

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
%%SOI Start of image
%%EOI End of image
%%SOTU Start of Text Unicode/UTF.
%%EOTU End of Text Unicode/UTF.

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.

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

136
Chapter 16 - Low Level Functions

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

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

137
Chapter 16 - Low Level Functions

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

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

138
Chapter 16 - Low Level Functions

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

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

139
Chapter 16 - Low Level Functions

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 FormatsAny value less than zero is a Snowbound error code. See Appendix E, Snowbound
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);

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.

140
Chapter 16 - Low Level Functions

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

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.

141
Chapter 16 - Low Level Functions

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.

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

142
Chapter 16 - Low Level Functions

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.

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.

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

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

144
Chapter 16 - Low Level Functions

Variable Description
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_tiff_tag_page_mem()
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.

Syntax

int SNBDAPI IMGLOW_get_tiff_tag_page_mem(char* imageptr, int tag,


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

Remark

Table 16.25: IMGLOW_get_tiff_tag_page_mem Function Variables

Variable Description
imageptr Pointer to image data in memory containing tiff tag
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.

145
Chapter 16 - Low Level Functions

Syntax

int SNBDAPI IMGLOW_get_tile_info(char *bm_name, SNBDTILESTRUCT


*stile);

Remark

Table 16.26: 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
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

146
Chapter 16 - Low Level Functions

Syntax

int SNBDAPI IMGLOW_get_transp_color(int imghandle);

Remark

Table 16.27: 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.

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

147
Chapter 16 - Low Level Functions

Remark

Table 16.28: 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.

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

148
Chapter 16 - Low Level Functions

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.30: 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.
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.31: get_dib_data Callback Routine Variables

Variable Description
private_data Pointer for use by the application which is the same

149
Chapter 16 - Low Level Functions

Variable Description
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:

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

150
Chapter 16 - Low Level Functions

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

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

151
Chapter 16 - Low Level Functions

l Tags

l Zoom

Syntax

int SNBDAPI IMGLOW_set_alias(int alias_type);

Remark

Table 16.33: 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.

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

152
Chapter 16 - Low Level 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_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.35: 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

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

153
Chapter 16 - Low Level Functions

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.37: IMGLOW_set_dispfunc Function Variable

Variable Description
DISPLAYCB Pointer to a C callback routine

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.

154
Chapter 16 - Low Level Functions

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.38: 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.
1 = black and white documents
bits_pix
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.

This function can be set to auto-grow page width to accommodate files with many columns. To
set auto-grow in width to true set the page width parameter to -1 as shown in the following
example:
IMGLOW_set_document_page_size(-1.0, 11, XLS)

155
Chapter 16 - Low Level Functions

Setting the width to -1 for auto-grow defaults the page width to US Letter (8.5"). The page width
will auto-grow to fit all columns and image data in the file.

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

Syntax

int SNBDAPI IMGLOW_set_image_orientation(int orient);

Remark

Table 16.40: 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

156
Chapter 16 - Low Level Functions

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

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.42: W_set_jpeg2000_comp_ratio Function Variable

157
Chapter 16 - Low Level Functions

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

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

158
Chapter 16 - Low Level Functions

Remark

Table 16.44: 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);

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

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.

159
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 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.45: 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.

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

160
Chapter 16 - Low Level Functions

Remark

Table 16.46: 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.47: 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.

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

161
Chapter 16 - Low Level Functions

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.48: 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 fol-
lowing example:

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.49: IMGLOW_set_tiff_tag Function Variables

162
Chapter 16 - Low Level Functions

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

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.

163
Chapter 16 - Low Level Functions

Syntax

int SNBDAPI IMGLOW_write_tiff_stream(LPBITMAPINFOHEADER lpbi, char*


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

Remark

Table 16.51: 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
gray scale */
#define SNBD_TIFF_COMP_G4_FO 4000 /* modified huffman group
4 with
fillorder of 1 */

164
Chapter 17 - DWG and DXF Functions

Chapter 17 - DWG and DXF Functions


This chapter describes the RasterMaster DLL DWG and DXF functions.

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.
Sets the bits per pixel. Only 1-bit and 24-bit are supported.
bits_pix
The default value is 24.

165
Chapter 17 - DWG and DXF Functions

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.

166
Chapter 18 - HTML Functions

Chapter 18 - HTML Functions


This chapter describes the RasterMaster DLL HTML functions.

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,
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.
ratio (i.e. US LETTER portrait-mode).

Note: The ratio value is not set if the isRatioEnabled

167
Chapter 18 - HTML Functions

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

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

168
Chapter 18 - HTML Functions

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

169
Chapter 18 - HTML Functions

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

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.

170
Chapter 18 - HTML Functions

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.

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
isEnabled Set the value to 0 to disable. Set the value to 1 to enable.

171
Chapter 18 - HTML Functions

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

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
isEnabled Set the value to 0 to disable. Set the value to 1 to enable.

172
Chapter 18 - HTML Functions

Variable Description
The default value is 1.

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
May be set to one of the following values as defined in imglib.h:

Please see Table 18-12 for byte order marks by encoding.

utf_bom NOT_UNICODE 0

UTF_8 1

UTF_16BE 2

173
Chapter 18 - HTML Functions

Variable Description

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 the 43 47 118, and one of
+/v, and one of the fol-
UTF_72 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
?þÿ (? is the ascii "shift
SCSU 0E FE FF3 14 254 255
out" character)
FB EE 28 optionally fol- 251 238 40 optionally fol- ûî( optionally followed by
BOCU_1
lowed by FF4 lowed by 255 ÿ
GB_18030 84 31 95 33 132 49 149 51 □1■3 (□ and ■ are

174
Chapter 18 - HTML Functions

Representation Representaition Representation


Encoding
(hexadecimal) (hexadecimal) (ISO-8859-1)
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.

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

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

177
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.
The length of elements allocated in the location passed-para-
locationLength
meter.
The number of characters the location data actually requires.(0
locationRequiredLength
indicates that there is no license location.)

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

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

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

180
Chapter 20 - DocClean Functions

Chapter 20 - DocClean Functions


This chapter describes the RasterMaster 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.

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

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.

181
Chapter 20 - DocClean Functions

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.

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

182
Chapter 20 - DocClean Functions

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

Variable Description
hdib Standard RasterMaster image handle.
24-bpp: Red component of the detection color or the full back-
ground color for 1, 4 and 8-bit per pixel images. May have the
red value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detec-
tion color. May have the value of [0-1], [0-127], and [0-255],
respectively.
Green component of the detection color. Ignored for non-24-
green
bpp images. May have the value of [0-255].

183
Chapter 20 - DocClean Functions

Variable Description
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
colourTolerance
value.
Mismatch tolerance percentage. If negative, it will default to
75. An example of a valid value is 50.26. If the percentage of
mismatchTolerance
background pixels on the page is less than the mismatch tol-
erance, 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
autodetect
system to ignore the passed color.
24-bpp: Red component of the detection color. May have the
value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detection
red
color. May have the value of [0-1], [0-127], and [0-255], respect-
ively.
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].
tolerance Per color-channel pixel-value match tolerance linear distance

184
Chapter 20 - DocClean Functions

Variable Description
value. Use this value in comparing background pixels. This num-
ber 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
isLowQuality
maximum, 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
isLowMemory
maximum. The tolerance level is not taken into consideration.
This setting 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.)
Maximum diameter of a blob. (This value should be kept very
maxSize
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.

185
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
autoDetectFillColour
to ignore the passed fill color.
24-bpp: Red component of the detection color or the full back-
ground color for 1, 4 and 8-bit per pixel images. May have the
red value of [0-255]. 1-bpp/4-bpp/8-bpp: Index value of the detec-
tion color. May have the value of [0-1], [0-127], and [0-255],
respectively.
Green component of the detection color for 24-bit images.
green
Ignored for non-24-bpp images. May have the value of [0-255].
Blue component of the detection color for 24-bit images.
blue
Ignored for non-24-bpp images.May have the value of [0-255].
Auto-detect the hole punches (0: no; 1: yes). 1 will force the
autoFindHoles
system 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
holes are ignored. Similarly, holes which span several ROIs but not
a single ROI will be ignored. May be NULL when
autoFindHoles is 1.
holeNum Number of elements in the holes array. May be 0 when

186
Chapter 20 - DocClean Functions

Variable Description
autoFindHoles is 1.
Array of regions-of-interest (ROI). ROIs are areas where holes
may span. If ROIs is NULL and the holes are not auto-
ROIs matically found, 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 determined algorithmically.
Number of elements in the ROIs array. May be 0 when ROIs
ROIsNum
is NULL.
Minimum diameter in pixels of any holes. This is only used
minHoleDiameter
when holes are automatically found.
Maximum diameter in pixels of any holes. This is only used
maxHoleDiameter
when 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.

187
Chapter 21 - Image Processing Functions

Chapter 21 - Image Processing Functions


This chapter describes the RasterMaster DLL image-processing functions.

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

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.

188
Chapter 21 - Image Processing Functions

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.

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.

189
Chapter 21 - Image Processing Functions

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

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

190
Chapter 21 - Image Processing Functions

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.

Example 21.3: IMG_despeckel_bitmap

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


ality));

191
Chapter 21 - Image Processing Functions

IMG_display_fit_to_height()
This function displays the full height of the image vertically scaling it to fit. It crops the image
horizontally for aspect ratio correction and enables the scroll bars.

You can find the samples for using this function in the following directory C:\Program
Files\Snowbound Software\RasterMaster® DLL Evaluation\DLL\Samples.
This function is used in the Fit sample.

Syntax

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

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.

192
Chapter 21 - Image Processing 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 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.

Syntax

int SNBDAPI IMG_flip_bitmapx(int imghandle);

Remark

Table 21.9: IMG_flip_bitmapx Function Variable

193
Chapter 21 - Image Processing Functions

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

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)

194
Chapter 21 - Image Processing Functions

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

Example 21.8: IMG_get_deskew_angle

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

195
Chapter 21 - Image Processing Functions

IMG_get_profile()
This function gets an input profile from an image file. ICC profiles may be embedded in the
image. In order to make an exact match, color profiles are created so that the identical color val-
ues can be printed or displayed.

Supported file formats include: TIFF, JPEG, PICT, PDF, GIF and PNG. These formats can con-
tain an embedded color profile.

Syntax

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

Variable Description
hdib Snowbound image handle

196
Chapter 21 - Image Processing Functions

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
Standard image handle obtained from a
imghandle
decompress function such as IMG_decom-

197
Chapter 21 - Image Processing Functions

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

198
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

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

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

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

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

202
Chapter 21 - Image Processing Functions

Variable Description
angle Rotation in hundredths of degrees

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

203
Chapter 21 - Image Processing Functions

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.

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.

204
Chapter 21 - Image Processing Functions

Syntax

int SNBDAPI IMG_sharpen_bitmap(int imghandle, int sharpness);

Remark

Table 21.24: IMG_sharpen_bitmap Function Variables

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

205
Chapter 21 - Image Processing Functions

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

206
Chapter 21 - Image Processing Functions

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

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

207
Chapter 21 - Image Processing Functions

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

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

208
Chapter 21 - Image Processing Functions

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.

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

209
Chapter 21 - Image Processing Functions

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.

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.

210
Chapter 21 - Image Processing Functions

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

211
Chapter 21 - Image Processing Functions

DITHER_NONE 0 /* Allows for Windows to do the color reduc-


tion.
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 reduc-
tion. */

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.

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.

212
Chapter 21 - Image Processing Functions

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)

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.

213
Chapter 21 - Image Processing Functions

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

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.

214
Chapter 22 - Bit Depth Conversion Functions

Chapter 22 - Bit Depth Conversion Func-


tions
This chapter describes the RasterMaster DLL bit depth conversion functions.

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

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

215
Chapter 22 - Bit Depth Conversion Functions

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

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

216
Chapter 22 - Bit Depth Conversion Functions

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

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

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

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

218
Chapter 22 - Bit Depth Conversion Functions

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.

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

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

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

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.

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

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

221
Chapter 22 - Bit Depth Conversion Functions

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

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
imghandle Standard image handle obtained from a

222
Chapter 22 - Bit Depth Conversion Functions

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

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

223
Chapter 22 - Bit Depth Conversion Functions

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

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.

224
Chapter 22 - Bit Depth Conversion Functions

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.

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

226
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
/Xpos=1300 /Ypos=240

227
Chapter 23 - Document Conversion and Text Extraction

%%SOT
Devadas
%%EOT
/Xpos=1253 /Ypos=240
%%SOT
S.
%%EOT
%%EOF
%%SOI
%%EOI

Table 23.2: Extracted Text Variables

Extracted text uses %%SOT for regular ASCII text. If Unicode text is detected, RasterMaster
will use %%SOTU. The text inside %%SOTU and %%EOTU may include null characters

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
%%SOI Start of image
%%EOI End of image
%%SOTU Start of Text Unicode/UTF.
%%EOTU End of Text Unicode/UTF.

228
Chapter 23 - Document Conversion and Text Extraction

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

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

229
Chapter 23 - Document Conversion and Text Extraction

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

230
Chapter 23 - Document Conversion and Text Extraction

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

231
Chapter 23 - Document Conversion and Text Extraction

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

232
Chapter 23 - Document Conversion and Text Extraction

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.

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.

233
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

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

235
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 Postnet
L DEMO,12,0,0

C0BPOSBX,CCodePostnet,10,0,0
The integer length of font mapping
maplength
data

236
Chapter 24 - AFP Font Mapping Functions

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.

IMGLOW_set_pdfa_font_path()
This method defines where to look for the base fonts. If this function is not called, the fonts are
expected to be in c:\fonts. The path is limited to one directory.

Syntax

int IMGLOW_set_pdfa_font_path(String pdfaFontPath);

Remark

Table 24.4: IMGLOW_set_pdfa_font_path(String pdfaFontPath) Method Variables

Variable Description
A pointer to where to look for the base fonts. If this func-
pdfaFontPath
tion is not called, the fonts are expected to be in c:\fonts.

Returns

Returns the pointer to the base fonts. A value of 0 indicates success. Any value less than zero
is a Snowbound error code. See Appendix D, Snowbound Error Codes for a list of error codes.

IMGLOW_set_pdfa_font_map()
This method programmatically sets font mapping for PDF/A. Snowbound's PDF/A 1b-com-
pliant output files use the basic fonts included with the Snowbound product. This may result in
the PDF output document looking slightly different than the original. You may have additional
fonts that you are licensed to embed in documents. You can tell RasterMaster to use these addi-
tional fonts by calling IMGLOW_set_pdfa_fontpath to specify the directory where the fonts are
located.

You can also tell RasterMaster to substitute one font for another using IMGLOW_set_pdfa_
font_map. For example, if your documents use Arial but you own the Helvetica font and want to
use that instead, you could map Arial to Helvetica using this method.

IMGLOW_set_pdfa_font_map allows the client to provide a stream of bytes defining the map-
ping from one font/style to another. The remapData stream should contain multiple entries sep-
arated by a newline character. The len parameter indicates how many bytes are in the stream.

The base 14 fonts are: Times (New Roman), Helvetica, Courier, Symbol and Zapf Dingbats.

Syntax

int IMGLOW_set_pdfa_font_map(byte [] buff, int len);

237
Chapter 24 - AFP Font Mapping Functions

Remarks

Table 24.5: IMGLOW_set_pdfa_font_map Method Variables

Variable Description
The buff array contains five element indicators to handle
font mappings. Each record contains an alias, the
PostScript font name for that font, the font file name as it
exists in the font directory, an integer (0 or 1) indicating
bold, and an integer (0 or 1) indicating italic.
buff
Each set maps an alias and the bold and italic attributes to
a specific font and the font file representing that font.

The mapping provided by buff isn’t actually used until a


PDF/A file is generated via the IMG_save_document
call.
len Indicates how many bytes are in the buff array.

Returns

Returns the status of the font mapping data. A value of 0 indicates success. Any value less
than zero is a Snowbound error code. See Appendix D, Snowbound Error Codes for a list of
error codes.

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

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.

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.

239
Chapter 25 - Standard UNIX and XWindows Specific Functions

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

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)

240
Chapter 25 - Standard UNIX and XWindows Specific Functions

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.

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

241
Chapter 25 - Standard UNIX and XWindows Specific Functions

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

242
Chapter 25 - Standard UNIX and XWindows Specific Functions

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

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

243
Chapter 25 - Standard UNIX and XWindows Specific Functions

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.

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

244
Chapter 25 - Standard UNIX and XWindows Specific Functions

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

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.

245
Chapter 25 - Standard UNIX and XWindows Specific Functions

Variable Description
(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.

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

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
Additional flags to use when creating
flags
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.

247
Chapter 26 - Macintosh High Level and Image Management Functions

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

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.

248
Chapter 26 - Macintosh High Level and Image Management Functions

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

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:

249
Chapter 26 - Macintosh High Level and Image Management Functions

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.

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

250
Chapter 26 - Macintosh High Level and Image Management Functions

horizScroll);

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

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

251
Chapter 26 - Macintosh High Level and Image Management Functions

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.

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

252
Chapter 26 - Macintosh High Level and Image Management Functions

Variable Description
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
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

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

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

Example 27.1:RasterMaster Plus Options

For a raster of width 100.

255
Chapter 27 - Format for Decompressed Images

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

256
Chapter 27 - Format for Decompressed Images

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.

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

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.

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;

258
Chapter 28 - Annotation and Redlining Toolkit

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

259
Chapter 28 - Annotation and Redlining Toolkit

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

SANN_activate_object()

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

260
Chapter 28 - Annotation and Redlining Toolkit

Remark

Table 28.3: SANN_activate_objectFunction 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.

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

261
Chapter 28 - Annotation and Redlining Toolkit

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.

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

262
Chapter 28 - Annotation and Redlining Toolkit

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.

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

263
Chapter 28 - Annotation and Redlining Toolkit

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

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

264
Chapter 28 - Annotation and Redlining Toolkit

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
xz X size of window
yz Y size of window

265
Chapter 28 - Annotation and Redlining Toolkit

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

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

267
Chapter 28 - Annotation and Redlining Toolkit

Syntax

ANN_GRAPHIC_STRUCT SANN_get_object_info(int hann, int graphic_num);

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

268
Chapter 28 - Annotation and Redlining Toolkit

Variable Description
hann Standard annotation handle
Windows currently in use by image and
hWnd
annotations
graphic_num Graphic to highlight

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.

269
Chapter 28 - Annotation and Redlining Toolkit

SANN_merge_ann()
This function reads in the annotation from the file name.

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

270
Chapter 28 - Annotation and Redlining Toolkit

Variable Description
Window handling function wParam para-
wParam
meter
lParam Window handling function lParam parameter
hann Standard annotation handle
graphic_id Current graphic id to add
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

271
Chapter 28 - Annotation and Redlining Toolkit

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

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.

272
Chapter 28 - Annotation and Redlining Toolkit

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

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

273
Chapter 28 - Annotation and Redlining Toolkit

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.

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

274
Chapter 28 - Annotation and Redlining Toolkit

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

275
Chapter 28 - Annotation and Redlining Toolkit

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

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.

276
Chapter 28 - Annotation and Redlining Toolkit

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

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

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

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

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

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

281
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

B = Base

D = In Development

O = Optional format/Additional charges may apply. Note: Optional formats are not avail-
able for UNIX.

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
IBM image compression for
ABIC scanned checks. Note:
Not yet supported with 46 1 1 - O - No
(reading) RasterMaster .NET x64
or RasterMaster DLL x64.
Advanced Function Presentation™.
AFP IBM format which uses CCITT G3, G4,
74 1, 24 1, 24 .afp O O Yes
(MO:DCA) and IBM MMR formats. 1-bit only.
This is a multi-page file format
Snowbound reads in ASCII text
files and converts them to a bitmap.
To enable auto-detection of the
ASCII text format, call the
ASCII 38 1 No .txt B - Yes
IMGLOW_set_auto_detect() function
with the file type number set
to 38 for the ASCII file format
before you get pages or decompress.
Originated by Microsoft,
BMP_
BMP supports 1, 4, 8, and 24-bit 12 4, 8 4, 8 .bmp B - No
COMPRESSED
images.
Originated by Microsoft,
BMP_ 1, 4, 8, 16, 1, 4, 8, 16,
BMP supports 1, 4, 8, and 24-bit 1 .bmp B B No
UNCOMPRESSED 24 24
images.
BROOK_TROUT Brooktrout FAX format. 27 1 1 .brk B B No
CALS Government specified format. 18 1 1 .cal B B No
Group 3 compression
CCITT_G3 33 1 1 .tif B B No
for bitonal (1-bit) image data.
Group 3 compression
CCITT_G3_FO 53 1 1 .tif B B No
for bitonal (1-bit) image data.
Group 4 compression
CCITT_G4 34 1 1 .tif B B No
for bitonal (1-bit) image data.
Group 4 compression
CCITT_G4_FO 52 1 1 .tif B B No
for bitonal (1-bit) image data.
Compact Font Format
is a lossless compaction of the
Type 1 format using
Type 2 charstrings. It is designed
to use less storage space
than Type 1 fonts by using
CFF operators with multiple 83 1 , 8, 24 1 , 8, 24 .cif O - No
arguments, various
pre-defined default values,
more efficient
allotment of encoding
values and shared subroutines
within a FontSet (family of fonts).
CIFF Camera Image File Format is 81 1 , 8, 24 1 , 8, 24 .cif O - No

282
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
a raw image format designed by Canon.
Check Image Management System.
Developed by
CIMS Carreker. Same as ABIC. Note: Not
80 1 No - O - No
(ABIC) yet
supported with RasterMaster .NET x64
or RasterMaster DLL x64.
1, 4, 8, 24,
CLIP Microsoft Windows clipboard format. 27 1, 4, 8, 24 .cip B B No
32
COD Liberty IMS black and white format. 72 1 No .cod B B No
Comma separated value list,
CSV 77 1,24 No .csv O - No
a text spreadsheet.
Cut images are only 8 bits per pixel
and the palette is
CUT 31 8 No .cut B - No
stored in a separate file.
Originated by Media Cybernetics.
The DCS format is a
DCS standard Quark Express Format. 62 32 32 .dcs B B No
Each plane is stored as an EPS record.
Intel created this format as
a multi-page .PCX format.
DCX Each page is a .PCX file 11 1, 4, 8, 24 1, 4, 8, 24 .dcx B B No
in whole which can be 1, 4, 8, and 24-
bit.
Standard Windows Device Independent
Bitmap. 1, 4, 8, 16,
DIB 48 1, 4, 8, 24 .dib B B No
Supports 1, 4, 8 and 24-bits. 24, 32
This is a multi-page file format.
Medical image format
DICOM supporting 1, 12, 16, and 24 pixel 55 8, 16, 24 No .dcm B - No
images.
Microsoft Word format.
Supports Microsoft Word 77, version 8
or later.
Supports 1-bit images.
Cannot decompress (view)
document while open in MS Word.
The following features have not
yet been implemented:
right-to-left text flow, underlined
URLs, section and paragraph borders
DOC and shading, 86 1, 8, 24, 32 No .doc O - Yes
text 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 format.
The .docx format is part of a family
of open office
XML-based formats
developed by Microsoft
. It is the default document format
DOCX for saving applications in 73 1, 8, 24, 32 No .docx O - Yes
Microsoft Word starting with Office
2007.
It is based on XML rather
than Microsoft’s .doc format.
Reading support only.

283
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
This is a multi-page file format.
Autodesk® AutoCAD® format.
Used for computer aided design (CAD)
data and metadata.
DWG 70 0 24 .dwg O - No
The DWG format can be read
in the VirtualViewer
.NET Content Server.
Autodesk® AutoCAD® format.
Used for computer aided design
(CAD) data and metadata.
See the following, for the ful
l specification
: http://usa.autodesk.-
DXF com/adsk/servlet/ 71 0 24 .dxf O - No

item?siteID=123112&id=8446678
The DWG format can be
read in the VirtualViewer
.NET Content Server.
E-mail message created with MS
EMAIL 87 1 .msg O - No
Outlook.
Encapsulated Postscript originated
by Adobe. Postscript
is an interpreted language.
Snowbound does not suppor
EPS 1, 8, 24,
t full Postscript but will extract an 14 1, 4, 8, 24 .eps B B No
(preview) 32
embedded .
TIF file in the image.
Sometimes called
a bitmap representation file.
EPS Compressed bitmap format.
It is an Adobe encapsulated 1, 8, 24,
EPS_BITMAP 63 8, 24, 32 .eps B B No
Postscript file with either 32
G4 or JPEG data embedded.
EPS Compressed bitmap format.
It is an Adobe encapsulated 1, 8, 24,
EPS_BITMAP_G4 64 No .eps - B No
Postscript file with either 32
G4 or JPEG data embedded.
EPS Compressed bitmap format.
It is an Adobe encapsulated 1, 8, 24,
EPS_BITMAP_LZW 67 No .eps - B No
Postscript file with either 32
G4 or JPEG data embedded.
Image format developed
FileNet by FileNET Corporation for viewing doc- 78 1 1 - B - No
uments.
24-bit tiled JPEG format
FLASHPIX that includes multiple resolution 54 8, 24 No .fpx B - No
images.
Created by CompuServe
for compressing 2, 3, 4, 5, 6, 7, and 8- 2, 3, 4, 5,
GIF 4 4, 8 .gif B B No
bit palette images. Uses the LZW 6, 7, 8
algorithm.
Same as GIF except stores 1, 2, 3, 4,
GIF_INTERLACED 44 4, 8 .gif B B No
the raster data in an interlaced order. 5, 6, 7, 8
Originated by Brightbill Roberts
for ShowPartner DOS applications.
GX2 22 4, 8 No .gx2 B - No
Supports 4 and 8-bit images.
Simple run length encoding technique.
Hyperlink Text Markup Language
HTML (HTML) 82 0 24 .htm, .html - O* Yes
is a tag-based language

284
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
used to create documents for the
Web. HTML forms are often
used to capture information from web
sites.
Full HTML, Javascript and CSS sup-
port.
Microsoft icon format.
Contains a standard
ICONTYPE 25 1, 4 No .ico B - No
device independent bitmap.
Supports 1 and 4 bits uncompressed.
Used on the
Commodore Amiga computers
IFF_ILBM for native bitmap format. 26 1, 4, 8, 24 1, 4, 8, 24 .iff B B No
Uses a run length format for
1, 4, and 8-bit palette images.
Originated by Digital Research
IMG 28 1 No .img B - No
for storing 1-bit images.
IMNET IMNET G4 compressed format. 42 1 No - B - No
Image Object Content Architecture.
IBM format which uses
IOCA CCITT G3, G4, and IBM MMR
24 1, 24 1 .ico O O No
(MO:DCA) * formats.
1-bit only. This is a multi-page file
format.
Joint bi-level Image Experts Group.
This is a highly compressed |
1 (with plu-
JBIG format which is stored in a 71 1 .jbg B - No
gin)
TIFF header. It supports
1 or 8-bit gray scale images.
JBIG2 is a highly-compressed
black and white image format
that uses symbol recognition
and substitution for very
dramatic compression results.
1 (with plu-
JBIG2 Snowbound's viewers and 77 1 .jbg B B No
gin)
conversion programs can
be used to directly view JBIG2
documents or
convert those documents
to a variety of output formats.
US Military CCITT G4 tiled image
format for storing
JEDMICS 56 1 1 .jed B B No
Government documents and drawings.
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
JPEG 13 8, 24, 32 8, 24, 32 .jpg B B No
. This is by far the best compression
available for these types of images
supported in the current Snowbound lib-
rary.
JPEG 2000 specification.
This is similar to JPEG but produces
much better compression
JPEG2000 with better quality. It is 70 8, 24 8, 24 .jpg2 O O No
supported as a separate plugin.
An option exists to set the
compression level for saving.
KOFAX Kofax Format. 23 1 No - B - No
Compression for documents
LASER_DATA 17 1 No - B - No
originated by

285
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
LaserData Corp. 1-bit images only.
Presents data for each
LINE_DATA 75 1 1 - B - No
variable on a single line.
Original Apple bitmap file format.
MACPAINT All MacPaint 21 1 No - - - No
images are 720 x 576 pixels 1 bit.
MAG Mag Format. 61 1 No .mag B - No
Mixed Object: Document
Content Architecture
. IBM format which uses
MO:DCA 47 1, 24 1 .mca O O Yes
CCITT G3, G4, and IBM MMR formats.
1-bit only.
This is a multi-page file format.
Microsoft Paint program bitmap
file format. Supports 1-bit images
MSP 30 1 No .msp B - No
. Uses a type of RLE compression
found also in compressed .BMP files.
A simple header with CCITT group 4
NCR 65 1 No .ncr B - No
data.
Open Document Format is
an XML-based file format for
representing electronic documents
ODF such as 78 No No .odf O - No
spreadsheets, charts,
presentations and
word processing documents.
Open Document Format
ODP 101 No No .odp O - Yes
for presentations.
Open Document Format
ODS 77 1, 24 No .ods O - Yes
for spreadsheets.
Open Document Format
ODT 76 1, 24 No .odt O - Yes
for word processing (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
OOXML developed by Microsoft for 74 1, 8, 24 No - O - Yes
representing spreadsheets,
charts, presentations
and word processing documents
that is intended for use with the 2007
and later versions
of the Microsoft Office suite.
Hewlett Packard printer
PCL_1 file format. Support for
color and grayscale output. 57 1, 24 1 .pcl O B Yes
(with plugin) Supported as a separate plugin.
This is a multi-page file format.
Hewlett Packard printer
file format. Support for color
PCL_1
and grayscale output. 57 No 1 .pcl O B Yes
(without plugin)
Supported as a separate plugin.
This is a multi-page file format.
Hewlett Packard
printer file format.
PCL_5 Support for 76 No 1 .pcl O B Yes
color and grayscale output.
This is a multi-page file format.
Zsoft bitmap file format.
PCX 2 1, 4, 8, 24 1, 4, 8, 24 .pcx B B No
Similar to pack bits compression.

286
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
Supports 1, 4, 8, and 24-bit images.
Portable Document
Format. File format developed by
Adobe to capture formatting
information from a
variety of desktop
publishing 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
PDF and conforms to 1, 2, 4, 8,
57 1, 24 .pdf O B Yes
(with plugin) PDF v1.4. 16, 24, 32
Does not currently support JPEG2000
in PDF for Java.
Supports some types
of Adobe specified
PDF annotations
, however does not support XFA annota-
tions.
Does not support corrupt
PDF documents.
Snowbound Software requires
that the fonts needed
be available 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
publishing 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
PDF and conforms to
57 No 1, 24 .pdf O B Yes
(without plugin) PDF v1.4.
Does not currently support JPEG2000
in PDF for Java.
Supports some types
of Adobe specified
PDF annotations
, however does not support XFA annota-
tions.
Does not support corrupt
PDF documents.
Snowbound Software requires
that the fonts needed
be available on the system.
This is a multi-page file format.
Portable Document
Format. File format developed by
Adobe to capture formatting
PDF_15 information from a 77 No 1, 24 .pdf O B Yes
variety of desktop

287
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
send formatted documents
and have them appear
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 specified
PDF annotations
, however does not support XFA annota-
tions.
Does not support corrupt
PDF documents.
Snowbound Software requires
that the fonts needed
be available 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.
Portable Document
Format. File format developed by
Adobe to capture formatting
information from a
variety of desktop
publishing 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
and conforms to
PDF v1.4.
Does not currently support JPEG2000
PDF_16 in PDF for Java. 72 No 1, 24 .pdf O B Yes
Supports some types
of Adobe specified
PDF annotations
, however does not support XFA annota-
tions.
Does not support corrupt
PDF documents.
Snowbound Software requires
that the fonts needed
be available 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.
Portable Document
Format. File format developed by
PDF_LZW 88 No 1, 24 .pdf O B Yes

288
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
variety of desktop
publishing 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
and conforms to
PDF v1.4.
Does not currently support JPEG2000
in PDF for Java.
Supports some types
of Adobe specified
PDF annotations
, however does not support XFA annota-
tions.
Does not support corrupt
PDF documents.
Snowbound Software requires
that the fonts needed
be available on the system.
This is a multi-page file format.
Kodak photo CD format.
Supports only 24-bit images.
This format contains at leas
t 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 172 x 128
Page 3 1536 x 1024
PHOTOCD 37 24 No .pcd B - No
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, 16, 24, and 32-bit
images.
1, 4, 8, 24, 1, 8, 24,
PHOTOSHOP Can be compressed or 41 .psd B B No
32 32
uncompressed. Images
may also be stored as CMYK data or
RGB.
Apple Macintosh
bitmap file format
. These images may contain
vector information
such as lines and circles. 1, 2, 4, 8,
PICT 15 1, 4, 8, 24 .pct B B No
Only the bitmap 16, 24, 32
portion of data is decompressed.
Uses pack bits compression
. Supports 1, 2, 3, 4, 8,
16, 24, and 32-bit images.

289
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
Originated by CompuServe
to replace the .GIF file format.
Uses the Huffman
PNG encoding variant 1, 4, 8, 16, 1, 4, 8, 16,
43 .png B B No
(optional) . Supports 1, 4, 8, 15, 16, 24, 24, 32 24, 32
and 32-bit images.
Also supports
interlaced and transparency.
Microsoft PowerPoint
Binary File Format which is the
binary file format used
by Microsoft PowerPoint 77,
PPT Microsoft PowerPoint 2000, 85 1, 8, 24, 32 No .ppt O - Yes
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 documen
t format for saving applications
PPTX in Microsoft PowerPoint 100 1, 8, 24, 32 No .pptx O - Yes
starting with Office 2007
. It is based on XML rather
than Microsoft's .ppt format.
Reading support only.
This is a multi-page file format
. Supported on Java 7.
Sun raster format.
RAST Supports 1, 8, 24, and 32-bits. 37 1, 8, 24 1, 8, 24 .ras B B No
Run length encoded format.
The Rich Text Format
is a method of encoding
RTF 87 1, 8, 24, 32 No .rft O - Yes
formatted text and graphics
for easy transfer between applications.
The SCITEX format is a proprietary
format
originated from SCITEX Corporation.
SCITEX 60 24, 32 24, 32 .sct B B No
Gray scale color and CMYK color
images.
Usually compressed.
Searchable PDF, also known
SEARCHABLE_ as "vector PDF"
is a regular PDF file that contains 57 No No .pdf O B Yes
PDF searchable
text content vs rasterized text.
The SCITEX format is a proprietary
TARGA format 32 16 24, 32 .tga B B No
originated from SCITEX Corporation.
The SCITEX format is a proprietary
TARGA16 format 32 16 24, 32 .tga B B No
originated from SCITEX Corporation.
Tagged image file format.
Created by an independent
group and was supported by Aldus.
.TIF files can be any number
of bits per pixel,
TIFF_2D 17 1 No .tif B - No
planes and several
compression algorithms.
The byte order may be
Intel or Motorola format.

290
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
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 G32D 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.
TIFF_ABIC Very popular for check imaging 46 4, 8 No .tif O - No
. BW is used for
1-bit bilevel 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.
TIFF_ABIC_BW Very popular for 47 1 No .tif O - No
check imaging. BW is used f
or 1-bit bilevel and TIFF_ABIC
is for 4-bit gray scale images.
This is a multi-page file format.
ANSI baseline Group 3
or Group 4 compression
TIFF_G3_FAX 8 1 1 .tif B B No
embedded in a TIFF.
This is a multi-page file format.
ANSI baseline Group 3
or Group 4 compression
TIFF_G4_FAX 10 1 1 .tif B B No
embedded in a TIFF.
This is a multi-page file format.
ANSI baseline Group 3
or Group 4 compression
TIFF_G4_FAX_FO 51 1 1 .tif B B No
embedded in a TIFF.
This is a multi-page file format.
ANSI baseline Group 3
TIFF_G4_ or Group 4 compression
67 No 1 .tif B B No
FAX_STRIP embedded in a TIFF.
This is a multi-page file format.
TIFF file compressed
using the Huffman
TIFF_HUFFMAN 7 1 1 .tif B B No
compression algorithm.
This is a multi-page file format.
Standard ANSI baseline
JBIG compression
TIFF_JBIG 66 1 1 .tif B B No
embedded in a TIFF.
This is a multi-page file format.
TIFF_JPEG
If you have Standard ansi baseline
issues viewing, JBIG compression
40 8, 24 8, 24, 32 .tif B B No
please see embedded in a TIFF.
Appendix F, This is a multi-page file format.
Troubleshooting.
Black and white gray scale format.
TIFF_JPEG7 73 1, 8 1, 8 .tif B B No
This is a multi-page file format.
TIFF file compressed using the
LZW compression algorithm. 1, 4, 8, 24, 1, 4, 8, 16,
TIFF_LZW 7 .tif B B No
The LZW algorithm includes the 32 24, 32

291
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
look-up table of codes as part of the
compressed file.
This is a multi-page file format.
Simple run length encoding algorithm. 1, 4, 8, 16,
TIFF_PACK 16 1, 8 .tif B B No
This is a multi-page file format. 24, 32
TIFF Uncompressed raw binary data 1, 2, 4, 8, 1, 4, 8, 16,
0 .tif B B No
UNCOMPRESSED . This is a multi-page file format. 16, 24, 32 24, 32
UTF-8 is a text format.It is a variable
width
UTF-8 encoding for the Unicode character 38 1 No .txt B - No
set.It may start with the
Byte Order Mark of 0xFF FE
UTF-16 is a text format.It is a variable
width encoding for the Unicode
UTF-16 87 1, 8, 24, 32 No .txt B - No
character set.It may start with the
Byte Order Mark of 0xFE FF.
Windows file format
WBMP 68 1 1 .wbmp B B No
for wireless devices.
A simple header with
WINFAX 58 1 No - B - No
CCITT group 3 compression.
Microsoft Windows Metafile format
. These may contain vector information
such as lines and circles.
Only the bitmap data is extracted.
This is in the form of a standard win- 1, 4, 8, 16,
WMF 6 1, 4, 8, 24 .wmf B B No
dows 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 to the WMF file
format in that it may contain
WPG 5 1, 4, 8, 24 1, 4, 8 .wpg B B No
vector information.
Supports 1, 4, 8, and 24-bit images.
Only the bitmap data is extracted.
Xwindows file format which encodes
XBM each pixel as an ASCII byte 20 1 1 .xbm B B No
. Only supports 8-bits per pixel.
Xerox_EPS Encapsulated Postscript for Xerox. 45 1 No - B B No
Microsoft Excel Spreadsheet format for
structuring and analyzing data.
This is the binary file format used by
Microsoft Excel 77, Microsoft Excel
XLS 2000, 84 1, 8, 24, 32 No .xls O - Yes
Microsoft Excel 2002, and |
Microsoft Office Excel 2003.
Reading support 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 for saving
XLSX 75 1, 8, 24, 32 No .xlsx O - Yes
applications in Microsoft Excel
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
XPM 35 1, 4, 8 8 .xpm B B No
format stored as ASCII data.

292
Appendix A - Supported File Formats

Common Supports
File Input Output Win Win
File Format Description Type Bit Bit File Text
Number Depth Depth Read Write
Ext. Search
Each pixel is stored
as an ASCII byte.
UNIX XWD Raster format. 1, 8, 24,
XWD 36 1, 4, 8 .xwd B B No
Each pixel is stored as an ASCII byte. 32

* = The .NET 4.0 framework must be installed in order to process HTML documents, even if
you are using a .NET 2.0 build of VirtualViewer or RasterMaster.

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
7 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
17 LASER_DATA
20 XBM
21 MACPAINT
22 GX2
23 KOFAX
24 IOCA
25 ICONTYPE
26 IFF_ILBM
27 CLIP
28 IMG
27 BROOK_TROUT
30 MSP

293
Appendix A - Supported File Formats

File Type Number File Type Name


31 CUT
32 TARGA16
33 CCITT_G3
34 CCITT_G4
35 XPM
36 XWD
82 HTML
37 RAST
38 ASCII
37 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
47 MO:DCA_IOCA
51 TIFF_G4_FAX_FO
52 CCITT_G4_FO
53 CCITT_G3_FO
54 FLASHPIX
55 DICOM
56 JEDMICS
57 PCL_1
58 WINFAX
57 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
67 EPS_BITMAP_LZW
70 JPEG2000
71 JBIG
72 COD
73 TIFF_JPEG7
74 AFP

294
Appendix A - Supported File Formats

File Type Number File Type Name


75 LINE_DATA
76 PCL_5
77 JBIG2
78 FILENET
77 PDF_15
80 CIMS
81 CIFF
82 HTML
83 CFF
84 EXCEL
85 POWER_POINT
86 DOC
87 RTF
88 PDF_LZW
87 MSG
70 DWG
71 DXF
72 PDF_16
73 DOCX
74 OOXML
75 XLSX
76 ODT
77 ODS
78 ODF
100 PPTX
101 ODP

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

296
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 ([email protected]) 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.

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

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

299
Appendix B - Software Installation

5. Accept the default destination folder and click Next to display the Ready to Install dia-
log.

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

301
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
Sample-Documents
Samples

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

302
Appendix B - Software Installation

version 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.Slides.dll Aspose slides 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.
snbdan32.dll Main Snowbound file.
snbdan32.lib Snowbound Extended library.
snbdcm.dll Main Snowbound file.

303
Appendix B - Software Installation

File Description
sndbcm.lib Snowbound library.
SnowboundDllLocations.exe The application file.

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.
Open source software license
^^Open Source Software Components used in Snowbound
agreement bundled with Snow-
products.pdf
bound Software products.
Complete DLL programmers
RMDLLProgrammersGuide.pdf
guide.
RMDLLActiveXDotNetReleaseNotes.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-
Snowbound Corporate Overview.pdf
pany facts, products, and
formats.
Provides an overview of Snow-
Snowbound Software RasterMaster Overview.pdf bound Software’s Raster-
Master products.
Provides an overview of Snow-
Snowbound Software VirtualViewer Overview.pdf bound Software’s VirtualViewer
products.

Sample Directory Files

The samples directory contains four subdirectories that contain the RasterMaster DLL
samples:

The C_Samples are described in Table B-5. For more information about each sample, see
Appendix C,RasterMaster DLL Samples.

Table B.4: RasterMaster DLL Imaging SDK C_Samples Directory

304
Appendix B - Software Installation

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
Snowbound Image Library for
callback 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-

305
Appendix B - Software Installation

Sample Description
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 the
command line to extract text
from a MODCA:PTOCA and/or
Vector_Convert
AFP files. It saves the text in
vector format and writes out to
a searchable PDF
Sample showing how to use
Image Library to:

Decompress an image

Zoom into an area selected by


zoom dragging a rectangle

Scroll through an image

Rotate to screen

See Zoom for more information.

306
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

Page

Print

SaveMem

Save Searchable PDF

Scan

Tags

Transp

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

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

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

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

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

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

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

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.

314
Appendix C - RasterMaster DLL Samples

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.

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.

315
Appendix C - RasterMaster DLL Samples

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.

SaveMem
This sample saves a document image to memory. The memory buffer is automatically sized to
fit the image. The output is written to C:\TEMP\out.tif. You can find the samples in the fol-
lowing directory C:\Program Files\Snowbound Software\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_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_save_mem() takes a buffer passed in with text, graphics, and position information
obtained from IMGLOW_extract_text() to create the document file output.

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.

316
Appendix C - RasterMaster DLL Samples

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.

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.

317
Appendix C - RasterMaster DLL Samples

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.

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

318
Appendix C - RasterMaster DLL Samples

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.

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.

319
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 the IMGLOW_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

320
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 Source of
Name Description
Dec Hex Tag
A general indication of the kind of
data that is contained in this sub-
file. This field is made up of a set of
32 flag bits. Unused bits are expec-
ted to be 0. Bit 0 is the low-order
bit.

Currently defined values for the bit-


map are:
254 00FE NewSubfileType Baseline
0 - Image is reduced of another
TIFF image 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 sub-
255 00FF SubfileType file. Baseline

Currently defined values are:

321
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
A general indication of the kind of
data that is contained in this sub-
file.

Currently defined values are:

1 = full resolution image data -


ImageWidth, ImageLength, and
StripOffsets are required fields.

2 = reduced resolution image data -


ImageWidth, ImageLength, and
StripOffsets are required fields. It
is further assumed that a reduced
resolution image is a reduced ver-
sion of the entire extent of the cor-
responding full resolution data.

3 = single page of a multi-page


image (see the PageNumber tag
description).

Continued use of this field is not


recommended. Writers should
instead use the new and more gen-
eral NewSubfileType field.
The image's width, in pixels (X:ho-
256 0100 ImageWidth rizontal). The number of columns in Baseline
the image.
The image's length (height) in
pixels (Y:vertical). The number of
257 0101 ImageLength Baseline
rows (sometimes described as
"scan lines") in the image.
Number of bits per sample. Note
that this tag allows a different num-
ber of bits per sample for each
sample corresponding to a pixel.
258 0102 BitsPerSample 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,
259 0103 Compression with no unused bits except at the Baseline
end of a row. The bytes are stored

322
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
as an array of bytes, for Bit-
sPerSample <= 8, word if Bit-
sPerSample > 8 and <= 16, and
dword if BitsPerSample > 16 and
<= 32. The byte ordering of data >8
bits must be consistent with that
specified in the TIFF file header
(bytes 0 and 1). Rows are required
to begin on byte boundaries.

2 = CCITT Group 3 1-Dimensional


Modified Huffman run length encod-
ing. See ALGRTHMS.txt Bit-
sPerSample must be 1, since this
type of compression is defined only
for bilevel images (like FAX
images...)

3 = Facsimile-compatible CCITT
Group 3, exactly as specified in
"Standardization of Group 3 fac-
simile apparatus for document
transmission," Recommendation
T.4, Volume VII, Fascicle VII.3,
Terminal Equipment and Protocols
for Telematic Services, The Inter-
national 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 Group3Op-
tions 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,"
Recommendation T.6, Volume VII,

323
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Fascicle VII.3, Terminal Equip-
ment and Protocols for Telematic
Services, The International Tele-
graph and Telephone Consultative
Committee (CCITT), Geneva,
1985, pages 40 through 48. Each
strip must begin on a byte bound-
ary. 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 gray-


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


0 = For bilevel and grayscale
images: 0 is 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
262 0106 PhotometricInterpretation white. If GrayRe- Baseline
sponseCurveexists, it overrides
the PhotometricInterpretation
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

324
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
three samples, 0 represents min-
imum intensity, and 2**Bit-
sPerSample - 1 represents
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 sample plane StripOff-
sets, then the Green plane StripOff-
sets, 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 Pho-
tometricInterpretation 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
compression 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 Trans-
parency Mask must have the same
ImageLength and ImageWidth as
the main image.
1 = a bilevel "line art" scan. Bit-
263 0107 Threshholding sPerSample must be 1. Baseline
2 = a "dithered" scan, usually of

325
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
continuous tone data such as pho-
tographs. BitsPerSample must be
1.

3 = Error Diffused.
The width of the dithering or halfton-
264 0108 CellWidth ing matrix used to create a dithered Baseline
or halftoned bilevel file.
The length of the dithering or
265 0109 CellLength halftoning matrix used to create a Baseline
dithered or halftoned bilevel file.
The logical order of bits within a
266 010A FillOrder Baseline
byte.
The name of the document from
269 010D DocumentName Extended
which this image was scanned.
A string that describes the subject
of the image. For example, a user
270 010E ImageDescription may wish to attach a comment Baseline
such as "1988 company picnic" to
an image.
Manufacturer of the scanner, video
271 010F Make digitizer. Baseline
Mandatory for TIFF/EP.
The model name/number of the
scanner, video digitizer. This tag is
272 0110 Model intended for user information only Baseline
so format is arbitrary.

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 Baseline
pendent of the locations of other
strips. This feature may be useful
for editing applications. 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.
274 0112 Orientation 1 = The 0th row represents the Baseline
visual top of the image, and the 0th
column represents the visual left

326
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
hand side.

2 = The 0th row represents the


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

3 = The 0th row represents the


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

4 = The 0th row represents the


visual bottom of the image, and the
0th column represents 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 read-


ers to perform 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 applic-
ation to be altered permanently in
any way.

The default value is 1.


The number of samples per pixel.
277 0115 SamplesPerPixel Baseline
SamplesPerPixel is 1 for bilevel,

327
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
grayscale, 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 compressed -
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. Recomen-
ded is a strip size of 8K.
For each strip, the number of bytes
in that strip. The existenceof this
279 0117 StripByteCounts field greatly simplifies the chore of Baseline
buffering compressed data, if the
strip size is reasonable.
The minimum component value
280 0118 MinSampleValue Baseline
used.
The maximum component value
281 0119 MaxSampleValue Baseline
used.
The number of pixels per Res-
282 011A XResolution olutionUnit in the X direction, i.e., Baseline
in the ImageWidth direction.
The number of pixels per Res-
283 011B YResolution olutionUnit in the Y direction, i.e., Baseline
in the ImageLength direction.
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.
284 011C PlanarConfiguration Baseline
2 = The samples are stored in sep-
arate "sample planes." The values
in StripOffsets and
StripByteCounts are then arranged
as a 2-dimensional array, with
SamplesPerPixel rows and
StripsPerImage columns. (All of

328
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
the columns for row 0 are stored
first, followed by the columns of
row 1, and so on.) Pho-
tometricInterpretation 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,
PlanarConfiguration is irrelevant,
and should not be included.

The default is 1.
The name of the page from which
285 011D PageName Extended
this image was scanned.
The X offset of the left side of the
286 011E XPosition image, with respect to the left side Extended
of the page, in ResolutionUnits.
The Y offset of the top of the
image, with respect to the top of
the page, in ResolutionUnits. In the
287 011F YPosition Extended
TIFF oordinate scheme, the pos-
itive Y direction is down, so that
YPosition is always positive.
For each string of contiguous
288 0120 FreeOffsets unused bytes in a TIFF file, the Baseline
byte offset of the string.
For each string of contiguous
289 0121 FreeByteCounts unused bytes in a TIFF file, the Baseline
number of bytes in the string.
The precision of the information
contained in the GrayRe-
sponseCurve.

1 = Number represents tenths of a


unit.
290 0122 GrayResponseUnit Baseline
2 = Number represents hundredths
of a unit.

3 = Number represents thou-


sandths of a unit.

4 = Number represents ten-thou-

329
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
sandths of a unit.

5 = Number represents hundred-


thousandths of a unit.

For historical reasons, the default


is 2. However, for greater accur-
acy, 3 is recommended.
For grayscale data, the optical
density of each possible pixel
value.

The purpose of the gray response


291 0123 GrayResponseCurve curve and the gray units is to Baseline
provide more exact photometric
interpretation information for gray
scale image data, in terms of
optical density.
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 Extended
Bit map:

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.
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
Group4Options the file if any bit of this field is set
293 0125 Extended
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

330
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
encoded as if it were a separate
image. In particular, each strip
begins on a byte boundary; and the
coding for the first row of a strip is
encoded independently of the pre-
vious 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
YResolution.

1 = No absolute unit of meas-


urement. Used for images that may
have a non-square aspect ratio, but
no meaningful absolute dimen-
sions. 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 might
296 0128 ResolutionUnit Baseline
be better to use dots per inch or
dots 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 a multiple page (e.g.
facsimile) document. Two word val-
297 0129 PageNumber Extended
ues are specified. The first value is
the page number; the second value
is the total number of pages in the

331
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
document. Note that pages need
not appear in numerical order. The
first page is 0 (zero).
Describes a transfer function for
301 012D TransferFunction Extended
the image in tabular style.
Name and release number of the
305 0131 Software software package that created the Baseline
image. User information only.
Date and time of image creation.
Uses the format "YYYY:MM:DD
HH:MM:SS", with hours on a 24-
306 0132 DateTime hour clock, and one space char- Baseline
acter between the date and the
time. The length of the string,
including the null, is 20 bytes.
Person who created the image.
315 013B Artist Baseline
Copyright notice.
The computer and/or operating sys-
tem in use at the time of image cre-
316 013C HostComputer ation. Baseline

ENIAC.
A mathematical operator that is
applied to the image data before an
encoding scheme is applied.

To be used when Compression=5


317 013D Predictor (LZW). Extended

1 = No prediction scheme used


before coding.

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.
318 013E ColorImageType Extended
2 = Synthetic image, using a
greatly restricted range of colors.

Such images are produced by most


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

332
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
The default value is 1.
A list of colors that are used in this
image. Use of this field is only prac-
tical for images containing a greatly
restricted (usually less than or
equal to 256) range of colors. Col-
orImageType should be 2. See Col-
orImageType.
319 013F ColorList The list is organized as an array of Extended
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 suf-
ficient 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 sequen-
tially. The Red entries come first,
followed by the Green entries, fol-
320 0140 ColorMap lowed by the Blue entries. The Baseline
width of each entry is 16 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 of gray levels within a col-
321 0141 HalftoneHints Extended
orimetrically-specified image that
should retain tonal detail.
The tile width in pixels. This is the
322 0142 TileWidth Extended
number of columns in each tile.
The tile length (height) in pixels.
323 0143 TileLength This is the number of rows in each Extended
tile.
For each tile, the byte offset of that
324 0144 TileOffsets tile, as compressed and stored on Extended
disk.
325 0145 TileByteCounts For each tile, the number of (com- Extended

333
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
pressed) bytes in that tile.
Used in the TIFF-F standard,
denotes the number of 'bad' scan
326 0146 BadFaxLines Extended
lines encountered by the facsimile
device.
Used in the TIFF-F standard, indic-
ates if 'bad' lines encountered dur-
327 0147 CleanFaxData ing reception are stored in the data, Extended
or if 'bad' lines have been replaced
by the receiver.
Used in the TIFF-F standard,
denotes the maximum number of
328 0148 ConsecutiveBadFaxLines Extended
consecutive 'bad' scanlines
received.
330 014A SubIFDs Offset to child IFDs. Extended
The set of inks used in a separated
332 014C InkSet (PhotometricInterpretation=5) Extended
image.
The name of each ink used in a sep-
333 014D InkNames Extended
arated image.
334 014E NumberOfInks The number of inks. Extended
The component values that cor-
336 0150 DotRange Extended
respond to a 0% dot and 100% dot.
A description of the printing envir-
337 0151 TargetPrinter onment for which this separation is Extended
intended.
338 0152 ExtraSamples Description of extra components. Baseline
Specifies how to interpret each
339 0153 SampleFormat Extended
data sample in a pixel.
Specifies the minimum sample
340 0154 SMinSampleValue Extended
value.
Specifies the maximum sample
341 0155 SMaxSampleValue Extended
value.
Expands the range of the Trans-
342 0156 TransferRange Extended
ferFunction.
Mirrors the essentials of
343 0157 ClipPath PostScript's path creation func- Extended
tionality.
The number of units that span the
344 0158 XClipPathUnits width of the image, in terms of Extended
integer ClipPath coordinates.
The number of units that span the
345 0159 YClipPathUnits height of the image, in terms of Extended
integer ClipPath coordinates.

334
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Aims to broaden the support for
346 015A Indexed indexed images to include support Extended
for any color space.
JPEG quantization and/or Huffman
347 015B JPEGTables Extended
tables.
351 015F OPIProxy OPI-related. Extended
Used in the TIFF-FX standard to
point to an IFD containing tags that
400 0190 GlobalParametersIFD Extended
are globally applicable to the com-
plete TIFF file.
Used in the TIFF-FX standard,
401 0191 ProfileType denotes the type of data stored in Extended
this file or IFD.
Used in the TIFF-FX standard,
402 0192 FaxProfile denotes the 'profile' that applies to Extended
this file.
Used in the TIFF-FX standard,
403 0193 CodingMethods indicates which coding methods Extended
are used in the file.
Used in the TIFF-FX standard,
404 0194 VersionYear denotes the year of the standard Extended
specified by the FaxProfile field.
Used in the TIFF-FX standard,
405 0195 ModeNumber denotes the mode of the standard Extended
specified by the FaxProfile field.
Used in the TIFF-F and TIFF-FX
standards, holds information about
433 01B1 Decode the ITULAB (Pho- Extended
tometricInterpretation = 10) encod-
ing.
Defined in the Mixed Raster Con-
tent part of RFC 2301, is the
434 01B2 DefaultImageColor Extended
default color needed in areas where
no image is available.
Old-style JPEG compression field.
512 0200 JPEGProc TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
513 0201 JPEGInterchangeFormat TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
514 0202 JPEGInterchangeFormatLength TechNote2 invalidates this part of Extended
the specification.
515 0203 JPEGRestartInterval Old-style JPEG compression field. Extended

335
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
TechNote2 invalidates this part of
the specification.
Old-style JPEG compression field.
517 0205 JPEGLosslessPredictors TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
518 0206 JPEGPointTransforms TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
519 0207 JPEGQTables TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
520 0208 JPEGDCTables TechNote2 invalidates this part of Extended
the specification.
Old-style JPEG compression field.
521 0209 JPEGACTables TechNote2 invalidates this part of Extended
the specification.
The transformation from RGB to
YCbCr image data.
529 0211 YCbCrCoefficients Extended
Mandatory for TIFF/EP YCbCr
images.
Specifies the subsampling factors
530 0212 YCbCrSubSampling used for the chrominance com- Extended
ponents of a YCbCr image.
Specifies the positioning of sub-
531 0213 YCbCrPositioning sampled chrominance components Extended
relative to luminance samples.
Specifies a pair of headroom and
532 0214 ReferenceBlackWhite footroom image data values Extended
(codes) for each pixel component.
Defined in the Mixed Raster Con-
tent part of RFC 2301, used to
559 022F StripRowCounts Extended
replace RowsPerStrip for IFDs
with variable-sized strips.
XML packet containing XMP
700 02BC XMP Extended
metadata
32781 800D ImageID OPI-related. Extended
Annotation data, as used in 'Ima-
32932 80A4 Wang Annotation Private
ging for Windows.
For camera raw files from sensors TIFF/EP
33421 828D CFARepeatPatternDim
with CFA overlay. spec, p. 23
For camera raw files from sensors TIFF/EP
33422 828E CFAPattern
with CFA overlay. spec, p. 23
33423 828F BatteryLevel Encodes camera battery level at TIFF/EP

336
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
time of image capture. spec, p. 45
33432 8298 Copyright Copyright notice. Baseline
Exif Private
IFD
33434 829A ExposureTime Exposure time given in seconds.
TIFF/EP
spec, p. 38
Exif Private
IFD
33437 829D FNumber The F number.
TIFF/EP
spec, p. 39
Specifies the pixel data format
33445 82A5 MD FileTag encoding in the Molecular Dynam- Private
ics GEL file format.
Specifies a scale factor in the
33446 82A6 MD ScalePixel Molecular Dynamics GEL file Private
format.
Used to specify the conversion
33447 82A7 MD ColorTable from 16bit to 8bit in the Molecular Private
Dynamics GEL file format.
Name of the lab that scanned this
33448 82A8 MD LabName file, as used in the Molecular Private
Dynamics GEL file format.
Information about the sample, as
33449 82A9 MD SampleInfo used in the Molecular Dynamics Private
GEL file format.
Date the sample was prepared, as
33450 82AA MD PrepDate used in the Molecular Dynamics Private
GEL file format.
Time the sample was prepared, as
33451 82AB MD PrepTime used in the Molecular Dynamics Private
GEL file format.
Units for data in this file, as used in
33452 82AC MD FileUnits the Molecular Dynamics GEL file Private
format.
Used in interchangeable GeoTIFF_
33550 830E ModelPixelScaleTag Private
1_0 files.
IPTC-NAA (International Press
Telecommunications Council- TIFF/EP
33723 83BB IPTC/NAA
Newspaper Association of Amer- spec, p. 33
ica) metadata.
Intergraph Application specific stor-
33918 847E INGR Packet Data Tag Private
age.
33919 847F INGR Flag Registers Intergraph Application specific Private

337
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
flags.
Originally part of Intergraph's
33920 8480 IrasB Transformation Matrix GeoTIFF tags, but likely under- Private
stood by IrasB only.
Originally part of Intergraph's
GeoTIFF tags, but now used in
interchangeable GeoTIFF_1_0
33922 8482 ModelTiepointTag Private
files. In GeoTIFF_1_0, either this
tag or 34264 must be defined, but
not both
TIFF/IT
34016 Site Site where image created.
spec, 7.2.3
TIFF/IT
Sequence of colors if other than
34017 ColorSequence spec,
CMYK.
7.2.8.3.2
TIFF/IT
34018 IT8Header Certain inherited headers.
spec, 7.2.3
TIFF/IT
34019 RasterPadding Type of raster padding used, if any.
spec, 7.2.6
Number of bits for short run length TIFF/IT
34020 BitsPerRunLength
encoding. spec, 7.2.6
Number of bits for long run length TIFF/IT
34021 BitsPerExtendedRunLength
encoding. spec, 7.2.6
TIFF/IT
34022 ColorTable Color value in a color pallette. spec,
7.2.8.4
Indicates if image (foreground) TIFF/IT
34023 ImageColorIndicator
color or transparency is specified. spec, 7.2.9
TIFF/IT
34024 BackgroundColorIndicator Background color specification.
spec, 7.2.9
TIFF/IT
34025 ImageColorValue Specifies image (foreground) color. spec,
7.2.8.4
TIFF/IT
34026 BackgroundColorValue Specifies background color. spec,
7.2.8.4
TIFF/IT
Specifies data values for 0 percent
34027 PixelIntensityRange spec,
and 100 percent pixel intensity.
7.2.8.4
TIFF/IT
Specifies if transparency is used in
34028 TransparencyIndicator spec,
HC file.
7.2.8.4
Specifies ASCII table or other ref- TIFF/IT
34029 ColorCharacterization
erence per ISO 12641 and ISO spec,

338
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
12642. 7.2.8.4
Indicates the type of information in TIFF/IT
34030 HCUsage
an HC file. spec, 7.2.6
Indicates whether or not trapping TIFF/IT
34031 TrapIndicator
has been applied to the file. spec, 7.2.6
TIFF/IT
Specifies CMYK equivalent for spe-
34032 CMYKEquivalent spec,
cific separations.
7.2.8.3.4
TIFF/IT
34033 Reserved For future TIFF/IT use
spec
TIFF/IT
34034 Reserved For future TIFF/IT use
spec
TIFF/IT
34035 Reserved For future TIFF/IT use
spec
Used in interchangeable GeoTIFF_
1_0 files. In GeoTIFF_1_0, either
34264 85D8 ModelTransformationTag Private
this tag or 33922 must be defined,
but not both
Collection of Photoshop 'Image
34377 8649 Photoshop Private
Resource Blocks.
34665 8769 Exif IFD A pointer to the Exif IFD. Private
TIFF/EP
34675 8773 InterColorProfile ICC profile data.
spec, p. 47
Defined in the Mixed Raster Con-
tent part of RFC 2301, used to
34732 87AC ImageLayer denote the particular function of Extended
this Image in the mixed raster
scheme.
Used in interchangeable GeoTIFF_
34735 87AF GeoKeyDirectoryTag 1_0 files. Mandatory in GeoTIFF_ Private
1_0.
Used in interchangeable GeoTIFF_
34736 87B0 GeoDoubleParamsTag Private
1_0 files.
Used in interchangeable GeoTIFF_
34737 87B1 GeoAsciiParamsTag Private
1_0 files.
Exif Private
The class of the program used by IFD
34850 8822 ExposureProgram the camera to set exposure when
the picture is taken. TIFF/EP
spec, p. 41
Exif Private
Indicates the spectral sensitivity of IFD
34852 8824 SpectralSensitivity
each channel of the camera used. TIFF/EP
spec, p. 48

339
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
A pointer to the Exif-related GPS TIFF/EP
34853 8825 GPSInfo
Info IFD. spec, p. 34
Exif Private
Indicates the ISO Speed and ISO IFD
34855 8827 ISOSpeedRatings Latitude of the camera or input
device as specified in ISO 12232. TIFF/EP
spec, p. 47
Exif Private
Indicates the Opto-Electric Con- IFD
34856 8828 OECF version Function (OECF) specified
in ISO 14524. TIFF/EP
spec, p. 48
Indicates the field number of mul- TIFF/EP
34857 8829 Interlace
tifield images. spec, p. 22
Encodes time zone of camera TIFF/EP
34858 882A TimeZoneOffset
clock relative to GMT. spec, p. 38
Number of seconds image capture TIFF/EP
34859 882B SelfTimeMode
was delayed from button press. spec, p. 45
34908 885C HylaFAX FaxRecvParams Used by HylaFAX. Private
34909 885D HylaFAX FaxSubAddress Used by HylaFAX. Private
34910 885E HylaFAX FaxRecvTime Used by HylaFAX. Private
The version of the supported Exif
Exif Private
36864 9000 ExifVersion standard. Mandatory in the Exif
IFD
IFD.
Exif Private
The date and time when the original IFD
36867 9003 DateTimeOriginal image data was generated. Man-
datory for TIFF/EP. TIFF/EP
spec, p. 37
The date and time when the image Exif Private
36868 9004 DateTimeDigitized
was stored as digital data. IFD
Specific to compressed data; spe-
cifies the channels and com- Exif Private
37121 9101 ComponentsConfiguration
plements IFD
PhotometricInterpretation
Exif Private
Specific to compressed data; IFD
37122 9102 CompressedBitsPerPixel states the compressed bits per
pixel. TIFF/EP
spec, p. 27
Exif Private
IFD
37377 9201 ShutterSpeedValue Shutter speed.
TIFF/EP
spec, p. 39
Exif Private
37378 9202 ApertureValue The lens aperture.
IFD

340
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
TIFF/EP
spec, p. 39
Exif Private
IFD
37379 9203 BrightnessValue The value of brightness.
TIFF/EP
spec, p. 40
Exif Private
IFD
37380 9204 ExposureBiasValue The exposure bias.
TIFF/EP
spec, p. 40
Exif Private
IFD
37381 9205 MaxApertureValue The smallest F number of the lens.
TIFF/EP
spec, p. 40
Exif Private
The distance to the subject, given IFD
37382 9206 SubjectDistance
in meters. TIFF/EP
spec, p. 44
Exif Private
IFD
37383 9207 MeteringMode The metering mode.
TIFF/EP
spec, p. 41
Exif Private
IFD
37384 9208 LightSource The kind of light source.
TIFF/EP
spec, p. 46
Exif Private
Indicates the status of flash when IFD
37385 9209 Flash
the image was shot. TIFF/EP
spec, p. 42
Exif Private
The actual focal length of the lens, IFD
37386 920A FocalLength
in mm. TIFF/EP
spec, p. 44
TIFF/EP
37387 920B FlashEnergy Amount of flash energy (BCPS).
spec, p. 43
TIFF/EP
37388 920C SpatialFrequencyResponse SFR of the camera.
spec, p. 49
TIFF/EP
37389 920D Noise Noise measurement values.
spec, p. 49

341
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Number of pixels per
FocalPlaneResolutionUnit (37392) TIFF/EP
37390 920E FocalPlaneXResolution
in ImageWidth direction for main spec, p. 18
image.
Number of pixels per
FocalPlaneResolutionUnit (37392) TIFF/EP
37391 920F FocalPlaneYResolution
in ImageLength direction for main spec, p. 19
image.
Unit of measurement for
FocalPlaneXResolution(37390) TIFF/EP
37392 9210 FocalPlaneResolutionUnit
and FocalPlaneYResolution spec, p. 19
(37391).
Number assigned to an image, TIFF/EP
37393 9211 ImageNumber
e.g., in a chained image burst. spec, p. 32
Security classification assigned to TIFF/EP
37394 9212 SecurityClassification
the image. spec, p. 33
Record of what has been done to TIFF/EP
37395 9213 ImageHistory
the image. spec, p. 33
Exif Private
Indicates the location and area of IFD
37396 9214 SubjectLocation the main subject in the overall
scene. TIFF/EP
spec, p. 45
Encodes the camera exposure
TIFF/EP
37397 9215 ExposureIndex index setting when image was cap-
spec, p. 47
tured.
For current spec, tag value equals
1 0 0 0. TIFF/EP
37398 9216 TIFF/EPStandardID
spec, p. 16
Mandatory in TIFF/EP.
Type of image sensor. TIFF/EP
37399 9217 SensingMethod
Mandatory in TIFF/EP. spec, p. 22
Exif Private
37500 927C MakerNote Manufacturer specific information.
IFD
Keywords or comments on the
Exif Private
37510 9286 UserComment image; complements ImageDe-
IFD
scription.
A tag used to record fractions of Exif Private
37520 9290 SubsecTime
seconds for the DateTime tag. IFD
A tag used to record fractions of
Exif Private
37521 9291 SubsecTimeOriginal seconds for the DateTimeOriginal
IFD
tag.
A tag used to record fractions of
Exif Private
37522 9292 SubsecTimeDigitized seconds for the DateTimeDigitized
IFD
tag.

342
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
37724 935C ImageSourceData Used by Adobe Photoshop. Private
The Flashpix format version sup-
ported by a FPXR file., Exif Private
40960 A000 FlashpixVersion
IFD
Mandatory in the Exif IFD
The color space information tag is
always recorded as the color space Exif Private
40961 A001 ColorSpace specifier. IFD
Mandatory in the Exif IFD.
Specific to compressed data; the
Exif Private
40962 A002 PixelXDimension valid width of the meaningful
IFD
image.
Specific to compressed data; the
Exif Private
40963 A003 PixelYDimension valid height of the meaningful
IFD
image.
Used to record the name of an Exif Private
40964 A004 RelatedSoundFile
audio file related to the image data. IFD
A pointer to the Exif-related Inter-
40965 A005 Interoperability IFD Private
operability IFD.
Indicates the strobe energy at the
time the image is captured, as Exif Private
41483 A20B FlashEnergy
measured in Beam Candle Power IFD
Seconds
Records the camera or input
device spatial frequency table and
SFR values in the direction of Exif Private
41484 A20C SpatialFrequencyResponse
image width, image height, and IFD
diagonal direction, as specified in
ISO 12233.
Indicates the number of pixels in
the image width (X) direction per Exif Private
41486 A20E FocalPlaneXResolution
FocalPlaneResolutionUnit on the IFD
camera focal plane.
Indicates the number of pixels in
the image height (Y) direction per Exif Private
41487 A20F FocalPlaneYResolution
FocalPlaneResolutionUnit on the IFD
camera focal plane.
Indicates the unit for measuring
Exif Private
41488 A210 FocalPlaneResolutionUnit FocalPlaneXResolution and
IFD
FocalPlaneYResolution.
Indicates the location of the main Exif Private
41492 A214 SubjectLocation
subject in the scene. IFD
Indicates the exposure index selec-Exif Private
41493 A215 ExposureIndex
ted on the camera or input device IFD

343
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
at the time the image is captured.
Indicates the image sensor type on Exif Private
41495 A217 SensingMethod
the camera or input device. IFD
Exif Private
41728 A300 FileSource Indicates the image source.
IFD
Exif Private
41729 A301 SceneType Indicates the image source.
IFD
Indicates the color filter array
(CFA) geometric pattern of the Exif Private
41730 A302 CFAPattern
image sensor when a one-chip IFD
color area sensor is used.
Indicates the use of special pro-
Exif Private
41985 A401 CustomRendered cessing on image data, such as
IFD
rendering geared to output.
Indicates the exposure mode set Exif Private
41986 A402 ExposureMode
when the image was shot. IFD
Indicates the white balance mode Exif Private
41987 A403 WhiteBalance
set when the image was shot. IFD
Indicates the digital zoom ratio Exif Private
41988 A404 DigitalZoomRatio
when the image was shot. IFD
Indicates the equivalent focal
Exif Private
41989 A405 FocalLengthIn35mmFilm length assuming a 35mm film cam-
IFD
era, in mm.
Indicates the type of scene that Exif Private
41990 A406 SceneCaptureType
was shot. IFD
Indicates the degree of overall Exif Private
41991 A407 GainControl
image gain adjustment. IFD
Indicates the direction of contrast
Exif Private
41992 A408 Contrast processing applied by the camera
IFD
when the image was shot.
Indicates the direction of saturation
Exif Private
41993 A409 Saturation processing applied by the camera
IFD
when the image was shot.
Indicates the direction of sharp-
Exif Private
41994 A40A Sharpness ness processing applied by the
IFD
camera when the image was shot.
This tag indicates information on
Exif Private
41995 A40B DeviceSettingDescription the picture-taking conditions of a
IFD
particular camera model.
Indicates the distance to the sub- Exif Private
41996 A40C SubjectDistanceRange
ject. IFD
Indicates an identifier assigned Exif Private
42016 A420 ImageUniqueID
uniquely to each image. IFD
42112 A480 GDAL_METADATA Used by the GDAL library, holds an Private

344
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
XML list of name=value 'metadata'
values about the image as a whole,
and about specific samples.
Used by the GDAL library, con-
42113 A481 GDAL_NODATA tains an ASCII encoded nodata or Private
background pixel value.
A 128-bit Globally Unique Identifier HD Photo
48129 BC01 PixelFormat (GUID) that identifies the image Feature
pixel format. Spec, p. 17
Specifies the transformation to be
HD Photo
applied when decoding the image
48130 BC02 Transformation Feature
to present the desired rep-
Spec, p. 23
resentation.
HD Photo
Specifies that image data is uncom-
48131 BC03 Uncompressed Feature
pressed.
Spec, p. 23
Specifies the image type of each HD Photo
48132 BC04 ImageType individual frame in a multi-frame Feature
file. Spec, p. 27
The image's width, in pixels (X:ho- HD Photo
48256 BC80 ImageWidth rizontal). The number of columns in Feature
the image. Spec, p. 21
Specifies the number of pixels or HD Photo
48257 BC81 ImageHeight scan lines in the transformed Feature
photo. Spec, p. 21
Specifies the horizontal resolution HD Photo
48258 BC82 WidthResolution of a transformed image expressed Feature
in pixels per inch. Spec, p. 21
Specifies the vertical resolution of HD Photo
48259 BC83 HeightResolution a transformed image expressed in Feature
pixels per inch. Spec, p. 21
Specifies the byte offset pointer to HD Photo
48320 BCC0 ImageOffset the beginning of the photo data, rel- Feature
ative to the beginning of the file. Spec, p. 22
HD Photo
Specifies the size of the photo in
48321 BCC1 ImageByteCount Feature
bytes.
Spec, p. 22
Specifies the byte offset pointer
HD Photo
the beginning of the planar alpha
48322 BCC2 AlphaOffset Feature
channel data, relative to the begin-
Spec, p. 22
ning of the file.
HD Photo
Specifies the size of the alpha
48323 BCC3 AlphaByteCount Feature
channel data in bytes.
Spec, p. 23

345
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Signifies the level of data that has
HD Photo
been discarded from the image as
48324 BCC4 ImageDataDiscard Feature
a result of a compressed domain
Spec, p. 25
transcode to reduce the file size.
Signifies the level of data that has
been discarded from the planar HD Photo
48325 BCC5 AlphaDataDiscard alpha channel as a result of a com- Feature
pressed domain transcode to Spec, p. 26
reduce the file size.
Specifies the image type of each HD Photo
48132 BC04 ImageType individual frame in a multi-frame Feature
file. Spec, p. 27
50215 C427 Oce Scanjob Description Used in the Oce scanning process. Private
50216 C428 Oce Application Selector Used in the Oce scanning process. Private
50217 C429 Oce Identification Number Used in the Oce scanning process. Private
Oce ImageLogic Char-
50218 C42A Used in the Oce scanning process. Private
acteristics
Encodes DNG four-tier version
number; for version 1.1.0.0, the tag DNG spec,
50706 C612 DNGVersion
contains the bytes 1, 1, 0, 0. Used p. 17
in IFD 0 of DNG files.
Defines oldest version of spec with
DNG spec,
50707 C613 DNGBackwardVersion which file is compatible. Used in
p. 17
IFD 0 of DNG files.
Unique, non-localized nbame for
DNG spec,
50708 C614 UniqueCameraModel camera model. Used in IFD 0 of
p. 18
DNG files.
Similar to 50708, with localized
DNG spec,
50709 C615 LocalizedCameraModel camera name. Used in IFD 0 of
p. 19
DNG files.
Mapping between values in the
CFAPattern tag and the plane num-
bers in LinearRaw space. Used in DNG spec,
50710 C616 CFAPlaneColor Raw IFD of DNG files. p. 19
Required for non-RGB CFA
images.
Spatial layout of the CFA. Used in DNG spec,
50711 C617 CFALayout
Raw IFD of DNG files. p. 20
Lookup table that maps stored val-
DNG spec,
50712 C618 LinearizationTable ues to linear values. Used in Raw
p. 20
IFD of DNG files.
Repeat pattern size for BlackLevel
DNG spec,
50713 C619 BlackLevelRepeatDim tag. Used in Raw IFD of DNG
p. 21
files.

346
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Specifies the zero light encoding
DNG spec,
50714 C61A BlackLevel level.Used in Raw IFD of DNG
p. 21
files.
Specifies the difference between
zero light encoding level for each
DNG spec,
50715 C61B BlackLevelDeltaH column and the baseline zero light
p. 22
encoding level. Used in Raw IFD
of DNG files.
Specifies the difference between
zero light encoding level for each
DNG spec,
50716 C61C BlackLevelDeltaV row and the baseline zero light
p. 23
encoding level. Used in Raw IFD
of DNG files.
Specifies the fully saturated encod-
DNG spec,
50717 C61D WhiteLevel ing level for the raw sample values.
p. 23
Used in Raw IFD of DNG files.
For cameras with non-square
pixels, specifies the default scale
DNG spec,
50718 C61E DefaultScale factors for each direction to convert
p. 24
the image to square pixels. Used in
Raw IFD of DNG files.
Specifies the origin of the final
image area, ignoring the extra
DNG spec,
50719 C61F DefaultCropOrigin pixels at edges used to prevent
p. 25
interpolation artifacts. Used in Raw
IFD of DNG files.
Specifies size of final image area in
DNG spec,
50720 C620 DefaultCropSize raw image coordinates. Used in
p. 25
Raw IFD of DNG files.
Defines a transformation matrix
that converts XYZ values to ref-
erence camera native color space DNG spec,
50721 C621 ColorMatrix1
values, under the first calibration p. 27
illuminant. Used in IFD 0 of DNG
files.
Defines a transformation matrix
that converts XYZ values to ref-
erence camera native color space DNG spec,
50722 C622 ColorMatrix2
values, under the second cal- p. 28
ibration illuminant. Used in IFD 0 of
DNG files.
Defines a calibration matrix that
transforms reference camera nat- DNG spec,
50723 C623 CameraCalibration1
ive space values to individual cam- p. 28
era native space values under the

347
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
first calibration illuminant. Used in
IFD 0 of DNG files.
Defines a calibration matrix that
transforms reference camera nat-
ive space values to individual cam- DNG spec,
50724 C624 CameraCalibration2
era native space values under the p. 29
second calibration illuminant. Used
in IFD 0 of DNG files.
Defines a dimensionality reduction
matrix for use as the first stage in
converting color camera native DNG spec,
50725 C625 ReductionMatrix1
space values to XYZ values, under p. 30
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 camera native DNG spec,
50726 C626 ReductionMatrix2
space values to XYZ values, under p. 30
the second calibration illuminant.
Used in IFD 0 of DNG files.
Pertaining to white balance,
defines the gain, either analog or
DNG spec,
50727 C627 AnalogBalance digital, that has been applied to the
p. 31
stored raw values. Used in IFD 0 of
DNG files.
Specifies the selected white bal-
ance at the time of capture,
encoded as the coordinates of a DNG spec,
50728 C628 AsShotNeutral
perfectly neutral color in linear ref- p. 31
erence space values. Used in IFD
0 of DNG files.
Specifies the selected white bal-
ance at the time of capture,
DNG spec,
50729 C629 AsShotWhiteXY encoded as x-y chromaticity
p. 32
coordinates. Used in IFD 0 of DNG
files.
Specifies in EV units how much to
move the zero point for exposure DNG spec,
50730 C62A BaselineExposure
compensation. Used in IFD 0 of p. 32
DNG files.
Specifies the relative noise of the
camera model at a baseline ISO
DNG spec,
50731 C62B BaselineNoise value of 100, compared to ref-
p. 33
erence camera model. Used in IFD
0 of DNG files.

348
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Specifies the relative amount of
sharpening required for this camera
DNG spec,
50732 C62C BaselineSharpness model, compared to reference cam-
p. 33
era model. Used in IFD 0 of DNG
files.
For CFA images, specifies, in arbit-
rary units, how closely the values
of the green pixels in the blue/green DNG spec,
50733 C62D BayerGreenSplit
rows track the values of the green p. 34
pixels in the red/green rows. Used
in Raw IFD of DNG files.
Specifies the fraction of the encod-
ing range above which the
DNG spec,
50734 C62E LinearResponseLimit response may become sig-
p. 34
nificantly non-linear. Used in IFD 0
of DNG files.
Serial number of camera. Used in DNG spec,
50735 C62F CameraSerialNumber
IFD 0 of DNG files. p. 35
Information about the lens. Used in DNG spec,
50736 C630 LensInfo
IFD 0 of DNG files. p. 35
Normally for non-CFA images,
provides a hint about how much DNG spec,
50737 C631 ChromaBlurRadius
chroma blur ought to be applied. p. 36
Used in Raw IFD of DNG files.
Provides a hint about the strength
DNG spec,
50738 C632 AntiAliasStrength of the camera's anti-aliasing filter.
p. 36
Used in Raw IFD of DNG files.
Used by Adobe Camera Raw to
DNG spec,
50739 ShadowScale control sensitivity of its shadows
p. 38
slider. Used in IFD 0 of DNG files.
Provides a way for camera man-
ufacturers to store private data in
DNG spec,
50740 C634 DNGPrivateData DNG files for use by their own raw
p. 37
convertors. Used in IFD 0 of DNG
files.
Lets the DNG reader know whether
the Exif MakerNote tag is safe to DNG spec,
50741 C635 MakerNoteSafety
preserve. Used in IFD 0 of DNG p. 38
files.
Illuminant used for first set of cal-
DNG spec,
50778 C65A CalibrationIlluminant1 ibration tags. Used in IFD 0 of
p. 26
DNG files.
Illuminant used for second set of
DNG spec,
50779 C65B CalibrationIlluminant2 calibration tags. Used in IFD 0 of
p. 26
DNG files.

349
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
Specifies the amount by which the
values of the DefaultScale tag
DNG spec,
50780 C65C BestQualityScale need to be multiplied to achieve
p. 24
best quality image size. Used in
Raw IFD of DNG files.
Contains a 16-byte unique identifier
DNG spec,
50781 RawDataUniqueID for the raw image file in the DNG
p. 39
file. Used in IFD 0 of DNG files.
Alias Sketchbook Pro layer usage
50784 C660 Alias Layer Metadata Private
description.
Name of original file if the DNG file
results from conversion from a non- DNG spec,
50827 OriginalRawFileName
DNG raw file. Used in IFD 0 of p. 39
DNG files.
If the DNG file was converted from
a non-DNG raw file, then this tag DNG spec,
50828 OriginalRawFileData
contains the original raw data. p. 40
Used in IFD 0 of DNG files.
Defines the active (non-masked)
DNG spec,
50829 ActiveArea pixels of the sensor. Used in Raw
p. 41
IFD of DNG files.
List of non-overlapping rectangle
coordinates of fully masked pixels,
which can optimally be used by DNG spec,
50830 MaskedAreas
DNG readers to measure the black p. 42
encoding level. Used in Raw IFD
of DNG files.
Contains ICC profile that, in con-
junction with the AsShotPrePro-
fileMatrix tag, specifies a default
color rendering from camera color DNG spec,
50831 AsShotICCProfile
space coordinates (linear reference p. 42
values) into the ICC profile con-
nection space. Used in IFD 0 of
DNG files.
Specifies a matrix that should be
applied to the camera color space
coordinates before processing the DNG spec,
50832 AsShotPreProfileMatrix
values through the ICC profile spe- p. 43
cified in the AsShotICCProfile tag.
Used in IFD 0 of DNG files.
The CurrentICCProfile and Cur-
rentPreProfileMatrix tags have the DNG spec,
50833 CurrentICCProfile same purpose and usage as the p. 44
AsShotICCProfile and

350
Appendix D - TIFF Tags

Code Source of
Name Description
Dec Hex Tag
AsShotPreProfileMatrix tag pair,
except they are for use by raw file
editors rather than camera man-
ufacturers. Used in IFD 0 of DNG
files.
The CurrentICCProfile and Cur-
rentPreProfileMatrix tags have the
same purpose and usage as the
AsShotICCProfile and
DNG spec,
50834 CurrentPreProfileMatrix AsShotPreProfileMatrix tag pair,
p. 44
except they are for use by raw file
editors rather than camera man-
ufacturers. Used in IFD 0 of DNG
files.
1Content for base and extended tags used by permission of the author, Max Maischein.

351
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. Please see
OUT_OF_MEMORY -1 Determining Memory Requirements in
Chapter 2 for more information on the amount
of memory required.
Open call failed when trying to decompress
FILE_NOT_FOUND -2
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 and attach
BAD_RETURN -5
the document you were processing 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 lib-
rary can decompress. Please see Appendix
FORMAT_NOT_ALLOWED -7
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 returned in
NO_BITMAP_FOUND -8 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 i/o
DISK_FULL -9
write failed.
Tried to display with negative coordinates or
BAD_DISPLAY_AREA -10
out of range.
Used for multi-page file format support when
attempting to access a page which does not
PAGE_NOT_FOUND -11 exist. This error code provides information of
an empty Word-page which is not converted
to an empty page in PDF or TIFF.
File format was truncated and tried to read
DISK_READ_ERROR -12 past end of file. Standard read i/o function
failed.

352
Appendix E - Snowbound Error Codes

Error Error Code Description


Application passed bad image handle. Not a
BAD_HANDLE -13
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 Snowbound
EVAL_TIMEOUT -19
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 processing function on
PIXEL_DEPTH_
-21 an image whose bits per pixel is not allowed.
UNSUPPORTED
Please see Appendix A, Supported File
Format for the pixel depths of each supported
format.
PALETTE_IMAGES_NOT_ Some image processing operations does not
-22
ALLOWED 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 all
NO_MORE_PAGES -28
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 support
this function. You do not have support for this
NOT_SUPPORTED_IN_THIS_ file format. You may contact support or your
-33
VERSION account representative to get information on
the RasterMaster option that will allow you to
process the file format.
AUTOFEED_FAILED -34 Autofeed fail in the TWAIN Scanner.

353
Appendix E - Snowbound Error Codes

Error Error Code Description


NO_FAST_TWAIN_
-35 TWAIN driver cannot do fast transfer.
SUPPORTED
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 during
processing. Please enter a support ticket at
http://support.snowbound.com providing the
document that was being processed and the
EXCEPTION_ERROR -38 Java console log output. 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_VERSION -41 NO JPEG2000 plug-in found in this version.
SEARCH_STRING_NOT_
-42 Did not find attempted search string.
FOUND
NO_WORD_VERSION -43 NO MS Word plug-in found in this version.
PASSWORD_PROTECTED_
-44 This file was password protected.
PDF
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 per-
ACCESS_DENIED -46
missions.
BAD_LICENSE_PRIMARY Primary level license loaded is bad. Sec-
-47
BAD_LICENSE_SECONDARY ondary level license loaded is bad.
PASSWORD_PROTECTED_ This file was password protected for Word or
-48
FILE other formats.
PDF_PACKAGE_NOT_ You are using a version that does not support
-50
SUPPORTED PDF packages.
The OOXML Aspose license file was not
OOXML_LICENSE_NOT_
-52 found. Please see IMGLOW_ooxml_license_
FOUND
enable() to set the license path.
The OOXML Aspose license file expired or is
OOXML_LICENSE_EXPIRED -53
otherwise invalid.
FONT_PATH_FOLDER_NOT_
-54 The PDF/A font path folder does not exist.
FOUND
FONT_FONT_PATH_FOLDER_
-55 The PDF/A font path folder is empty.
IS_EMPTY

354
Appendix E - Snowbound Error Codes

Error Error Code Description


FONT_PATH_FOLDER_
-56 The PDF/A font path folder has no fonts.
MISSING_FONTS
FONT_PATH_FOLDER_TOO_ The PDF/A font path folder has unexpected #
-57
FEW_FONTS of fonts, too few.

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
-100
CRASH is the resulting value.
GENERAL_STATUS.DELETE_
-101 Image data of the object failed
ERROR
What the internal values are initially
GENERAL_STATUS.DEFAULT -102
set to
GENERAL STATUS.SNOWBND_OK 1 Operation completed successfully
GENERAL STATUS.SNOWBND_ Operation failed. See StatusDetails
-1
ERROR property.
GENERAL_STATUS.IMAGE_NOT_ Internal image data unavailable when
-103
AVAILABLE trying to complete an operation
GENERAL STATUS.SNOWBND_API_
-104 API is not implemented
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.
IMAGE_NOT_AVAILABLE No image data is available to

355
Appendix E - Snowbound Error Codes

Error Description
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.
General API status of a suc-
SNOWBND_OK
cessful action.
This is returned when a Critical
SYSTEM_CRASH
Exception is thrown.

356
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 Formatsshows 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,

357
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 sup-
ported bit depths.

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

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

360
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

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

362
Index: -1 error code – -43 error code

-22 error code 353


Index
-23 error code 353

-24 error code 353


-

-1 error code 352 -25 error code 353

-10 error code 352 -26 error code 353

-100 error code 355 -27 error code 353

-101 error code 355 -28 error code 353

-102 error code 355 -29 error code 353

-103 error code 355 -3 error code 352, 360

-104 error code 355 -30 error code 353

-105 error code 355 -31 error code 353

-106 error code 355 -32 error code 353

-11 error code 352 -33 error code 353

-12 error code 352 -34 error code 353

-13 error code 353 -35 error code 354

-14 error code 353 -36 error code 354

-15 error code 353 -37 error code 354

-16 error code 353 -38 error code 354

-17 error codee 353 -39 error code 354

-18 error code 353 -4 error code 352

-19 error code 353 -40 error code 354

-2 error code 352 -41 error code 354

-20 error code 353 -42 error code 354

-21 error code 353 -43 error code 354

363
Index: -44 error code – ASCIICHARSPERLINE

-44 error code 354 AFP 235, 282, 361

-45 error code 354 file type 294

-46 error code 354 AFP Font Mapping 234

-47 error code 354 AFP resource

-48 error code 354 not displayed 360

-5 error code 352 AFP troubleshooting

-50 error code 354 overlay 360

-52 error code 354 AFP/MO 226

-53 error code 354 Aliasing 54

-54 error code 354 Alpha 308

-55 error code 354 Animate 308

-56 error code 355 Annlib.h 303

-57 error code 355 Annotate 309

-6 error code 352 Annotation Constants 277

-7 error code 352 ASCII 281

-8 error code 352 described 282

-9 error code 352 file type 294

filter bit level support 281


1
ASCII Attribute Structure 124
1 error code 355
ASCII file 126
A
Path/filename 126
ABIC 282
ASCII Formats 124
abicplug.dll 303
ASCIICHARSPERLINE 125
ACCESS_DENIED error code 354

364
Index: ASCIII text format – BMP_UNCOMPRESSED

ASCIII text format Aspose.Total.Product.Family.lic 303

auto detection 124 Aspose.Words.dll 303

ASCIIITALIC 125 Aspose.Words.lic 303

ASCIILINESPERPAGE 125 auto detection

ASCIIMARGIN 125 ASCII text format 124

ASCIIPAGEHEIGHT 125 AUTOFEED_FAILED error code 353

ASCIIPAGEWIDTH 125 automatically detecting

ASCIIPOINTSIZE 125 file formats 57

ASCIITABSTOP 125
B
ASCIITYPEFACE 125
BAD_DISPLAY_AREA error
ASCIIWEIGHT 125 code 352

ASCIIXDPI 125 BAD_HANDLE error code 353

ASCIIXSIZEENVELOPE 125 BAD_LICENSE_PRIMARY error


code 354
ASCIIXSIZEEXECUTIVE 125
BAD_LICENSE_SECONDARY error
ASCIIXSIZELEGAL 125
code 354
ASCIIXSIZELETTER 125
BAD_RETURN error code 352
ASCIIYDPI 125
BAD_STRING error code 352
ASCIIYSIZEENVELOPE 125
bit depth 133
ASCIIYSIZEEXECUTIVE 125
bits per pixel 133
ASCIIYSIZELEGAL 125
BMP_COMPRESSED 282
ASCIIYSIZELETTER 125
file type 293
Aspect Ratio Correction Functions 52
BMP_UNCOMPRESSED 282
Aspose 176
file type 293
Aspose.Slides.dll 303

365
Index: BOM – CXand

BOM 173 CFF 282

BRK file type 295

defined 282 CIFF 282

BROOK_TROUT file type 295

file type 293 CIMS

byte order mark 173 file type 295

CIMS (ABIC)
C
described 283
Callback 310
CLIP
Callback Routines 47
file type 283, 293
CALS
COD
described 282
file type 283, 294
file type 293
color page input 58, 235, 361
CANT_CREATE_FILE error code 352
color page ouput 235, 361
CANT_FIND_TWAIN_DLL error
code 353 color reduction 59

CCITT_G3 282 COMPRESSION_NOT_


SUPPORTED error code 353
file type 294
conversion takes too long 59
CCITT_G3_FO 282
CORRUPTED_FILE 360
file type 294
CORRUPTED_FILE error code 352
CCITT_G4 282
CSV 283
file type 294
CUT
CCITT_G4_FO 282
file type 283, 294
file type 294
CXand 105

366
Index: DCS – EPS

DocClean functions 181


D
docplug.dll 303
DCS
Document Conversion 226
file type 283, 294
Document File Formats 278
DCX
DOCX
defined 283
described 283
file type 293
file type 295
DELETE_ERROR error code 355
DPI 57-58
DIB
DWG
described 283
file type 284, 295
file type 294
dwgplug.dll 303
DICOM
DXF
described 283
file type 284, 295
file type 294
DXF Functions 165
DISK_FULL error code 352

DISK_READ_ERROR error code 352 E

Display Quality 54 EMAIL 284

DISPLAY_ERRORerror code 355 Encrypt 310

Displaying 24-bit images 54 EOF 136, 228

Displaying Transparent Images 50 EOI 136, 228

DLL_NOT_LOADED error code 353 EOT 136, 228

DOC EOTU 136, 228

described 283 EPS

file type 295 described 284

367
Index: EPS_BITMAP – error code

file type 293 -18 353

EPS_BITMAP -19 353

file type 284, 294 -2 352

EPS_BITMAP_G4 -20 353

file type 284, 294 -21 353

EPS_BITMAP_LZW -22 353

file type 284, 294 -23 353

error code 360 -24 353

-1 352 -25 353

-10 352 -26 353

-100 355 -27 353

-101 355 -28 353

-102 355 -29 353

-103 355 -3 352

-104 355 -30 353

-105 355 -31 353

-106 355 -32 353

-11 352 -33 353

-12 352 -34 353

-13 353 -35 354

-14 353 -36 354

-15 353 -37 354

-16 353 -38 354

-17 353 -39 354

368
Index: error during conversion – error code

-4 352 BAD_HANDLE 353

-40 354 BAD_LICENSE_PRIMARY 354

-41 354 BAD_LICENSE_


SECONDARY 354
-42 354
BAD_RETURN 352
-43 354
BAD_STRING 352
-44 354
CAN_CREATE_FILE 352
-45 354
CANT_FIND_TWAIN_DLL 353
-46 354
COMPRESSION_NOT_
-47 354
SUPPORTED 353
-48 354
CORRUPTED_FILE 352
-5 352
DELETE_ERROR 355
-52 354
DISK_FULL 352
-53 354
DISK_READ_ERROR 352
-55 354
DISPLAY_ERROR 355
-56 355
DLL_NOT_LOADED 353
-57 355
ERROR_OPENING_
-6 352 SCANNER 353

-7 352 EVAL_TIMEOUT 353

-8 352 EXCEPTION_ERROR 354

-9 352 FEEDER_NOT_READY 353

1 355 FILE_NOT_FOUND 352

ACCESS_DENIED 354 FONT_FONT_PATH_FOLDER_

AUTOFEED_FAILED 353 IS_EMPTY 354

BAD_DISPLAY_AREA 352

369
Index: error during conversion – error code

FONT_PATH_FOLDER_ METHOD_NOT_FOUND 354


MISSING_FONTS 355
NO_ABIC_VERSION 354
FONT_PATH_FOLDER_NOT_
NO_BITMAP_FOUND 352
FOUND 354
NO_CLIPBOARD_IMAGE 353
FONT_PATH_FOLDER_TOO_
FEW_FONTS 355 NO_DELAY_TIME_FOUND 353

FORMAT_NOT_ALLOWED 352 NO_FAST_TWAIN_


SUPPORTED 354
FORMAT_WILL_NOT_
OTFLY 353 NO_JPEG2000_VERSION 354

GENERAL_ NO_LZW_VERSION 353

STATUS.DEFAULT 355 NO_MORE_PAGES 353

GENERAL_STATUS.DELETE_ NO_PCL_VERSION 354


ERROR 355
NO_PDF_VERSION 354
GENERAL_STATUS.DISPLAY_
NO_SCANNER_FOUND 353
ERROR 355
NO_TCOLOR_FOUND 353
GENERAL_STATUS.IMAGE_
NOT_AVAILABLE 355 NO_VECTOR_CAPABILITY 354

GENERAL_STATUS.NET_ NO_WORD_VERSION 354


VALID 355
NOT_A_TILED_IMAGE 353
GENERAL_
NOT_SUPPORTED_IN_THIS_
STATUS.SNOWBND_API_
VERSION 353
NOT_AVAILABLE 355
NOT_VALID 356
GENERAL_
STATUS.SNOWBND_ OOXML_LICENSE_
OK 355 EXPIRED 354

GENERAL_STATUS.SYSTEM_ OOXML_LICENSE_NOT_
CRASH 355 FOUND 354

IMAGE_NOT_AVAILABLE 355 OUT_OF_MEMORY 352

370
Index: error during conversion – file type

PAGE_NOT_FOUND 352 EXCEL

PALETTE_IMAGE_NOT_ file type 295


ALLOWED 353
EXCEPTION_ERROR error code 354
PASSWORD_PROTECTED_
FILE 354 F

PASSWORD_PROTECTED_ FEEDER_NOT_READY error

PDF 354 code 353

PDF_PACKAGE_NOT_ file formats

SUPPORTED 354 automatically detecting 57

PIXEL_DEPTH_ file type


UNSUPPORTE 353
AFP 294
SEARCH_STRING_NOT_
ASCII 294
FOUND 354
BMP_COMPRESSED 293
SNOWBND_API_NOT 356
BMP_UNCOMPRESSED 293
SNOWBND_OK 356
BROOK_TROUT 293
SYSTEM_CRASH 356
CALS 293
TIFF_TAG_NOT_FOUND 353
CCITT_G3 294
USER_CANCEL 353
CCITT_G3_FO 294
USING_RUNTIME 353
CCITT_G4 294
error during conversion 59
CCITT_G4_FO 294
ERROR_OPENING_SCANNER error
code 353 CFF 295

EVAL_TIMEOUT error code 353 CIFF 295

evaluation version CIMS 295

installing 297 CLIP 283, 293

Excel 235, 361 COD 283, 294

371
Index: file type constants – Excel

CUT 283, 294 IOCA 293

DCS 283, 294 JBIG 294

DCX 293 JBIG2 295

DIB 294 JEDMICS 294

DICOM 294 JPEG 293

DOC 295 JPEG2000 294

DOCX 295 KOFAX 285, 293

DWG 284, 295 LASER_DATA 285, 293

DXF 284, 295 LINE_DATA 286, 295

EPS 293 MACPAINT 286, 293

EPS_BITMAP 284, 294 MAG 286, 294

EPS_BITMAP_G4 284, 294 MSG 295

EPS_BITMAP_LZW 284, 294 MSP 286, 293

EXCEL 295 NCR 294

FILENET 295 ODF 295

FLASHPIX 284, 294 ODP 295

GIF 293 ODS 295

GIF_INTERLACED 294 ODT 295

GX2 284, 293 OOXML 295

HTML 295 PCL_1 294

ICONTYPE 285, 293 PCL_5 295

IFF_ILBM 285, 293 PCX 293

IMG 285, 293 PDF 294

IMNET 294 PDF_15 295

372
Index: file type constants – FILENET

PDF_16 295 TIFF_LZW 291, 293

PDF_LZW 295 TIFF_PACK 292-293

PHOTOCD 289, 294 TIFF_UNCOMPRESSED 293

PHOTOSHOP 289, 294 WBMP 292, 294

PICT 289, 293 WINFAX 292, 294

PNG 294 WMF 292-293

POWER_POINT 295 WPG 292-293

PPTX 295 XBM 292-293

RAST 290, 294 Xerox_EPS 292, 294

RTF 295 XLS 292

SCITEX 290, 294 XLSX 292, 295

TARGA 290, 293 XPM 292, 294

TARGA16 290, 294 XWD 293-294

TIF_G4_FAX_STRIP 291, 294 file type constants

TIF_HUFFMAN 291, 293 PDF_15 287

TIFF_2D 290, 293 PDF_16 288

TIFF_ABIC 291, 294 FILE_NOT_FOUND error code 352

TIFF_ABIC_BW 291, 294 filename

TIFF_G3_FAX 291, 293 OOXML license file 178-179

TIFF_G4_FAX 291, 293 filename extension 360

TIFF_G4_FAX_FO 291, 294 FileNet

TIFF_JBIG 294 defined 284

TIFF_JPEG 291, 294 FILENET

TIFF_JPEG7 291, 294 file type 295

373
Index: files – GlobalLock()

files GENERAL_STATUS.DISPLAY_
ERROR error code 355
redistributed 297
GENERAL_STATUS.IMAGE_NOT_
filters.h 303
AVAILABLE error code 355
Fit 311
GENERAL_STATUS.NOT_VALID
FLASHPIX error code 355

file type 284, 294 GENERAL_STATUS.SNOWBND_

Font Mapping Data 234 API_NOT_AVAILABLE error


code 355
FONT_FONT_PATH_FOLDER_IS_
EMPTY error code 354 GENERAL_STATUS.SNOWBND_
ERROR 355
FONT_PATH_FOLDER_MISSING_
FONTS error code 355 GENERAL_STATUS.SNOWBND_
OK error code 355
FONT_PATH_FOLDER_NOT_
FOUND error code 354 GENERAL_STATUS.SYSTEM_
CRASH error code 355
FONT_PATH_FOLDER_TOO_FEW_
FONTS error code 355 get

Format Conversion 38, 311 location of OOXML license file 178

FORMAT_NOT_ALLOWED error get_dib_data_Callback 148

code 352 GIF

FORMAT_WILL_NOT_OTFLY error described 284


code 353
file type 293

G GIF_INTERLACED

General Status Error 355 described 284

GENERAL_STATUS.DEFAULT error file type 294


code 355
GlobalAlloc() 143
GENERAL_STATUS.DELETE_
GlobalLock() 143
ERROR error code 355

374
Index: GX2 – IMG_autocrop_bitmap

GX2 HTML Functions 167

file type 284, 293 HtmlHelper.dll 303

GXand 105 htmlplg.dll 303

GXandInverted 105
I
GXandReverse 105
ICONTYPE
GXclear 105
file type 285, 293
GXcopy 105
icudt38.dll 303
GXcopyInverted 105
IFF_ILBM
GXequiv 105
file type 285, 293
GXinvert 105
image
GXnoop 105
return orientation 181
GXor 105
rotate 181
GXorInverted 105
Image Compression 56
GXorReverse 105
Image File Directories (IFDs) 320
GXxor 105
Image Processing Functions 188

H IMAGE_NOT_AVAILABLE error
code 355
halftone
IMG
remove 185
file type 285, 293
hole punch
IMG_animate 60
remove 186
IMG_apply_profile 188
HTML
IMG_auto_orient 61
described 284
IMG_auto_orient Function 181
file type 294-295
IMG_autocrop_bitmap 60

375
Index: IMG_bayer_color – IMG_get_bitmap_palette

IMG_bayer_color 215 IMG_deskew_bitmap 190

IMG_bayer_mono 215 IMG_deskew_bitmap Function 181

IMG_bitmap_info 62 IMG_despeckle_bitmap 191

IMG_bitmap_palette 63 IMG_despeckle_bitmap Function 182

IMG_cmyk_to_rgb 189 IMG_dib_to_ddb 76

IMG_color_combine 65 IMG_dib_to_GWorld 247

IMG_color_gray 66 IMG_dib_to_GWorld_bitdepth 247

IMG_color_separate 65 IMG_dib_to_runs 217

IMG_create_handle 66 IMG_diffusion_color 217

IMG_create_handle_ddb 100 IMG_diffusion_mono 218

IMG_create_handle_keep 67 IMG_display_bitmap 77

IMG_create_handle_shell 68 IMG_display_bitmap_aspect 78

IMG_create_thumbnail 189 IMG_display_bitmap_dti 79

IMG_decompress_bitmap 68 IMG_display_bitmap_iac 80

IMG_decompress_bitmap IMG_display_bitmap_transp 81
(java.awt.Image, int) 235, 361
IMG_display_ddb 82
IMG_decompress_bitmap_display 69
IMG_display_ddb_effect 100
IMG_decompress_bitmap_fd 70
IMG_display_fit_to_height 192
IMG_decompress_bitmap_mem 71
IMG_display_fit_to_width 192
IMG_decompress_bitmap_page 72
IMG_erase_rect 82
IMG_decompress_fax_mem 73
IMG_ERR.h 303
IMG_decompress_tiled_bitmap 74
IMG_flip_bitmapx 193
IMG_delete_bitmap 75
IMG_flip_bitmapy 194
IMG_delete_bitmap_keep 76
IMG_get_bitmap_palette 101

376
Index: IMG_get_croprect – IMG_scan_acquire_feeder_fast

IMG_get_croprect 102 IMG_print_bitmap_fast 85

IMG_get_deskew_angle 195 IMG_process_bitmap 197

IMG_get_profile 196 IMG_promote_24 108

IMG_global_get_Xdisplay 239 IMG_promote_32 109

IMG_global_get_Xscreen 240 IMG_promote_8 108

IMG_global_set_Xdisplay 239 IMG_RECT 126

IMG_global_set_Xreserved_ IMG_remove_red_eye 85
colors 241
IMG_repaint_scroll 249
IMG_global_set_Xscreen 240
IMG_resize_bitmap 198
IMG_GWorld_to_dib 248
IMG_resize_bitmap_bicubic 199
IMG_halftone_mono 219
IMG_resize_bitmap_interp 200
IMG_histogram_equalize 196
IMG_resize_to_gray 201
IMG_ifl_version 103
IMG_rgb_to_cmyk 201
IMG_ifl_version_ext 103
IMG_rotate_bitmap 202
IMG_import_ascii 126
IMG_runs_to_dib 222
IMG_init_lib 83
IMG_save_bitmap 86
IMG_invert_bitmap 197
IMG_save_bitmap_fd 87
IMG_mediancut_color 219
IMG_save_bitmap_mem 88
IMG_merge_bitmap 104
IMG_save_document 229
IMG_merge_bitmap_alpha 106
IMG_save_document_mem 233
IMG_merge_bitmap_handle 107
IMG_save_mem 89
IMG_octree_color 220
IMG_scan_acquire 92
IMG_popularity_color 221
IMG_scan_acquire_feeder 93
IMG_print_bitmap 84
IMG_scan_acquire_feeder_fast 94

377
Index: IMG_scan_feeder_close – IMGLOW_get_filetype_mem

IMG_scan_feeder_close 94 IMGLOW_auto_invert Function 183

IMG_scan_get_cap 97 IMGLOW_autocolor 129

IMG_scan_open_source 95 IMGLOW_decompress_bitmap 129

IMG_scan_pages 95 IMGLOW_decompress_bitmap_
mem 131
IMG_scan_pages_fast 96
IMGLOW_detect_blank_page Func-
IMG_scan_set_cap 97
tion 184
IMG_scan_setup 98
IMGLOW_detect_color 133, 235, 361
IMG_scroll_bitmap 242
IMGLOW_extract_text 134
IMG_set_croprect 112
IMGLOW_extract_text_mem 136, 229
IMG_set_croprect_scroll 251
IMGLOW_get_anim_delay 137
IMG_set_display_angle 114
IMGLOW_get_ascii_attributes 127
IMG_set_encrypt 90
IMGLOW_get_ascii_page 127
IMG_set_gamma 203
IMGLOW_get_auto_detect 206
IMG_set_lut 204
IMGLOW_get_bitmap_header 137
IMG_set_statusbar 115
IMGLOW_get_bitmap_name 138
IMG_sharpen_bitmap 204
IMGLOW_get_custstring 138
IMG_thresh_mono 222
IMGLOW_get_display_rect 139
IMG_unload_lib 90
IMGLOW_get_fileinfo 119
IMG_unload_plugins 91
IMGLOW_get_fileinfo_fd 206
IMG_window_level 205
IMGLOW_get_fileinfo_page 120
IMG_zoom_bitmap 243
IMGLOW_get_filetype 139
IMG_zoom_bitmap_1_to_1 244
IMGLOW_get_filetype_fd 140
IMG_zoom_bitmap_rect 245
IMGLOW_get_filetype_mem 223
Imglib.h 303

378
Index: IMGLOW_get_image_orientation – IMGLOW_set_document_page_size

IMGLOW_get_image_orientation 141 IMGLOW_remove_halftone


Function 185
IMGLOW_get_image_orientation_
page 141 IMGLOW_remove_holepunch Func-
tion 186
IMGLOW_get_ooxml_license_location
Function 178 IMGLOW_save_bitmap 147

IMGLOW_get_pages 142 IMGLOW_save_bitmap_mem 149

IMGLOW_get_pages_fd 142 IMGLOW_search_text 150

IMGLOW_get_pages_mem 143 IMGLOW_set_alias_img 152

IMGLOW_get_palette 207 IMGLOW_set_alias_quality 225

IMGLOW_get_raster 223 IMGLOW_set_ascii_attributes 128

IMGLOW_get_tiff_tag 143, 320 IMGLOW_set_auto_detect 209

IMGLOW_get_tiff_tag_page 144 IMGLOW_set_bitmap_name 153

IMGLOW_get_tiff_tag_page_mem() IMGLOW_set_cad_background 165


145
IMGLOW_set_cad_input 165
IMGLOW_get_tile_info 145
IMGLOW_set_cad_size 166
IMGLOW_get_transp_color 146
IMGLOW_set_comp_quality 153
IMGLOW_is_tiled_image 147
IMGLOW_set_decomp_rect 210
IMGLOW_map_image_to_wnd 118
IMGLOW_set_decomp_reduction 210
IMGLOW_map_wnd_to_image 118
IMGLOW_set_decompsize 209
IMGLOW_ooxml_license_enable()
IMGLOW_set_dispfunc 154
176
IMGLOW_set_dithermode 211
IMGLOW_put_palette 208
IMGLOW_set_document_input 154,
IMGLOW_put_raster 224
235, 361
IMGLOW_read_pixel 208
IMGLOW_set_document_page_
size 155

379
Index: IMGLOW_set_fast_convert – IMGLOW_set_tiff_tag

IMGLOW_set_fast_convert 212 IMGLOW_set_jpeg2000_comp_


ratio 157
IMGLOW_set_fileinfo 119
IMGLOW_set_jpeg2000_comp_ratio
IMGLOW_set_fileio 122
Function 179
IMGLOW_set_fontmap 236
IMGLOW_set_jpg_interleave 158
IMGLOW_set_fontmap_path 235
IMGLOW_set_msg_render_pref-
IMGLOW_set_html_capabilities 167 erences 158

IMGLOW_set_html_home_dir 168 IMGLOW_set_ooxml_license() 176

IMGLOW_set_html_image_ IMGLOW_set_ooxml_license_file-
capability 168 name Function 178

IMGLOW_set_html_input 169 IMGLOW_set_ooxml_license_file-

IMGLOW_set_html_javascript_cap- nameW Function 179

ability 169 IMGLOW_set_ooxml_license_path

IMGLOW_set_html_page_size 170 Function 179

IMGLOW_set_html_page_size_ IMGLOW_set_ooxml_license_pathW

ratio 171 Function 180

IMGLOW_set_html_page_size_ratio_ IMGLOW_set_overlay_path 159

capability 171 IMGLOW_set_pcl_input 213

IMGLOW_set_html_screen_dpi 172 IMGLOW_set_pdf_input 159

IMGLOW_set_html_use_page_ IMGLOW_set_pdf_output 160


breaks_exclusively 172
IMGLOW_set_pdf_password 161
IMGLOW_set_html_utf_bom 173
IMGLOW_set_pdfa_font_map 237
IMGLOW_set_image_orientation 156
IMGLOW_set_pdfa_font_path 237
IMGLOW_set_imnet_page_size 213
IMGLOW_set_rop 120
IMGLOW_set_jpeg_
IMGLOW_set_tiff_save_strips 161
decompression 157
IMGLOW_set_tiff_tag 162, 320

380
Index: IMGLOW_set_transp_color – KOFAX

IMGLOW_set_transp_color 163
J
IMGLOW_set_wipedelay 122
jb2plug.dll 303
IMGLOW_unset_auto_detect 214
JBIG
IMGLOW_write_tiff_stream 163
defined 285
IMNET
file type 294
described 285
JBIG2
file type 294
defined 285
input
file type 295
color page 235, 361
JEDMICS
input compatible with output 58
described 285
input quality 58
file type 294
Installation Process 296
jp2plug.dll 303
Installed Files 296
JPEG
invert
described 285
color 183
file type 293
IOCA
JPEG2000
described 285
defined 285
file type 293
file type 294
isImageEnabled 167
K
isJavascriptEnabled 167
KOFAX
isPageBreaksExclusive 167
file type 285, 293
isRatioEnabled 167

381
Index: large documents – NCR

MO
L
DCA 235, 361
large documents
MODCA
printing 49
defined 286
LASER_DATA
MODCA resource
file type 285, 293
not displayed 360
LINE_DATA
MODCA troubleshooting
file type 286, 295
overlay 360
Load 312
MS-Windows DIB 255
location
MS_Windows DIB Header
OOXML license file 178
Format 255
lossy compression 59
MS_Windows DIB Image Data
low output quality 58 Format 255

MSG
M

Macintosh High Level Functions 247 file type 295

MACPAINT MSP

file type 286, 293 file type 286, 293

MAG Multi-page Page Count 45

file type 286, 294 Determining 45

METHOD_NOT_FOUND error Multi-page Splitting and Saving 314

code 354
N
MFC_Sample 312
NCR
MFC_TextSearch_TextExtract_
defined 286
Sample 313
file type 294

382
Index: NO_ABIC_VERSION error code – OOXML license file

NO_ABIC_VERSION error code 354 NOT_VALID error code 356

NO_BITMAP_FOUND error code 352 Nt_glue.h 303

NO_CLIPBOARD_IMAGE error
O
code 353
ODF
NO_DELAY_TIME_FOUND error
code 353 defined 286

NO_FAST_TWAIN_SUPPORTED file type 295

error code 354 ODP

NO_JPEG2000_VERSION error file type 295


code 354
ODS
NO_LZW_VERSION error code 353
defined 286
NO_MORE_PAGES error code 353
file type 295
NO_PCL_VERSION error code 354
ODT
NO_PDF_VERSION error code 354
defined 286
NO_SCANNER_FOUND error
file type 295
code 353
Office 235, 361
NO_TCOLOR_FOUND error
code 353 OOXML

NO_VECTOR_CAPABILITY error defined 286


code 354
file type 295
NO_WORD_VERSION error
OOXML files
code 354
set absolute path 179-180
Normal Printing 48
OOXML license file
NOT_A_TILED_IMAGE error
code 353 get location 178

NOT_SUPPORTED_IN_THIS_ set filename 178-179


VERSION error code 353

383
Index: OOXML_LICENSE_EXPIRED error code – PDF_16

OOXML_LICENSE_EXPIRED error path


code 354
OOXML files 179-180
OOXML_LICENSE_NOT_FOUND
PCL
error code 354
defined 286
ooxmlplug.dll 303
PCL_1 286
orientation
file type 294
image 181
PCL_5
OUT_OF_MEMORY error code 352
defined 286
output
file type 295
color page 235, 361
pclplug.dll 303
output quality
PCX 286
low 58
file type 293
overlay
PDF 360
AFP troubleshooting 360
defined 287
MODCA troubleshooting 360
file type 294
P
filter bit level support 281
Page 314
PDF File Formats 278
PAGE_NOT_FOUND error code 352
PDF v1.4 287-289
palette 58, 199-200, 247
PDF/A 287-289
PALETTE_IMAGES_NOT_
PDF_15
ALLOWED error code 353
file type 287, 295
PASSWORD_PROTECTED_FILE
error code 354 PDF_16

PASSWORD_PROTECTED_PDF file type 288, 295

error code 354

384
Index: PDF_LZW – remove

PDF_LZW 288 file type 295

file type 295 PowerPoint 235, 361

PDF_PACKAGE_NOT_ PPTX
SUPPORTED error code 354
described 290
pdfplug.dll 303
file type 295
performance
Print 315
improving 359
Printing
PHOTOCD
large documents 49
file type 289, 294
Printing Images 48
PHOTOSHOP
production version
file type 289, 294
installing 297
PICT
R
file type 289, 293
RAST
pixel depth 58
file type 290, 294
PIXEL_DEPTH_
UNSUPPORTED 58, 281 RasterMaster

PIXEL_DEPTH_UNSUPPORTED version

error code 353 get 103

pixels RasterMaster Annotation Toolkit 258

percentage 184 Read/Write Capabilities 281

PNG redistributed Snowbound files 297

described 290 remove

file type 294 halftone 185

POWER_POINT hole punch 186

described 290

385
Index: resolution – Saving Transparent Images

resolution 57 SANN_get_object_bounds 267

return SANN_get_object_data 267

orientation of image 181 SANN_get_object_info 267

rotate SANN_get_object_num 268

image 181 SANN_highlight_object 268

RTF SANN_map_image_to_wnd 269

described 290 SANN_map_wnd_to_image 269

file type 295 SANN_merge_ann 270

SANN_mouse 270
S
SANN_move_object 271
SANN_activate_all_objects 260
SANN_print_annotations 271
SANN_add_object 261
SANN_read_ann 272
SANN_choose_color 261
SANN_resize_object 272
SANN_choose_font 262
SANN_rotate 272
SANN_choose_line_style 262
SANN_set_bcolor 273
SANN_choose_line_width 262
SANN_set_croprect 273
SANN_create_ann 263
SANN_set_delete_flag 274
SANN_deactivate_all_objects 263
SANN_set_fcolor 274
SANN_deactivate_object 264
SANN_set_font 275
SANN_delete_all_objects 264
SANN_set_line_style 275
SANN_delete_object 264
SANN_set_line_width 276
SANN_display_annotations 265
SANN_set_size 276
SANN_draw_object 266
SANN_write_ann 276
SANN_get_croprect 266
Saving Transparent Images 50

386
Index: Scan – TIFF_G4_FAX

Scan 316 SYSTEM_CRASH error code 356

SCITEX
T
file type 290, 294
tag specifications 320
SEARCH_STRING_NOT_FOUND
Tags 317
error code 354
TARGA
set
file type 290, 293
absolute path for OOXML files 179-
180 TARGA16

filename of OOXML license file type 290, 294

file 178-179 third party viewers 361

Snbd_map.fnt file 234 TIFF

Snbdan32.dll 303 read tag 320

snbdan32.lib 303 TIFF tags 320

snbdcm.dll 303 TIFF_2D

sndbcm.lib 304 file type 290, 293

SNOWBND_API_NOT error code 356 TIFF_ABIC

SNOWBND_OK error code 356 file type 291, 294

Snowbound ASCII 124 TIFF_ABIC_BW

Snowbound Error Codes 352 file type 291, 294

SnowboundDllLocations.exe 304 TIFF_G3_FAX

SOF 136, 228 file type 291, 293

SOI 136, 228 TIFF_G4_FAX

SOT 136, 228 file type 291, 293

SOTU 136, 228

Supported Multi-page Functions 45

387
Index: TIFF_G4_FAX_FO – VectorExtract

TIFF_G4_FAX_FO troubleshooting 357

file type 291, 294 corrupted file error 360

TIFF_G4_FAX_STRIP error code 357

file type 291, 294 improving performance 359

TIFF_HUFFMAN larger file size 357

file type 291, 293 lower quality 358

TIFF_JBIG missing characters 359

file type 294 output differs 357

TIFF_JPEG 361 overlay resources 360

file type 291, 294 third party viewers 361

TIFF_JPEG7 TIFF_JPEG 361

file type 291, 294 unknown file format 360

TIFF_LZW
U
file type 291, 293
USER_CANCEL error code 353
TIFF_PACK
USING_RUNTIME error code 353
file type 292-293
UTF-16 292
TIFF_TAG_NOT_FOUND error
UTF-8 292
code 353

TIFF_UNCOMPRESSED V

described 292 variables

file type 293 IMG_auto_orient 181

Transp 317 IMGLOW_set_ooxml_license_


path 179
Transparency Overview 50
VectorExtract 318

388
Index: version – XWindows-specific

version XWD

get 103 file type 293-294

filter bit level support 281


W
XWindows 239
WBMP
XWindows-specific 239
file type 292, 294

WINFAX

file type 292, 294

WMF

file type 292-293

Word 235, 361

WPG

file type 292-293

XBM

file type 292-293

Xerox_EPS

file type 292, 294

XLS 278

file type 292

XLSX

file type 292, 295

XPM

file type 292, 294

389

You might also like