A QisMLib extension to generate high-resolution monochrome bitmaps from CAD data
QisMRaster ExtensionQisMRaster C++ API (qismraster.h)QisMRasterFlagsImageFormatRasterModeOverlayModeGrayscale_modesQisMRasterImageVersion control (QisMRasterImage)Image_nameImage_bufferImage_size_bytesPolygon_countVertex_countRip_time_secWidth_px Height_pxExtents_llxExtents_llyExtents_urxExtents_uryInvertedGet_ditherGet_pixelsize_xGet_pixelsize_yDPI_xDPI_yGet_right_to_leftReportQisMRasterImageV2Get_bottom_to_topQisMRasterNotifyVersion control (QisMRasterNotify)On_qismraster_imageGet_qismraster_image_proc_error_msgQisMRasterNotifyV2Pre_qismraster_imageQisMRasterNotifyV3Rasterization_refreshQisMRasterSubSamplerVersion control (QisMRasterSubSampler)Get_last_error_msg (QisMRasterSubSampler)Write_to_diskGet_image (QisMRasterSubSampler)Detach_buffer (QisMRasterSubSampler)Destroy_subsampled_bufferQisMGrayscaleImageVersion control (QisMGrayscaleImage)Get_bufferGet_buffer_sizeGet_row_size_pxGet_row_size_bytesGet_row_countGet_sample_rateGet_bits_per_pxGet_dpi_xGet_dpi_yWrite_to_diskDetach_bufferQisMRasterParamsReset (QisMRasterParams)Version control (QisMRasterParams)Set_pixelsizeGet_pixelsize_xGet_pixelsize_ySet_invertGet_invertSet_ditherGet_ditherSet_right_to_leftGet_right_to_leftSet_est_polygon_buffer_countGet_est_polygon_buffer_countSet_pattern_recognitionGet_pattern_recognitionSet_image_formatGet_image_formatSet_num_threadsGet_num_threadsSet_raster_modeGet_raster_modeQisMRasterParamsV2Set_overlayGet_overlayQisMRasterParamsV3Set_bottom_to_topGet_bottom_to_topQisMRasterParamsV4QisMRasterParamsV5Enum CodeSet_paramGet_paramQisMRasterPolygonSetReset (QisMRasterPolygonSet)Version control (QisMRasterPolygonSet)Add_polygonConsolidateCountData_extentsQisMRasterPolygonSetV2Import_bstoreQisMRasterPolygonSetV3Iterator for QisMRasterPolygonSetCount_vGet_first Get_next End_iteratorNum_xy_pairsXY_pairsQisMRasterPolygonSetV4Reset (QisMRasterPolygonSet)Add_polygonAdd_frameQisMRasterizerVersion control (QisMRasterizer)Get_last_error_msg (QisMRasterizer)Get_last_error_code (QisMRasterizer)Rasterize_windowRasterize_window_synthesizedRasterize_polygon_setQisMRasterizerV2Preset_raster_viewRasterize_window_preset_viewOverlay_polygon_setQisMRasterizerV3Rasterize_window_paint_scratchQisMRasterPSInfo_pQisMRasterizerV4 Rasterize_px_windowCreate_paint_scratch_v2_specDestroy_paint_scratch_v2_specRasterize_window_paint_scratch_v2QisMRasterizerV5 Create_grayscaleDestroy_grayscaleDestroy_grayscale_bufferQisMRasterizerV6Subsample_2x2Destroy_subsamplerDestroy_subsampled_bufferQisMRasterizerV7New_imageOverlay_polygonOverlay_polygon_dbuOverlay_box_dbuSet_limit_extentsQisMRasterizerV8Overlay_ellipseOverlay_pathQisMRasterizerV9Set_refresh_notifyQisMRasterizerV10Overlay_box_dbu_offxOverlay_ellipse_dbuQisMRasterizerV11Overlay_ringDPI_to_pixelsizePixelsize_to_DPIFile_dbQisMFormatterVersion control (QisMFormatter)Get_last_error_msg (QisMFormatter)Get_last_error_code (QisMFormatter)Write_tiffWrite_bmpWrite_rawQisMFormatterV2 Write_vbmpQisMFormatterV3 Write_tif8QisMFormatterV4 Format_imageQisMRasterWriterVersion control (QisMRasterWriter)BoundaryBoundary_dbuQisMRasterSharedBufVersion control (QisMRasterSharedBuf)Get_data_extentsWrite_to_diskClear_bufferBytes_per_rowPx_per_rowPx_per_colBytes_totalBuffer_ptrQisMRasterVersion control (QisMRaster)Get_last_error_msg (QisMRaster)Get_last_error_code (QisMRaster)New_objectDelete_objectCreate_rasterizerDestroy_rasterizerCreate_formatterDestroy_formatterQisMRasterV2 Open_file_writerClose_file_writerQisMRasterV3 Rasterize_win_queue_mtQisMRasterV4 Rasterize_win_queue_mt_paint_scratch_v2RasterizeLargeDiskImageOptsRasterize_large_disk_imageRasterize_large_disk_image_paint_scratch_v2QisMRasterV5 WinQueueOpts Rasterize_win_queue_mt_extParentCreate_grayscale (QisMRaster)Destroy_grayscale (QisMRaster)Destroy_grayscale_bufferQisMRasterV6 Subsample_2x2Destroy_subsamplerDestroy_subsampled_bufferQisMRasterV7 Create_shared_bufferCreate_rasterizer_shared_bufferLayer Synthesis Spec. Artwork RAW FormatQisMRaster Commandsraster.create_rasterizerraster.destroy_rasterizerraster.create_paramsraster.destroy_paramsraster.windowraster.px_windowraster.polysraster.overlay_polysraster.synthesizedraster.create_pns_v2_specraster.destroy_pns_v2_specraster.window_pns_v2raster.format_imageraster.queue_mtraster.large_disk_imageraster.get_dpiraster.get_pixelsizeraster.compute_px_szraster.compute_buf_szraster.compute_tile_szraster.get_buffer_infoQisMRaster Licensing (API)QisMRaster Licensing (Script)QisMRaster Version Historyqismraster dl/so v1.25 01-2026qismraster dl/so v1.24 08-2025qismraster dl/so v1.23.6 05-2025qismraster dl/so v1.23.5 03-2025qismraster dl/so v1.23.4 05-2024qismraster dl/so v1.23.3 01-2024qismraster dl/so v1.23.2 01-2024qismraster dl/so v1.23.1 12-2023qismraster dl/so v1.23 10-2023qismraster dl/so v1.22 10-2023qismraster dl/so v1.21 08-2023qismraster dl/so v1.20 04-2023qismraster dl/so v1.18 05-2022qismraster dl/so v1.17 03-2022qismraster dl/so v1.16.1 09-2021qismraster dl/so v1.15 08-2021qismraster dl/so v1.14 03-2021qismraster dl/so v1.13 09-2020qismraster dl/so v1.12 07-2020qismraster dl/so v1.11 06-2020qismraster dl/so v1.10 02-2020qismraster dl/so v1.9 12-2019qismraster dl/so v1.8 12-2019qismraster dl/so v1.7 09-2019qismraster dl/so v1.6 05-2019qismraster dl/so v1.5 02-2019qismraster dl/so v1.4 01-2019qismraster dl/so v1.3 11-2018qismraster dl/so v1.2 10-2018qismraster dl/so v1.1 06-2018
All the flags (enumerated constants) associated with the QisMRaster API
xxxxxxxxxxstruct QisMRasterFlags { ... };Flags that represent an image file format on disk
IFF_BUF implies no formatting/writing to disk
IFF_TIFF implies TIF format with packbits compression
IFF_TIF8 implies extended TIF (Big TIF) format with packbits compression. See here
IFF_BMP implies a top down (max-y on top) uncompressed BMP file
IFF_VBMP implies a bottom up (min-y on top) uncompressed BMP file
IFF_RAW implies Artwork's RAW file format. See here for details
xxxxxxxxxxenum ImageFormat { IFF_BUF=0 ,IFF_TIFF=1 ,IFF_BMP=2 ,IFF_RAW=3 ,IFF_VBMP=4 ,IFF_TIF8=5 };Flags that represent how a polygon is rasterized
RMF_SOLID implies all the pixels on/inside the polygon edges are filled
RMF_OUTLINE implies only the pixels on the polygon edges are filled Overlapping polygons are NOT unionized. Therefore, interiors of polygons may be filled by edges of other overlapping polygons
xxxxxxxxxxenum RasterMode { RMF_SOLID=0 ,RMF_OUTLINE=1 };Polygon overlay mode (Paint = Foreground fill i.e white if inverted, black otherwise. Scratch = Background fill i.e black if inverted, white otherwise)
OMF_DITHER implies paint the polygons with the specified dither value
OMF_PAINT implies paint the polygons regardless of the dither value (same as dither = 1.0)
OMF_SCRATCH implies scratch the polygons regardless of the dither value (same as dither = 1.0)
xxxxxxxxxxenum OverlayMode { OMF_DITHER=1 ,OMF_PAINT=2 ,OMF_SCRATCH=3 };Supported gray scale modes
expressed as GSM_{sample_x}x{sample_y}_{bits_per_px}BPP
See Create_grayscale
| Grayscale Mode | Supported file format |
|---|---|
GSM_1x1_1BPP | ALL formats |
GSM_2x2_2BPP | BUF, TIF and TIF8 only |
GSM_2x2_4BPP | BUF, TIF, TIF8, BMP and VBMP |
GSM_2x2_8BPP | BUF, TIF, TIF8, BMP and VBMP |
GSM_4x4_4BPP | BUF, TIF, TIF8, BMP and VBMP |
GSM_4x4_8BPP | BUF, TIF, TIF8, BMP and VBMP |
GSM_8x8_8BPP | BUF, TIF, TIF8, BMP and VBMP |
xxxxxxxxxxenum Grayscale_modes { GSM_1x1_1BPP=0 ,GSM_2x2_2BPP ,GSM_2x2_4BPP ,GSM_2x2_8BPP ,GSM_4x4_4BPP ,GSM_4x4_8BPP ,GSM_8x8_8BPP };Interface to retrive information about a raster image
xxxxxxxxxxclass QisMRasterImage { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterImage_name(const int version) const = 0;virtual void* QisMRasterImage_cast(const int version) = 0;virtual const void* QisMRasterImage_cast(const int version) const = 0;virtual int QisMRasterImage_latest_version() const = 0;Get the name/path assigned to this image
xxxxxxxxxxvirtual const char* Image_name() const = 0;Get the address of the memory buffer that holds the raster image
xxxxxxxxxxvirtual const unsigned char* Image_buffer() const = 0;Get the size of the raster image buffer in bytes
xxxxxxxxxxvirtual long long Image_size_bytes() const = 0;Get the total number of polygons involved in generating this image
xxxxxxxxxxvirtual long long Polygon_count() const = 0;Get the total number of polygon vertices involved in generating this image
xxxxxxxxxxvirtual long long Vertex_count() const = 0;Get elapsed time for generating this image
xxxxxxxxxxvirtual double Rip_time_sec() const = 0;Get the width and height of the image in pixels
xxxxxxxxxxvirtual unsigned int Width_px() const = 0;virtual unsigned int Height_px() const = 0;Get the extents of the data (in file units) corresponding to this image
xxxxxxxxxxvirtual double Extents_llx() const = 0;virtual double Extents_lly() const = 0;virtual double Extents_urx() const = 0;virtual double Extents_ury() const = 0; Check if the image polarity is inverted (bits representing data are 0)
xxxxxxxxxxvirtual bool Inverted() const = 0;Get the dithering value (using 8x8 bayer matrix)
xxxxxxxxxxvirtual double Get_dither() const = 0;Get size of a pixel along X and Y axes in file units
xxxxxxxxxxvirtual double Get_pixelsize_x() const = 0;virtual double Get_pixelsize_y() const = 0;Get the image resolution along X and Y axes in dots-per-inch
xxxxxxxxxxvirtual double DPI_x() const = 0;virtual double DPI_y() const = 0;Check if the image was rasterized from right to left. If so, the minX of the data occurs on the RHS of the raster image
xxxxxxxxxxvirtual bool Get_right_to_left() const = 0;Get all of the information about this image as a pre-formatted string
xxxxxxxxxxvirtual const char* Report() const = 0;Extension for QisMRasterImage (version = 2)
xxxxxxxxxxclass QisMRasterImageV2: public QisMRasterImage { ... };Returns true if the min-y data appears at the top of the image
xxxxxxxxxxvirtual bool Get_bottom_to_top() const = 0;Interface to recieve raster images via a callback for certain multi-window rasterization operations
xxxxxxxxxxclass QisMRasterNotify { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterNotify_name() const = 0;virtual void* QisMRasterNotify_cast(const int version) = 0;virtual const void* QisMRasterNotify_cast(const int version) const = 0;virtual int QisMRasterNotify_latest_version() const = 0;Receive a raster image for a specified window
img is a handle to the newly generated image
thread_lock is a handle to a mutex specified by the calling application
This callback may be generated by multiple threads simultaneously. Please ensure proper protection of shared data during this callback
Return 0 to continue. Otherwise return an error code and set the error message made available to Get_qismraster_image_proc_error_msg
xxxxxxxxxxvirtual int On_qismraster_image( const QisMRasterImage* img, NsQisMLib::QisMThreadLock* thread_lock ) { return 0; }virtual const char* Get_qismraster_image_proc_error_msg() const { return ""; }Extension to QisMRasterNotify (version = 2)
xxxxxxxxxxclass QisMRasterNotifyV2: public QisMRasterNotify { ... };Signals that an image is about to be rasterized
img_name is the specified name of the image
lx .. uy is the region of interest
handle is the rasterizer assigned to perform rasterization
opts are the rasterization parameters applied
thread_lock is the mutex that was specified
Only applies to queue based multi-window rasterization functions *win_queue* of QisMRaster
xxxxxxxxxxvirtual void Pre_qismraster_image( const char* img_name, const double lx, const double ly, const double ux, const double uy, QisMRasterizer* handle, const QisMRasterParams* opts, NsQisMLib::QisMThreadLock* thread_lock ) { }Extension to QisMRasterNotify (version = 3)
xxxxxxxxxxclass QisMRasterNotifyV3: public QisMRasterNotify { ... };In the midst of rasterization, an opportunity for the application to --
Refresh the GUI
Check status of resources
Signal the terminatation of rasterization
Return 0 to continue the rasterization, non-zero code to terminate (the code will appear in the error message)
xxxxxxxxxxvirtual int Rasterization_refresh() { return 0; }Interface to a 2x2 down-sampled raster image
xxxxxxxxxxclass QisMRasterSubSampler { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterSubSampler_name(const int version) const = 0;virtual void* QisMRasterSubSampler_cast(const int version) = 0;virtual const void* QisMRasterSubSampler_cast(const int version) const = 0;virtual int QisMRasterSubSampler_latest_version() const = 0;Get error information for any of the sub-sampler operations
xxxxxxxxxxvirtual const char* Get_last_error_msg() const = 0;Write the sub-sampled image to disk in the specified file format
file_path is the base (dir + name) of the output file. Extension is added automatically based on the format
format is one of QisMRasterFlags::ImageFormat
thrnum is the number of threads to be used for formatting
Returns true on success. Otherwise call Get_last_error_msg for error information
xxxxxxxxxxvirtual bool Write_to_disk(const char* file_path, const int format, const int thrnum) = 0;Get the handle to the underlying sub-sampled image in a format usable with other QisMRaster operations
xxxxxxxxxxvirtual QisMRasterImage* Get_image() = 0;virtual const QisMRasterImage* Get_image() const = 0;Detach the underlying raster buffer from the sub-sampler object and take full ownership of it
The detached buffer MUST be eventually destroyed by the client since it's not managed by the sub-sampler object anymore
xxxxxxxxxxvirtual unsigned char* Detach_buffer(long long& img_sz_) = 0;virtual void Destroy_subsampled_buffer(unsigned char* buffer) = 0;Interface to work with a newly generated gray scale image
xxxxxxxxxxclass QisMGrayscaleImage { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMGrayscaleImage_name(const int version) const = 0;virtual void* QisMGrayscaleImage_cast(const int version) = 0;virtual const void* QisMGrayscaleImage_cast(const int version) const = 0;virtual int QisMGrayscaleImage_latest_version() const = 0;Get the image buffer
DO NOT destroy this buffer unless detached
xxxxxxxxxxvirtual unsigned char* Get_buffer() = 0; virtual const unsigned char* Get_buffer() const = 0;Get the image size in bytes
xxxxxxxxxxvirtual long long Get_buffer_size() const = 0;Get the row size in pixels
xxxxxxxxxxvirtual unsigned int Get_row_size_px() const = 0;Get the row size in bytes
xxxxxxxxxxvirtual unsigned int Get_row_size_bytes() const = 0;Get the no. rows
xxxxxxxxxxvirtual unsigned int Get_row_count() const = 0;Get the sampling rate (uniform in X and Y)
xxxxxxxxxxvirtual unsigned int Get_sample_rate() const = 0;Get the no. bits per pixel used to encode the gray value
xxxxxxxxxxvirtual unsigned int Get_bits_per_px() const = 0;Get the image dpi along X and Y
xxxxxxxxxxvirtual double Get_dpi_x() const = 0;virtual double Get_dpi_y() const = 0;Write the gray scale image as a formatted file on disk
base_path represents the {file_name} and {directory} for the output. Extension will be automatically added as follows:
TIF - .tif
TIF8 - .tif8
BMP - .bmp
VBMP - .bmp
format is one of the supported file formats. See QisMRasterFlags::ImageFormat
Also, see QisMRasterFlags::Grayscale_modes for understanding which formats support the specified gray scale mode
On success, returns true
xxxxxxxxxxvirtual bool Write_to_disk( const char* base_path, const int format, const int thrnum ) = 0;De-couple the image buffer for control and use elsewhere
The image buffer MUST be explicitly destroyed by calling Destroy_grayscale_buffer
xxxxxxxxxxvirtual unsigned char* Detach_buffer(long long& buf_sz) = 0;A data structure to specify various rasterization options
xxxxxxxxxxclass QisMRasterParams { ... };Reset the options to default values
xxxxxxxxxxvirtual void Reset() = 0;Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterParams_name(const int version) const = 0;virtual void* QisMRasterParams_cast(const int version) = 0;virtual const void* QisMRasterParams_cast(const int version) const = 0;virtual int QisMRasterParams_latest_version() const = 0;Set/Get image resolution in terms of size of a pixel in file units
Default: 1.0 file unit along X and Y
xxxxxxxxxxvirtual void Set_pixelsize(const double xSize, const double ySize) = 0;virtual double Get_pixelsize_x() const = 0;virtual double Get_pixelsize_y() const = 0;Set/Get image polarity. If true, data bits in the image are 0 and non-data bits are 1. Default: false
xxxxxxxxxxvirtual void Set_invert(const bool set = true) = 0;virtual bool Get_invert() const = 0;Set/Get dithering value (0.0 - 1.0) using a 8x8 bayer matrix
Default: 1.0.
A value of 1.0 will result in 1 pixel for every single data bit. A value of 0.0 will set all data bits to background
xxxxxxxxxxvirtual void Set_dither(const double value) = 0;virtual double Get_dither() const = 0;Set/Get the rasterization direction.
If true, rasterization occurs from right to left so that the minX of the data is found on the RHS of the image.
No change in the Y direction.
Default: false
xxxxxxxxxxvirtual void Set_right_to_left(const bool set = true) = 0;virtual bool Get_right_to_left() const = 0;Set/Get the estimated size of the polygon buffer.
As soon as the polygon buffer is full, it is rasterized and flushed before more any polygons are collected. This way, the polygon buffer can be pre-allocated for superior performance.
If the polygon buffer size is 0, each polygon is rasterized as it is received (on-the-fly). This makes the rasterization single threaded and may be suitable for small polygon sets.
Default: 1,000,000 vertices
xxxxxxxxxxvirtual void Set_est_polygon_buffer_count(const long long numVertices) = 0;virtual long long Get_est_polygon_buffer_count() const = 0;Enable/Disable pattern recognition.
If enabled, rasterization is optimized for cell references that repeat within the specified window.
This could save a lot of computations and therefore speed up the rasterization.
Default: Enabled (true)
xxxxxxxxxxvirtual void Set_pattern_recognition(const bool set = true) = 0;virtual bool Get_pattern_recognition() const = 0;Set/Get the image format (See QisMRasterFlags::ImageFormat)
xxxxxxxxxxvirtual void Set_image_format(const QisMRasterFlags::ImageFormat format) = 0;virtual QisMRasterFlags::ImageFormat Get_image_format() const = 0;Set/Get the number of threads to be used for rasterization.
If thrnum == 0, the optimal number of threads is automatically set based on the number of processors in the system.
If thrnum == 1, all polygons are rasterized on-the-fly (no buffering).
If thrnum > 1, polygons are collected in a buffer (upto Get_est_polygon_buffer_count) before being rasterized.
Default: 0 (Auto- compute)
xxxxxxxxxxvirtual void Set_num_threads(const int thrnum) = 0;virtual int Get_num_threads() const = 0;Set/Get raster mode. Default: QisMRasterFlags::RMF_SOLID
xxxxxxxxxxvirtual void Set_raster_mode(const QisMRasterFlags::RasterMode mode) = 0;virtual QisMRasterFlags::RasterMode Get_raster_mode() const = 0;Extension for QisMRasterParams (version = 2)
xxxxxxxxxxclass QisMRasterParamsV2: public QisMRasterParams { ... };Set/Get overlay mode.
If on, the new image is drawn on top of the previous image (only if the image size in bytes is the same as the previous one).
Otherwise, the image buffer is reset before the new image is rasterized.
Default: off
xxxxxxxxxxvirtual void Set_overlay(const bool onoff) = 0;virtual bool Get_overlay() const = 0;Extension for QisMRasterParams (version = 3)
xxxxxxxxxxclass QisMRasterParamsV3: public QisMRasterParamsV2 { ... };Set/Get the rasterization direction.
If true, rasterization occurs from bottom to top so that the minY of the data is found on the top row of the image.
No change in the X direction.
Default: false
xxxxxxxxxxvirtual void Set_bottom_to_top(const bool set) = 0;virtual bool Get_bottom_to_top() const = 0;Extension for QisMRasterParams (version = 4)
xxxxxxxxxxclass QisMRasterParamsV4: public QisMRasterParamsV3 { ... };Extension for QisMRasterParams (version = 5)
xxxxxxxxxxclass QisMRasterParamsV5: public QisMRasterParamsV4 { ... };Represents parameter types to be used with Set_param and Get_param
Determines the count and type(s) of arguments supplied to these methods to set/get the respective rasterization parameter
xxxxxxxxxxenum Code { /* Enable/Disable native rasterization of PATH data * In Set_param, MUST be followed by ONE `int` with value 1 (ON) or 0 (OFF) * In Get_param, MUST be followed by ONE address of `int` to get the ON (1) or OFF (0) value * Default : 0 (OFF) * If OFF, all PATHs are converted to boundaries before being rasterized */ RP_PATHS=1 /* Enable/Disable native rasterization of circles/ellipses (only for paint&scratch format) * In Set_param, MUST be followed by ONE `int` with value 1 (ON) or 0 (OFF) * In Get_param, MUST be followed by ONE address of `int` to get the ON (1) or OFF (0) value * Default : 0 (OFF) * If OFF, all PATHs are converted to boundaries before being rasterized */ ,RP_ELLIPSES /* Enable native rasterization of PATH data using a specific model. RP_PATHS must be 1 for this to take effect * When no model is specified or the specified model cannot be found, the default model is used * In Set_param, MUST be followed by ONE `const char*` which is the model name * In Get_param, MUST be followed by ONE address of `const char*` to get the model name * Default : 0 (OFF) * If OFF, all PATHs are converted to boundaries before being rasterized */ ,RP_PATH_MODEL};Set or Get value(s) for a particular rasterization parameter
code represents the parameter in question
... is a variable list of arguments, the exact count and types of which depend on the parameter in question
Returns true if the parameter was recognized and processed
xxxxxxxxxxvirtual bool Set_param(const int code, ...) = 0;virtual bool Get_param(const int code, ...) const = 0;A data structure to store a set of polygons
xxxxxxxxxxclass QisMRasterPolygonSet { ... };Clear the polygon set
xxxxxxxxxxvirtual void Reset() = 0;Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterPolygonSet_name(const int version) const = 0;virtual void* QisMRasterPolygonSet_cast(const int version) = 0;virtual const void* QisMRasterPolygonSet_cast(const int version) const = 0;virtual int QisMRasterPolygonSet_latest_version() const = 0;Add a polygon to the set
xy: An array of xy-coordinate pairs representing the closed polygon. It contains nv xy pairs or nv*2 integers. The co-ordinate values are in database units (DBU). 1 DBU = 1 file unit/grid e.g For a file with units as microns and grid of 1000/um (or 0.001 um), 1 DBU = 1000
nv: Number of xy pairs. e.g A closed rectangle has nv == 5 (Last point is identical to the first)
On success, returns true (the polygon is legal)
The polygons are assumed to have the same grid and units as the QisMFile used to initialize the rasterizer
xxxxxxxxxxvirtual bool Add_polygon(const int* xy, const int nv) = 0;Use this to free up unused memory after all the polygons have been added
xxxxxxxxxxvirtual void Consolidate() = 0;Get the number of polygons in the set
xxxxxxxxxxvirtual int Count() const = 0;Get the lower-left and upper-right co-ordinates of the extents of the data in this polygon set (in db units)
xxxxxxxxxxvirtual void Data_extents( double& llx, double& lly, double& urx, double& ury ) const = 0;Extension for QisMRasterPolygonSet (version = 2)
xxxxxxxxxxclass QisMRasterPolygonSetV2: public QisMRasterPolygonSet { ... };Add polygons from QisMBStore. Will append to the polygons already added.
Returns the number of polygons imported from the QisMBStore
xxxxxxxxxxvirtual int Import_bstore(const NsQisMLib::QisMBStore* polygons) = 0;Extension for QisMRasterPolygonSet (version = 3)
xxxxxxxxxxclass QisMRasterPolygonSetV3: public QisMRasterPolygonSetV2 { ... };Opaque pointer to a implementation specific iterator for traversing the polygon set
xxxxxxxxxxtypedef void* PolyIterator;Get the sum of vertices for all polygons in the set
xxxxxxxxxxvirtual long long Count_v() const = 0;Iterate through the polygons in the set
MUST start with Get_first followed by any number of Get_next
Each call, returns --
A non-null iterator handle if there are more polygons to be traversed
NULL if all polygons have been traversed
When NULL is returned, the iterator is automatically destroyed. No need to call End_iterator
End_iterator should ONLY be used when one needs to terminate the iteration abruptly before reaching the end
xxxxxxxxxxvirtual QisMRasterPolygonSetV3::PolyIterator Get_first() const = 0;virtual QisMRasterPolygonSetV3::PolyIterator Get_next( QisMRasterPolygonSetV3::PolyIterator itr ) const = 0;virtual void End_iterator( QisMRasterPolygonSetV3::PolyIterator itr ) const = 0;Get the number of vertices or array of x,y co-ordinates (in database units) for a specific polygon referenced by the specified iterator
xxxxxxxxxxvirtual int Num_xy_pairs( QisMRasterPolygonSetV3::PolyIterator itr ) const = 0;virtual const int* XY_pairs( QisMRasterPolygonSetV3::PolyIterator itr ) const = 0;Extension for QisMRasterPolygonSet (version = 4)
xxxxxxxxxxclass QisMRasterPolygonSetV4: public QisMRasterPolygonSetV3 { ... };Remove all polygons from the set
xxxxxxxxxxvirtual void Reset() = 0;Add a polygon (xy specified in db units) to the set
Returns false if any of the paramters are invalid (xy is NULL or nv < 4)
xxxxxxxxxxvirtual bool Add_polygon(const int* xy, const int nv) = 0;Add a frame to the polygon set
in_lx .. in_uy are the extents of the inner box in db units
w_left .. w_top is the width of the frame along the respective sides in db units
If not specified (<=0),
w_bottom and w_right are set to w_left
w_top is set to w_bottom
Returns false if any of the parameters are invalid
xxxxxxxxxxvirtual bool Add_frame( const int in_lx, int in_ly, int in_ux, int in_uy, const int w_left, int w_bottom = 0, int w_right = 0, int w_top = 0 ) = 0;Interface to an instance of the rasterizer
xxxxxxxxxxclass QisMRasterizer { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterizer_name(const int version) const = 0;virtual void* QisMRasterizer_cast(const int version) = 0;virtual const void* QisMRasterizer_cast(const int version) const = 0;virtual int QisMRasterizer_latest_version() const = 0;The information (error string and code) corresponding to the last error condition
xxxxxxxxxxvirtual const char* Get_last_error_msg() const = 0;virtual int Get_last_error_code() const = 0;Rasterize a single window using polygons belonging to one or more layers for a given cell
name: Name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
llx, lly, urx, ury: Lower-left and upper-right co-ordinates of the window to be rasterized (in file units)
params: Rasterization options
viewCell: Name of the cell to be rasterized. If NULL/empty, the deepest top cell in the file is used
layers: A string containing comma-separated list of layers or layer:datatypes to be rasterized. If NULL/empty, all layers will be used
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
For multiple windows, use this method in a loop. The image buffer will be automatically adjusted to match the image/window size
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_window( const char* name, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const char* viewCell, const char* layers ) = 0;Rasterize a single window using polygons created by performing various boolean operation on layers for a given cell
name: Name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
llx, lly, urx, ury: Lower-left and upper-right co-ordinates of the window to be rasterized (in file units)
params: Rasterization options
viewCell: Name of the cell to be rasterized. If NULL/empty, the deepest top cell in the file is used
synthSpec: Specification of boolean operations between layers. All target layers will be rasterized
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
For multiple windows, use this method in a loop. The image buffer will be automatically adjusted to match the image/window size
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_window_synthesized( const char* name, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const char* viewCell, const char* synthSpec ) = 0;Rasterize a pre-computed set of polygons specific to the client application
name: Name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
polygonSet: Pre-computed set of polygons to be rasterized
params: Rasterization options
rasterWindow: If not NULL, specify a window into the polygon set to be rasterized. If NULL, the overall extents of the polygon set will be used as the raster window
offsets, nOffsets: If not NULL/empty, specify a set of xy-coordinates at which the specified set of polygons repeat (as a whole). In this case, the polygon set is used as a pattern that repeats at one or more places. The reference origin of this pattern is assumed to be 0,0. If NULL/empty, the specified polygon set is rasterized as-is at their specified co-ordinates
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
For multiple windows, use this method in a loop. The image buffer will be automatically adjusted to match the image/window size
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_polygon_set( const char* name, const QisMRasterPolygonSet* polygonSet, const QisMRasterParams* params, const double* rasterWindow = 0, const double* offsets = 0, const int nOffsets = 0 ) = 0;Extension for QisMRasterizer (version = 2)
xxxxxxxxxxclass QisMRasterizerV2: public QisMRasterizer { ... };Set the view cell/layers before rasterization if a it's not going to change for many windows to come
viewCell: Name of the cell to be rasterized. If NULL/empty, the deepest top cell in the file is used
layers: A string containing comma-separated list of layers or layer:datatypes to be rasterized. If NULL/empty, all layers will be used
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
xxxxxxxxxxvirtual bool Preset_raster_view( const char* viewCell = 0, const char* layers = "ALL" ) = 0;Rasterize a window (assuming that the view cell/layers have already been set)
name: Name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
llx, lly, urx, ury: Lower-left and upper-right co-ordinates of the window to be rasterized (in file units)
params: Rasterization options
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
For multiple windows, use this method in a loop. The image buffer will be automatically adjusted to match the image/window size
If the cell was not set using Preset_raster_view, the default top cell will be used. If the layers were not set, ALL layers will be used. Otherwise the pre-set cell, layers will be used
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_window_preset_view( const char* name, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params ) = 0;Overlay the existing raster buffer with a set of polygons
original_image : The image to be used as a base for the overlay. The image MUST be generated using the same rasterizer object
polygonSet: Set of polygons to be overlayed
mode: Paint mode - dither, paint or scratch (One of QisMRasterFlags::OverlayMode)
offsets, nOffsets: If not NULL/empty, specify a set of xy-coordinates at which the specified set of polygons repeat (as a whole). In this case, the polygon set is used as a pattern that repeats at one or more places.
The reference origin of this pattern is assumed to be 0,0. If NULL/empty, the specified polygon set is rasterized as-is at their specified co-ordinates
Success: A non-NULL handle to the raster image
Failure: NULL. Call Get_last_error_msg() for more information about the error
Use this method to overlay a set of polygons on the existing raster image buffer
This method MUST only be used AFTER an initial image is generated using Rasterize_window, Rasterize_window_synthesized, Rasterize_polygon_set or Rasterize_window_preset_view using the SAME rasterizer
The raster settings applied for the overlay (threads, inversion, etc.) are same as the original raster job
This method can be used multiple times in succession once the original image is created
Only the data that crosses the original window extents will appear as overlay
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_polygon_set( const QisMRasterImage* original_image, const QisMRasterPolygonSet* polygonSet, const QisMRasterFlags::OverlayMode mode = QisMRasterFlags::OMF_DITHER, const double* offsets = 0, const int nOffsets = 0 ) = 0;Extension for QisMRasterizer (version = 3)
xxxxxxxxxxclass QisMRasterizerV3: public QisMRasterizerV2 { ... };Same as QisMRasterizerV4::Rasterize_window_paint_scratch_v2 with spec and layers set to NULL
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_window_paint_scratch( const char* name, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const char* viewCell, const char* spec ) = 0;Opaque handle that represents an instance of the paint & scratch (v2) spec.
xxxxxxxxxxtypedef void* QisMRasterPSInfo_p;Extension for QisMRasterizer (version = 4)
xxxxxxxxxxclass QisMRasterizerV4: public QisMRasterizerV3 { ... };Rasterize a window whose co-ordinates are specified in pixel space.
px_llx .. px_ury are the co-ordinates of the window in pixel space
width_bytes is the image width in bytes
height_px is the image height in pixels (or bytes)
params is a valid handle to the rasterization paramters
cell (if not empty) is the view cell name
layers (if not empty) is a comma-separated list of layers to be rasterized
On success, returns a non-null handle to an image. Otherwise call Get_last_error_msg for error information
pixel_coordinate = round(file_coordinate/pixelsize)
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_px_window( const char* name, const int px_llx, const int px_lly, const int width_bytes, const int height_px, const QisMRasterParams* params, const char* cell, const char* layers ) = 0;Create a paint & scratch specification (v2-cell based) for rasterizing paint & scratch data from a cell-based paint and scratch database
view_cell is the cell to be rasterized
pxsize_x, pxsize_y is the resolution in pixel-size (file units)
roi if specified is the window if interest
On success, returns a handle to the specification object. Otherwise, call Get_last_error_msg for error details
Every spec. created this way MUST be eventually destroyed using Destroy_paint_scratch_v2_spec to avoid memory leaks
xxxxxxxxxxvirtual QisMRasterPSInfo_p Create_paint_scratch_v2_spec( const char* view_cell, const double pxsize_x, const double pxsize_y, const NsQisMLib::QisMWindow* roi = 0 ) = 0;virtual void Destroy_paint_scratch_v2_spec(QisMRasterPSInfo_p handle) = 0;Rasterize a window of a paint and scratch (v2-cell based) database
name is the name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
llx, lly, urx, ury are the lower-left and upper-right co-ordinates of the window to be rasterized (in file units)
params Rasterization options
viewCell is the name of the cell to be rasterized. If NULL/empty, the deepest top cell in the file is used
spec is the paint & scratch spec. If not specified (null), this method computes the spec. itself
layers if specified (!=NULL and !=""), represents the layers to rasterize
On success, returns a non-null handle to the image
Failure: NULL. Call Get_last_error_msg() for more information about the error
For multiple windows, use this method in a loop. The image buffer will be automatically adjusted to match the image/window size
xxxxxxxxxxvirtual const QisMRasterImage* Rasterize_window_paint_scratch_v2( const char* name, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const char* viewCell, const QisMRasterPSInfo_p spec, const char* layers = 0 ) = 0;Extension for QisMRasterizer (version = 5)
xxxxxxxxxxclass QisMRasterizerV5: public QisMRasterizerV4 { ... };Convert a 1bpp monochome raster image to a gray scale image with choice of sampling rate and bits-per-px
img is a handle to a valid 1bpp raster image obtained via any of the QisMRaster operations
mode represents one of the supported gray scale modes. See QisMRasterFlags::Grayscale_modes
thrnum is the no. threads to be used for this operation
On success, returns a non-NULL handle to the newly created gray scale image in a separate memory buffer
Every gray scale image MUST be eventually destroyed by Destroy_grayscale to avoid resource leaks
xxxxxxxxxxvirtual QisMGrayscaleImage* Create_grayscale( const QisMRasterImage* img, const int mode, const int thrnum ) = 0;virtual void Destroy_grayscale(QisMGrayscaleImage* img) = 0;Destroy the image buffer that was de-coupled from the image object. See Detach_buffer
xxxxxxxxxxvirtual void Destroy_grayscale_buffer(unsigned char* buffer) = 0;Extension #6 to QisMRasterizer (version = 6)
xxxxxxxxxxclass QisMRasterizerV6: public QisMRasterizerV5 { ... };Downsize a raster image (halve the resolution on each side) using a recipe
name is the name of the new raster image
in is the handle to the source raster image to be downsized
recipe is used to control how a sample of 2x2 pixels is set/reset in the output buffer. See sub-sampling for details
recipe_sz is the size of this array (MUST be 16)
option followed by ... is a set of optional parameters. each parameter consists of an opt-code followed by the value for that parameter. the opt-code is one of QisMRasterSubSampler::Options. the type of the value depends on the opt-code. this set of parameters MUST end with a 0 or QisMRasterSubSampler::SSO_END
Returns a handle to the sub-sampled image object on success. Otherwise, call Get_error_msg for error information
This object MUST be eventually destroyed using Destroy_subsampler to avoid resource leaks
xxxxxxxxxxvirtual QisMRasterSubSampler* Subsample_2x2( const char* name, const QisMRasterImage* in, const unsigned char* recipe, const int recipe_sz, const int option, ... ) = 0;virtual void Destroy_subsampler(QisMRasterSubSampler* handle) = 0;Destroy the buffer detached from the subsampled image object
xxxxxxxxxxvirtual void Destroy_subsampled_buffer(unsigned char* buffer) = 0;Extension #7 to QisMRasterizer (version = 7)
xxxxxxxxxxclass QisMRasterizerV7: public QisMRasterizerV6 { ... };Start a new raster image
Previous image buffer will either be re-used or destroyed
name is to be associated with this new image
params specify the rasterization options
extents represent the window in data space to be rasterized
Returns a handle to the fresh clean image ready for rasteriztion
On error, returns NULL. Use Get_last_error_msg to get more information
xxxxxxxxxxvirtual QisMRasterImage* New_image( const char* name, const QisMRasterParams* params, const NsQisMLib::QisMWindow& extents ) = 0;Overlay one polygon represented by xy (user units) and nv to the existing image
mode determined how this polygon is rasterized
offsets and nOffsets represents repetition if not NULL and 0 respectively
If the polygon crosses the image extents, it will be clipped or dropped accordingly
Returns a handle to the fresh clean image ready for rasteriztion
On error, returns NULL. Use Get_last_error_msg to get more information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_polygon( const QisMRasterImage* original_image, const double* xy, const int nv, const QisMRasterFlags::OverlayMode mode, const double* offsets, const int nOffsets ) = 0;Overlay one polygon represented by xy (db units) and nv to the existing image
original_image is a handle to an existing image object
mode determines how this polygon is rasterized
offsets and nOffsets represents repetition if not NULL and 0 respectively
If the polygon crosses the image extents, it will be clipped or dropped accordingly
Returns a handle to the fresh clean image ready for rasteriztion
On error, returns NULL. Use Get_last_error_msg to get more information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_polygon_dbu( const QisMRasterImage* original_image, const int* xy_dbu, const int nv, const QisMRasterFlags::OverlayMode mode, const int* offsets_dbu, const int nOffsets ) = 0;Overlay one box specified in DBU to an existing image
original_image is a handle to an existing image object
lx..uy are the box extents in DBU
mode determines how this polygon is rasterized
If the polygon crosses the image extents, it will be clipped or dropped accordingly
Returns a handle to the fresh clean image ready for rasteriztion
On error, returns NULL. Use Get_last_error_msg to get more information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_box_dbu( const QisMRasterImage* original_image, const int lx, const int ly, const int ux, const int uy, const QisMRasterFlags::OverlayMode mode ) = 0;In solutions where multiple rasterizers work together on a shared buffer, limit the extents of this rasterizer to the tile/window assigned to it
This is necessary to both reduce the amount of redundant rasterization as well as avoid simultaneous access to parts of the buffer
Not required when each rasterizer has it's own image object (i.e the rasterizer was created without the use of a shared buffer)
exts are the window extents in user units
xxxxxxxxxxvirtual void Set_limit_extents(const NsQisMLib::QisMWindow& exts) = 0;Extension #8 to QisMRasterizer (version = 8)
xxxxxxxxxxclass QisMRasterizerV8: public QisMRasterizerV7 { ... };Overlay an ellipse in the current image buffer (original_image) which MUST be valid
xc, yc is the center of the ellipse in file (user) units
rx, ry are the radii along X and Y respectively also in file (user) units (has to be both > 0.0)
mode determines how the ellipse is rasterized
offsets and nOffsets represents repetition (in file units) if not NULL and 0 respectively
On success, returns a pointer to the same image object. On error, returns NULL. Use Get_last_error_msg to get error information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_ellipse( const QisMRasterImage* original_image, const double xc, const double yc, const double rx, const double ry, const QisMRasterFlags::OverlayMode mode, const double* offsets = 0, const int nOffsets = 0 ) = 0;Overlay an path in the current image buffer (original_image) which MUST be valid
width is the path width in file (user) units
round_cap is true if the path has round caps (both start and end)
start_x, end_x is the amount of extension (in file units) to be added at the start and end respectively. Positive values elongate the path in either directions. Negative values shrink the path
mode determines how the path is rasterized
offsets and nOffsets represents repetition (in file units) if not NULL and 0 respectively
On success, returns a pointer to the same image object. On error, returns NULL. Use Get_last_error_msg to get error information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_path( const QisMRasterImage* original_image, const double* xy, const int nv, const double width, const bool round_cap, const double start_x, const double end_x, const QisMRasterFlags::OverlayMode mode, const double* offsets = 0, const int nOffsets = 0 ) = 0;Extension #9 to QisMRasterizer (version = 9)
xxxxxxxxxxclass QisMRasterizerV9: public QisMRasterizerV8 { ... };Set the handler that will receive the refresh notification
NULL implies no such handler/no need for refresh notifications (which is also the default setting)
xxxxxxxxxxvirtual void Set_refresh_notify(QisMRasterNotifyV3* handler) = 0;Extension #10 to QisMRasterizer (version = 10)
xxxxxxxxxxclass QisMRasterizerV10: public QisMRasterizerV9 { ... };Overlay a box with repetitions in the the current buffer represented by original_image
lx..uy are the extents of the first box
mode determines how the boxes are rasterized
offsets_dbu and nOffsets represents repetition (in dbu) if not NULL and 0 respectively
On success, returns a pointer to the same image object. On error, returns NULL. Use Get_last_error_msg to get error information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_box_dbu_offx( const QisMRasterImage* original_image, const int lx, const int ly, const int ux, const int uy, const QisMRasterFlags::OverlayMode mode, const int* offsets_dbu, const int noffsets ) = 0;Overlay an ellipse (in dbu) in the the current buffer represented by original_image
xc_dbu and yc_dbu are the co-ordinates of the center point
rx_dbu and ry_dbu are the radii along X and Y
mode determines how the boxes are rasterized
offsets_dbu and nOffsets represents repetition (in dbu) if not NULL and 0 respectively
On success, returns a pointer to the same image object. On error, returns NULL. Use Get_last_error_msg to get error information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_ellipse_dbu( const QisMRasterImage* original_image, const int xc_dbu, const int yc_dbu, const int rx_dbu, const int ry_dbu, const QisMRasterFlags::OverlayMode mode, const int* offsets_dbu, const int nOffsets ) = 0;Extension #11 to QisMRasterizer (version = 11)
xxxxxxxxxxclass QisMRasterizerV11: public QisMRasterizerV10 { ... };Overlay a ring in the the current buffer represented by original_image
cx and cy are the co-ordinates of the center point
radius is the radius (>0.0) and width is the thickness (>0.0)
mode determines how the ring is rasterized
arcres and arcsag if specified are the arc resolution (degrees) and chord error (in user-units) to control the smoothness of the circle
offsets and nOffsets represents repetition if not NULL and 0 respectively
All values are in user-units
On success, returns a pointer to the same image object. On error, returns NULL. Use Get_last_error_msg to get error information
xxxxxxxxxxvirtual const QisMRasterImage* Overlay_ring( const QisMRasterImage* original_img, const double cx, const double cy, const double radius, const double width, const QisMRasterFlags::OverlayMode mode, const double arcres = 9.0, const double arcsag = 0.0, const double* offsets = 0, const int nOffsets = 0 ) = 0;Convenience methods to convert DPI (dots-per-inch) to size-of-a-pixel (user-units) and visa-versa
xxxxxxxxxxvirtual double DPI_to_pixelsize(const double dpi) const = 0;virtual double Pixelsize_to_DPI(const double pxs) const = 0;Returns a handle to the file database associated with this object
xxxxxxxxxxvirtual NsQisMLib::QisMFile* File_db() = 0;virtual const NsQisMLib::QisMFile* File_db() const = 0;Interface to an instance of the image formatter
xxxxxxxxxxclass QisMFormatter { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMFormatter_name(const int version) const = 0;virtual void* QisMFormatter_cast(const int version) = 0;virtual const void* QisMFormatter_cast(const int version) const = 0;virtual int QisMFormatter_latest_version() const = 0;The information (error string and code) corresponding to the last error condition
xxxxxxxxxxvirtual const char* Get_last_error_msg() const = 0;virtual int Get_last_error_code() const = 0;Write a raster image to a TIFF file with packbits compression
filePath: Path of the file to be created
pxWidth: Width of the image in pixels
imgSizeBytes: Size of the image in bytes
dpiX, dpiY: Image resolution in dots-per-inch
buffer: Address of the memory buffer where the image is held
numThreads: No. threads to be used for formatting the image
Success: true
Failure: false. Call Get_last_error_msg() for details
xxxxxxxxxxvirtual bool Write_tiff( const char* filePath, const int pxWidth, const unsigned long long imgSizeBytes, const double dpiX, const double dpiY, unsigned char* buffer, const int numThreads ) = 0;Write a raster image to an uncompressed BMP file
filePath: Path of the file to be created
pxWidth: Width of the image in pixels
imgSizeBytes: Size of the image in bytes
dpiX, dpiY: Image resolution in dots-per-inch
buffer: Address of the memory buffer where the image is held
numThreads: No. threads to be used for formatting the image
Success: true
Failure: false. Call Get_last_error_msg() for details
xxxxxxxxxxvirtual bool Write_bmp( const char* filePath, const int pxWidth, const unsigned long long imgSizeBytes, const double dpiX, const double dpiY, unsigned char* buffer, const int numThreads ) = 0;Write a raster image to a RAW file (See QisMRasterFlags::ImageFormat)
filePath: Path of the file to be created
pxWidth, pxHeight: Width, height of the image in pixels
imgSizeBytes: Size of the image in bytes
buffer: Address of the memory buffer where the image is held
Success: true
Failure: false. Call Get_last_error_msg() for details
xxxxxxxxxxvirtual bool Write_raw( const char* filePath, const int pxWidth, const int pxHeight, const unsigned long long imgSizeBytes, unsigned char* buffer ) = 0;Extension for QisMFormatterV2 (version = 2)
xxxxxxxxxxclass QisMFormatterV2: public QisMFormatter { ... };Write a raster image to an uncompressed BMP file with control on the Y direction (top-down/bottom-up)
filePath: Path of the file to be created
pxWidth: Width of the image in pixels
imgSizeBytes: Size of the image in bytes
dpiX, dpiY: Image resolution in dots-per-inch
buffer: Address of the memory buffer where the image is held
numThreads: No. threads to be used for formatting the image
towDown: If true, write the header to create a top-down BMP. Otherwise, bottom-up
Success: true
Failure: false. Call Get_last_error_msg for details
xxxxxxxxxxvirtual bool Write_vbmp( const char* filePath, const int pxWidth, const unsigned long long imgSizeBytes, const double dpiX, const double dpiY, unsigned char* buffer, const int numThreads, const bool topDown ) = 0;Extension for QisMFormatter (version = 3)
xxxxxxxxxxclass QisMFormatterV3: public QisMFormatterV2 { ... };Write a raster image to a (Big) TIFF file with packbits compression
filePath: Path of the file to be created
pxWidth: Width of the image in pixels
imgSizeBytes: Size of the image in bytes
dpiX, dpiY: Image resolution in dots-per-inch
buffer: Address of the memory buffer where the image is held
numThreads: No. threads to be used for formatting the image
Success: true
Failure: false. Call Get_last_error_msg() for details
xxxxxxxxxxvirtual bool Write_tif8( const char* filePath, const int pxWidth, const unsigned long long imgSizeBytes, const double dpiX, const double dpiY, unsigned char* buffer, const int numThreads ) = 0;Extension for QisMFormatter (version = 4)
xxxxxxxxxxclass QisMFormatterV4: public QisMFormatterV3 { ... };Format and write a monochrome raster image (via the image object) to disk
outbase is the base path (dir + filename) of the output file. The extension (.tif8, .tif, .bmp, .raw) is automatically added based on the specified format
numThreads is the no. threads to be used for the formatting (0 implies no. cpus)
Returns true on success. Otherwise call Get_last_error_msg for error string
xxxxxxxxxxvirtual bool Format_image( const QisMRasterImage* image, const char* outbase, const QisMRasterFlags::ImageFormat format, const int numThreads ) = 0;Interface to a TIFF/BMP/RAW file writer.
Unlike QisMFormatter, this API does both image composition (drawing) and formatting
Unlike QisMRasterizer, thecomposition of the image is split into a series of calls to QisMRasterWriter::Boundary rather than a single call to a method
NOT suitable for multi-threaded access at the moment
xxxxxxxxxxclass QisMRasterWriter { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterWriter_name(const int version) const = 0;virtual void* QisMRasterWriter_cast(const int version) = 0;virtual const void* QisMRasterWriter_cast(const int version) const = 0;virtual int QisMRasterWriter_latest_version() const = 0;Add a single boundary to the image being composed
nv : number of vertices of the closed polygon (e.g 5 for a rectangle)
xy : list of x,y co-ordinate pairs for each vertex of the closed boundary (sizeof(xy) = nv*2 doubles) xy[0] = xy[(nv*2)-2], xy[1] = xy[(nv*2)-1]
mode : draw mode PAINT (dither = 1.0), SCRATCH (dither = 0.0) or DITHER (as per specified -- QisMRasterParams::Get_dither. See QisMRasterFlags::OverlayMode
grid : to convert dbu to user units
Success: true
Failure: false. The polygon in question was skipped either because it was invalid or internal error
Once a file writer has been opened, use multiple calls to this method to compose the image one polygon at a time
NOT suitable for multi-threaded access
xxxxxxxxxxvirtual bool Boundary( const double* xy, const int nv, const QisMRasterFlags::OverlayMode mode ) = 0;virtual bool Boundary_dbu( const int* xy, const int nv, const QisMRasterFlags::OverlayMode mode, const double grid ) = 0;Represents an image buffer shared between multiple rasterizers
xxxxxxxxxxclass QisMRasterSharedBuf { .. };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRasterSharedBuf_name(const int version) const = 0;virtual void* QisMRasterSharedBuf_cast(const int version) = 0;virtual const void* QisMRasterSharedBuf_cast(const int version) const = 0;virtual int QisMRasterSharedBuf_latest_version() const = 0;Get the extents of this image in data space (that was used to create this buffer)
xxxxxxxxxxvirtual bool Get_data_extents(double* lx, double* ly, double* ux, double* uy) const = 0;virtual bool Get_img_extents(int* lx, int* ly, int* ux, int* uy) const = 0;virtual const QisMRasterParams* Get_params() const = 0;Write the buffer to disk at file_path in the format of choice
dpix and dpiy represents the resolution at the image was rasterized
thrnum is the no. threads to use for rasterization
Returns true on success
xxxxxxxxxxvirtual bool Write_to_disk( const char* file_path, const int format, const double dpix, const double dpiy, const int thrnum ) = 0;Wipe the buffer clean (0's or 1's)
xxxxxxxxxxvirtual void Clear_buffer( const int nt, const bool invert, const int start_row = 0, const int n_rows = 0 ) = 0;Get the image row size (width) in bytes
Get the image row size (width) in pixels
Get the image column size (height) in pixels
Get the image size in bytes
Get a pointer to the underlying image buffer (do not destroy this buffer directly)
xxxxxxxxxxvirtual int Bytes_per_row() const = 0;virtual int Px_per_row() const = 0;virtual int Px_per_col() const = 0;virtual long long Bytes_total() const = 0;virtual const unsigned char* Buffer_ptr() const = 0;Interface to the QisMRaster Extension for QisMLib
xxxxxxxxxxclass QisMRaster: public NsQisMLib::QisMExtensionAPI { ... };Cast this pointer to any other version (base/derived)
The version number is embedded in the class name in form of a suffix V<number>
Get the latest version number supported by this implementation
xxxxxxxxxxvirtual const char* QisMRaster_name(const int version) const = 0;virtual void* QisMRaster_cast(const int version) = 0;virtual const void* QisMRaster_cast(const int version) const = 0;virtual int QisMRaster_latest_version() const = 0;The information (error string and code) corresponding to the last error condition
xxxxxxxxxxvirtual const char* Get_last_error_msg() const = 0;virtual int Get_last_error_code() const = 0;Create/Destroy an instance of one of the various data structures
className: Name of the class whose object is to be created. To be used for :-
Success: non-NULL handle to the newly created object. It must be casted to the specified type using static_cast
Failure: NULL. Call Get_last_error_msg for more information about this error
Every object created with this method MUST be destroyed using the Delete_object method to avoid memory leak
xxxxxxxxxxvirtual void* New_object(const char* className) = 0;virtual void Delete_object(const char* className, void* handle) = 0;Create and destroy an instance of the rasterizer
filedb: Handle to a QisMFile database
argC, argT, argV: Reserved
Success: non-NULL handle to an instance of the rasterizer
Failure: NULL. Call Get_last_error_msg
Every instance of the rasterizer MUST be destroyed using Destroy_rasterizer to avoid memory/resource leak
Each successful call to Create_rasterizer checks out 1 license (QISMCODE_RASTER) which is checked-in during Destroy_rasterizer
xxxxxxxxxxvirtual QisMRasterizer* Create_rasterizer( NsQisMLib::QisMFile* filedb, const int argC = 0, const char* const* argT = 0, void* const* argV = 0 ) = 0;virtual void Destroy_rasterizer(QisMRasterizer* handle) = 0;Create and destroy an instance of the formatter
Success: non-NULL handle to an instance of the formatter
Failure: NULL. Call Get_last_error_msg
Every instance of the formatter MUST be destroyed using Destroy_formatter to avoid memory/resource leak
xxxxxxxxxxvirtual QisMFormatter* Create_formatter() = 0;virtual void Destroy_formatter(QisMFormatter* handle) = 0;Extension for QisMRaster (version = 2)
xxxxxxxxxxclass QisMRasterV2: public QisMRaster { ... };Open a TIFF/BMP/RAW file writer for rasterizing and formatting polygons
file_path_base: Base path (directory + filename) of the file to be created. extension will be added depending on the file format
lx, ly, ux, uy: Extents of the image in data space (units_m)
opts: Raster settings
units_m: Data units (expressed in meters. e.g um = 1e-6 m)
grid: Data grid (in units_m. e.g nm grid = 0.001 um)
argc, argt, argv: Reserved
Success: non-NULL handle to a an open image file writer
Failure: NULL. Call Get_last_error_msg
Requires ONE license of QISMCODE_RASTER per call. It will be released upon QisMRasterV2::Close_file_writer
Every open file writer MUST be closed using QisMRasterV2::Close_file_writer
Simultaneous access to the QisMRasterWriter API from multiple threads NOT safe at the moment
Use the QisMRasterWriter API to add/draw polygons to this file
The file will not be created on disk until QisMRasterV2::Close_file_writer is called
xxxxxxxxxxvirtual QisMRasterWriter* Open_file_writer( const char* file_path_base, const double lx, const double ly, const double ux, const double uy, const QisMRasterParams* opts, const double grid, const double units_m, const int argc = 0, const char* const* argt = 0, void* const* argv = 0 ) = 0;Close the file writer opened with Open_file_writer
xxxxxxxxxxvirtual void Close_file_writer(QisMRasterWriter* handle) = 0;Extension for QisMRaster (version = 3)
xxxxxxxxxxclass QisMRasterV3: public QisMRasterV2 { ... };Rasterize an arbitrary number of windows in parallel with full control on the no. window threads v/s no. threads per window
filedb is the source file database
list_of_windows is a list of windows to be rasterized
params rasterization settings
n_processors is the no. of window threads i.e no. of windows to be rasterized in parallel. processors is a list of handlers to receieve the rasterized images in form of a callback (no. handles = n_processors)
base_path is the dir+filename of the output image files (if a format is specified)
view_cell is the cell to be rasterized (if not the default top cell)
layers is the set of layers to be rasterized (default - all layers). Polygons from the specified layers are rasterized in the same image (not separate images)
thread_lock is a user supplied handle to a locking mechanism that will be retuned back to the user during the callback
returns true on success. otherwise, call Get_last_error_msg for error details
xxxxxxxxxxvirtual bool Rasterize_win_queue_mt( NsQisMLib::QisMFile* filedb, const NsQisMLib::QisMBoxSet* list_of_windows, const QisMRasterParams* params, QisMRasterNotify* const* processors, const int n_processors, const char* base_path = 0, const char* view_cell = 0, const char* layers = 0, NsQisMLib::QisMThreadLock* thread_lock = 0 ) = 0;Extension for QisMRasterV4 (version = 4)
xxxxxxxxxxclass QisMRasterV4: public QisMRasterV3 { ... };Rasterize an arbitrary number of windows (from paint & scratch data) in parallel with full control on the no. window threads v/s no. threads per window
filedb is the source file database
list_of_windows is a list of windows to be rasterized
params hold the rasterization settings
n_processors is the no. of window threads i.e no. of windows to be rasterized in parallel. processors is a list of handlers to receieve the rasterized images in form of a callback (no. handles = n_processors)
base_path is the dir+filename of the output image files (if a format is specified)
view_cell is the cell to be rasterized (if not the default top cell)
layers is the set of layers to be rasterized (default - all layers). Polygons from the specified layers are rasterized in the same image (not separate images)
thread_lock is a user supplied handle to a locking mechanism that will be retuned back to the user during the callback
Returns true on success. otherwise, call Get_last_error_msg for error details
The paint & scratch specification is automatically computed during this op.
xxxxxxxxxxvirtual bool Rasterize_win_queue_mt_paint_scratch_v2( NsQisMLib::QisMFile* filedb, const NsQisMLib::QisMBoxSet* list_of_windows, const QisMRasterParams* params, QisMRasterNotify* const* processors, const int n_processors, const char* base_path = 0, const char* view_cell = 0, const char* layers = 0, NsQisMLib::QisMThreadLock* thread_lock = 0 ) = 0;Option codes for Rasterize_large_disk_image
RLDI_END : MUST be present as the last value passed to this method
RLDI_PX_OVERLAP : Specify pixel overlap (rows) between bands (at the top edge)
MUST be followed by an int representing the overlap in pixels
Default: 10 (pixels)
RLDI_BASE_PATH : Specify the base path (dir+name) of the output. Extension is automatically added
MUST be followed by a const char* representing the output base path
Default: "out"
RLDI_CELL : Specify the view cell
MUST be followed by a const char* representing the view cell
Default: null (default top cell of the db)
RLDI_LAYERS : Specify the layers to be rasterized
MUST be followed by a const char* representing a comma separated list of layers
Default: null (ALL layers of the db)
RLDI_THRNUM : Specify the number of bands to rasterize in parallel
MUST be followed by a int representing number of threads (bands)
Default: 0 (no. system processors)
RLDI_ALLOC_SCHEME : Specify the allocation scheme to be used
MUST be followed by a int representing the allocation scheme
Default: 2112
The allocation scheme is a 4-digit number of the format ABCD
The amount of memory to be allocated for rasterization is (A/B)*(est_total_buf_sz_mb) while the amount of memory to be allocated for stitching the bands is (C/D)*(est_total_buf_sz_mb)
The scheme can be used to find the optimal performance depending on whether the bottleneck is in the rasterization or the stitching
RLDI_SKEY : Use trusted licencing
MUST be followed by two const char* arguments
First argument is a fresh vendor string generated by the client
Second argument is a path to a key file licensed for the specified vendor
RLDI_GRAY_MODE : Generate gray scale image
MUST be one of the QisMRasterFlags::Grayscale_modes
RLDI_REFRESH_CB : Specify a handle to a callback for refresh notifications
MUST be followed by a pointer to QisMRasterNotifyV3
xxxxxxxxxxenum RasterizeLargeDiskImageOpts { RLDI_END=0 ,RLDI_PX_OVERLAP=1 ,RLDI_BASE_PATH=2 ,RLDI_CELL=3 ,RLDI_LAYERS=4 ,RLDI_THRNUM=5 ,RLDI_ALLOC_SCHEME=6 ,RLDI_SKEY=7 ,RLDI_GRAY_MODE=8 ,RLDI_REFRESH_CB=9};Rasterize an image to disk that is too large to hold in a single buffer in memory
filedb is a valid handle to the source database
llx..ury are the extents of the window in file units
params is a valid handle to the rasterization paramters
est_total_buf_sz_mb is the buffer size to be used as a guide to control how much memory is allocated for rasterization (in Megabytes). See RLDI_ALLOC_SCHEME to understand how memory is allocated based on this parameter
opt_type represents the type of the first option in the variable list ...
If no options are specified, opt_type MUST be RLDI_END (0)
If options are specified, opt_type is one of RasterizeLargeDiskImageOpts
In any case, the last value passed to this method MUST BE RLDI_END (0)
Multiple options can be specified at once starting with the option_type followed by appropriate values as described next to each option. e.g -
xqismraster->Rasterize_large_disk_image( filedb, llx, lly, urx, ury, params, buf_mb, QisMRasterV4::RLDI_END );
qismraster->Rasterize_large_disk_image( filedb, llx, lly, urx, ury, params, buf_mb, QisMRasterV4::RLDI_PX_OVERLAP, 10, QisMRasterV4::RLDI_BASE_PATH, "./out", QisMRasterV4::RLDI_THRNUM, 8, QisMRasterV4::RLDI_END );Returns true on success. Otherwise, call Get_last_error_msg for error info
xxxxxxxxxxvirtual bool Rasterize_large_disk_image( NsQisMLib::QisMFile* filedb, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const unsigned long long est_total_buf_sz_mb, const int opt_type, ... ) = 0;Same as Rasterize_large_disk_image except that the underlying database is a cell-based paint & scratch system (v2)
xxxxxxxxxxvirtual bool Rasterize_large_disk_image_paint_scratch_v2( NsQisMLib::QisMFile* filedb, const double llx, const double lly, const double urx, const double ury, const QisMRasterParams* params, const unsigned long long est_total_buf_sz_mb, const int opt_type, ... ) = 0;Extension for QisMRasterV5 (version = 5)
xxxxxxxxxxclass QisMRasterV5: public QisMRasterV4 { ... };Options for Rasterize_win_queue_mt_ext
RWQO_END : Code indicating the end of the paramter list
RWQO_BASE_PATH : Base path (dir+filename) for the output files. Extension will be automatically added based on the format (default: out)
Followed by ONE argument of type const char*
RWQO_VIEW_CELL View cell to be rasterized (default: NULL - default top cell)
Followed by ONE argument of type const char*
RWQO_LAYERS Comma-separated list of layers of interest. (default: ALL)
Followed by ONE argument of type const char*
RWQO_THREAD_LOCK Handle to a mutex to be passed to the image receiver
Followed by ONE argument of type QisMThreadLock*
RWQO_SKEY OEM key to be used for unlocking the licensing
Followed by TWO arguments of type const char*
First is the vendor string
Second is the oem key file path
xxxxxxxxxxenum WinQueueOpts { RWQO_END=0 ,RWQO_BASE_PATH=1 ,RWQO_VIEW_CELL=2 ,RWQO_LAYERS=3 ,RWQO_THREAD_LOCK=4 ,RWQO_SKEY=5 };Same as Rasterize_win_queue_mt_paint_scratch_v2 / Rasterize_win_queue_mt with additional options
is_paint_scratch_v2 is true if the underlying data is designed as such
filedb is the source file database
list_of_windows is a list of windows to be rasterized
params hold the rasterization settings
n_processors is the no. of window threads i.e no. of windows to be rasterized in parallel. processors is a list of handlers to receieve the rasterized images in form of a callback (no. handles = n_processors)
opt_code is the type of the first optional parameter. If has to be one of QisMRasterV5::WinQueueOpts. If no optional parameters are to be specified, use 0 (QisMRasterV5::RWQO_END)
On sucess returns true. Otherwise call Get_last_error_msg for error info.
xxxxxxxxxxvirtual bool Rasterize_win_queue_mt_ext( const bool is_paint_scratch_v2, NsQisMLib::QisMFile* filedb, const NsQisMLib::QisMBoxSet* list_of_windows, const QisMRasterParams* params, QisMRasterNotify* const* processors, const int n_processors, const int opt_code, ... ) = 0;Returns a handle to the system extension manager
xxxxxxxxxxvirtual NsQisMLib::QisMExtensionMgr* Parent() = 0;virtual const NsQisMLib::QisMExtensionMgr* Parent() const = 0;Same as Create_grayscale of QisMRasterizerV5
xxxxxxxxxxvirtual QisMGrayscaleImage* Create_grayscale( const QisMRasterImage* img, const int mode, const int thrnum ) = 0;virtual void Destroy_grayscale(QisMGrayscaleImage* img) = 0;Destroy the image buffer that was de-coupled from the image object.
See Detach_buffer
xxxxxxxxxxvirtual void Destroy_grayscale_buffer(unsigned char* buffer) = 0;Extension for QisMRaster (version = 6)
xxxxxxxxxxclass QisMRasterV6: public QisMRasterV5 { ... };Downsize a raster image (halve the resolution on each side) using a recipe
name is the name of the new raster image
in is the handle to the source raster image to be downsized
recipe is used to control how a sample of 2x2 pixels is set/reset in the output buffer. See sub-sampling for details
recipe_sz is the size of this array (MUST be 16)
option followed by ... is a set of optional parameters. each parameter consists of an opt-code followed by the value for that parameter. the opt-code is one of QisMRasterSubSampler::Options. the type of the value depends on the opt-code. this set of parameters MUST end with a 0 or QisMRasterSubSampler::SSO_END
Returns a handle to the sub-sampled image object on success. Otherwise, call Get_error_msg for error information
This object MUST be eventually destroyed using Destroy_subsampler to avoid resource leaks
xxxxxxxxxxvirtual QisMRasterSubSampler* Subsample_2x2( const char* name, const QisMRasterImage* in, const unsigned char* recipe, const int recipe_sz, const int option, ... ) = 0;virtual void Destroy_subsampler(QisMRasterSubSampler* handle) = 0;Destroy the buffer detached from the subsampled image object
xxxxxxxxxxvirtual void Destroy_subsampled_buffer(unsigned char* buffer) = 0;Extension for QisMRaster (version = 7)
xxxxxxxxxxclass QisMRasterV7: public QisMRasterV6 { ... };Create an image buffer to be shared between multiple rasterizers
extents is cumulative window to be rasterized in data space
params specify the rasterization options
reuse if not NULL points to an existing image buffer to be re-used only if possible (if the buffer size is enough to hold the new image). If not used, the specified buffer will be destroyed. Therefore, this method will always set reuse to NULL
no_blocking if true instructs the buffer to NOT mutex the drawing because the application is taking special care to make sure that no single byte will be simultaneously written to by multiple threads
This buffer MUST be explicitly destroyed eventually using Destroy_shared_buffer only
Requires and holds ONE license of QISMCODE_RASTER until destroyed
Returns NULL on error. Call Get_last_error_msg for details
xxxxxxxxxxvirtual QisMRasterSharedBuf* Create_shared_buffer( NsQisMLib::QisMWindow& extents, const QisMRasterParams* params, QisMRasterSharedBuf*& reuse, const bool no_blocking = false ) = 0;virtual void Destroy_shared_buffer(QisMRasterSharedBuf* buf) = 0;Create a rasterizer object that uses a shared buffer instead of it's own
filedb is the data source
This rasterizer MUST be eventually destroyed using Destroy_rasterizer to avoid resource leaks
Requires and holds ONE license of QISMCODE_RASTER until destroyed
Returns NULL on error. Call Get_last_error_msg for details
xxxxxxxxxxvirtual QisMRasterizer* Create_rasterizer_shared_buffer( NsQisMLib::QisMFile* filedb, QisMRasterSharedBuf* buffer, const int argC = 0, const char* const* argT = 0, void* const* argV = 0 ) = 0;xxxxxxxxxx+ <layersynth-spec> := <target>[;<target>]* (One or more targets)+ <target> := <target-layer>:<target-dttp>=<op-layer>[:<op-dttp>][<op><op-layer>[:<op-dttp>]]*(Generate a layer:dttp from operations on one or more layers or layer:dttps)+ <op> := '+' (union) or '-' (difference) or '&' (intersection) or '^' (xor) or',' (aggregation/OR-without-union) or '|' (aggregation/OR-without-union)
All <target-layer>:<target-dttp> will be outputted
Any hierarchy if present in the input is flattened
xxxxxxxxxxExamples:100:0=2,5:0,7 (aggregate polygons on 2:* 5:0 and 7:* into a new layer 100:0)100:0=2+5:0+7 (unionize polygons on 2:* 5:0 and 7:* into a new layer 100:0)100:0=2+5:0-7 (unionize polygons on 2:* 5:0 and then subtract 7:* to create anew layer 100:0)100:0=2,5:0-7 (aggregate polygons on 2:* 5:0 and then subtract 7:* to create anew layer 100:0)100:0=2^5 (Compute XOR between 2:* and 5:* as 100:0)100:0=2&5 (Compute INTERSECTION between 2:* and 5:* as 100:0)100:0=2+5;200:0=100:0-5;300:0=200^5;400:0=300&5 (Create multiple synthesizedlayers from multiple operations between layers)
xxxxxxxxxx'L''G''R''A''W''0''0'<width-in-pixels><height-in-pixels><image-bytes-size><image-bytes>
<width-in-pixels> : 4 bytes
<height-in-pixels> : 4 bytes
<image-bytes-size> : 8 bytes
<image-bytes> : <image-bytes-size> bytes
Requires the QisMRaster extension (qismraster64.dll/.so) to be installed, configured and loaded
Some commands require a valid license (14827) to run
Refer to qismraster.h for the corresponding C++ API
xxxxxxxxxxraster.create_rasterizer&rstr={rstr_id}$filedb={filedb_id}
Create a new rasterizer object
Requires 1 license of (14827) per call
Equivalent to QisMRaster::Create_rasterizer
{filedb_id} is name of a variable of type QisMFile* associated with the database linked to serve as the data source for the rasterizer
{rstr_id} is name of the variable of type QisMRasterizer* to be associated with the newly created rasterizer object
Every rasterizer object created with the command MUST be eventually destroyed using raster.destroy_rasterizer to avoid resource leaks
raster.destroy_rasterizer $rstr={rstr_id}
Destroy a rasterizer object
Releases 1 license of (14827) acquired at creation
Equivalent to QisMRaster::Destroy_rasterizer
raster.create_params¶ms={params_id}pixelsize={x}[,{y}][invert][dither={0.0_to_1.0}][right_to_left][bottom_to_top][est_buffer_cnt={n_vertices}][no_patterns][thrnum={n_threads}][fill={SOLID | OUTLINE}][format={TIF | BMP | VBMP | RAW}][nesting={level}][paths[={model}]]
Create an object to hold rasterization parameters
Equivalent to QisMRaster::New_object("QisMRasterParams")
{params_id} represents name of a variable of type QisMRasterParams* to be associated with the newly created object
{x}[,{y}] represents the resolution for rasterization as size of a pixel along X and Y axes. If {y} is omitted, {x} is used along both axes
invert if used, reverses the image polarity to white (0) data pixels on a black (1) background
dither if used applies dithering to the data areas using 8x8 bayer matrix
right_to_left if used reverses the rasterization direction along X so that the first pixel of each row represents the max-x point in the data space. The last pixel represents the min-x point
bottom_to_top is used reverses the rasterization direction along Y so that the first row of pixels represent the min-y points in the data space. The last row represents the max-y points
{n_vertices} if used indicates the size of the polygon buffer when thrnum > 1 (multi-threaded rasterization). Default value is 1,000,000. If set to 0, multi-threading is disabled and each polygon is rasterized on-the-fly (same happens when {n_theads} == 1)
no_patterns if used, disables cellular pattern recognition. i.e repeating cell data within the image space is NOT used for faster rasterization
{n_threads} determines the number of threads used for rasterization. Default -- no. cpus
fill if used controls the fill mode. Default -- SOLID
format if used controls if the image is written to disk in the specified format after rasterization is complete. Default -- no writing to disk
{level} if > 0 specifies the nesting level at which data is to be rasterized. This does not do anything in paint&scratch and layer synthesis modes. Also, if set, cellular pattern recognition will be disabled
paths if specified allows PATH data to be rasterized separately instead of being converted to boundaries. This can be particulary useful for 0-width and 1-point paths
{model} if specified determines the specific algorithm to be used for rasterizing paths
!ellipses if specified disables native rasterization for circle/ellipse constructs in paint&scratch data
Every object created using this command MUST be eventually destroyed using raster.destroy_params to avoid memory leak
raster.destroy_params $params={params_id}
Destroy an object that holds rasterization parameters
Equivalent to QisMRaster::Delete_object("QisMRasterParams")
{params_id} represents name of a variable of type QisMRasterParams* associated with the object to be destroyed
xxxxxxxxxxraster.window$rstr={rstr_id}outbase={output_dir_and_name}$params={params_id}{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}[cell={cellname}][layers={layer_list}][grayscale={sample_rate},{bpp} | subsample]
Generate a monochrome bitmap from a view of the database
Equivalent to QisMRasterizer::Rasterize_window
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{output_dir_and_name} is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params
{params_id} is name of a variable of type QisMRasterParams* containing the rasterization parameters. See raster.create_params
{lx},{ly},{ux},{uy} is the extents of the window (in file units) for which the image is to be generated. Alternately a set of windows can be specified where {window_set_id} is name of a variable of type QisMBoxSet* (See script.new_window_set) representing a set of windows to be rasterized with the same parameters
{cellname} if used is the name of the view cell. Default -- default top cell
{layer_list} if used is a comma-separated list of layer(s) or layer:datatype(s) to be rasterized in this image
If a format was specified, an image file will be created on disk at the specified base path
grayscale if specified generates a gray scale image with the specified sampling rate (uniform sampling) and bits per pixel (bpp). Only the following gray scale modes are supported based on the output format:
| Format | {sample_rate},{bits_per_px} |
|---|---|
TIF, TIF8, NONE | 2,2 2,4 2,8 4,4 4,8 8,8 |
BMP, VBMP | 2,4 2,8 4,4 4,8 8,8 |
xxxxxxxxxxraster.px_window$rstr={rstr_id}outbase={output_dir_and_name}$params={params_id}extents={px_lx},{px_ly},{width_bytes},{height_px}[cell={cellname}][layers={layer_list}][grayscale={sample_rate},{bpp}]
Rasterize a window whose co-ordinates are specified in pixel space
Equivalent to QisMRasterizerV4::Rasterize_px_window
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{output_dir_and_name} is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params
{params_id} is a name of a variable of type QisMRasterParams* associated with the rasterization parameters
{px_llx},{px_lly} are the lower-left co-ordinates of the window in pixel space
{width_bytes} is the image width in bytes
{height_px} is the image height in pixels (or bytes)
{cellname} if specified is the view cell (default: default top cell of the file)
layers (if specified) is a comma-separated list of layers to be rasterized (default: ALL)
pixel_coordinate = round(file_coordinate/pixelsize)
If a format was specified, an image file will be created on disk at the specified base path
grayscale if specified generates a gray scale image. See raster.window for details
xxxxxxxxxxraster.polys$rstr={id}$bin={id}$params={id}[outbase={base_path}][window={minx},{miny},{maxx},{maxy}][repeat={x1},{y1}...{xn},{yn}]
Rasterize a set of polygons
$rstr points to a variable of type QisMRasterizer* representing the rasterizer object to be used
$bin points to a variable of type QisMBStore* representing the polygon set to be rasterized
$params points to a variable of type QisMRasterParams* representing the raster settings to be used
outbase if specified, is the base path (dir+filename) of the output file (per the output format). default: image
window if specified is the clipping window. default: all polygons are rasterized as-is
repeat if specified is a list of offsets (x,y) where the entire set is repeated. The first offset is implied to be 0,0 w.r.t lower-left of the polygon set
Makes use of Import_bstore and Rasterize_polygon_set
raster.overlay_polys $rstr={rstr_id} $bin={bin_id} [mode={PAINT | SCRATCH | DITHER}]
Overlay a set of polygon on an existing image (in the raster buffer)
Equivalent to QisMRasterizerV2::Overlay_polygon_set from qismraster.h
This command will only work after an image has been generated using raster.window or raster.synthesized
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{bin_id} is name of the variable of type QisMBStore* associated with a set of polygons. It can be obtained using various other commands such as exploder.get_boundaries
mode if used specified the overlay mode. Default -- DITHER (overlay polygons with the same dither value as the underlying image). PAINT causes the overlay to be solid regardless of the dither value of the underlying image. SCRATCH causes the overlay to be etched out (cleared) from the underlying image
If a format was specified, an image file will be created on disk to overwrite the original image
xxxxxxxxxxraster.synthesized$rstr={rstr_id}outbase={output_dir_and_name}$params={params_id}{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}[cell={cellname}]lsynth={lsynth_spec}[grayscale={sample_rate},{bpp}]
Generate monochrome bitmap from the result of layer synthesis
Equivalent to QisMRasterizer::Rasterize_window_synthesized
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{output_dir_and_name} is the base path of the output image (directory + file name). The extension will be automatically added based on the format (.tif, .bmp or .raw). See raster.create_params
{params_id} is name of a variable of type QisMRasterParams* containing the rasterization parameters. See raster.create_params
{lx},{ly},{ux},{uy} is the extents of the window (in file units) for which the image is to be generated. Alternately a set of windows can be specified where {window_set_id} is name of a variable of type QisMBoxSet* (See script.new_window_set) representing a set of windows to be rasterized with the same parameters
{cellname} if used is the name of the view cell. Default -- default top cell
{lsynth_spec} specifies the expression to be used for layer synthesis. See here for syntax
If a format was specified, an image file will be created on disk at the specified base path
grayscale if specified generates a gray scale image. See raster.window for details
xxxxxxxxxxraster.create_pns_v2_spec$rstr={rstr_id}&spec={spec_id}[cell={name}]pxsize={x},{y}[window={lx},{ly},{ux},{uy}]raster.destroy_pns_v2_spec$rstr={rstr_id}$spec={spec_id}
Create (or destroy) a paint & scratch specification (v2-cell based) for rasterizing paint & scratch data from a cell-based paint and scratch database
Equivalent to QisMRasterizerV4::Create_paint_scratch_v2_spec / Destroy_paint_scratch_v2_spec
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{spec_id} is name of a variable of type QisMRasterPSInfo_p to be associated with the newly created spec.
{name} (if specified) is the cell to be rasterized
{x},{y} is the resolution in pixel-size (file units)
{lx}..{uy} if specified is the window if interest (in file units)
Every spec. created this way MUST be eventually destroyed using raster.destroy_pns_v2_spec to avoid memory leaks
xxxxxxxxxxraster.window_pns_v2$rstr={rstr_id}outbase={output_dir_and_name}$params={params_id}{window={lx},{ly},{ux},{uy} | $windows={window_set_id}}[cell={cellname}][$spec={spec_id}][layers={layer_string}][grayscale={sample_rate},{bpp}]
Rasterize a window of a paint and scratch (v2-cell based) database
Equivalent to QisMRasterizerV4::Rasterize_window_paint_scratch_v2
{rstr_id} is name of the variable of type QisMRasterizer* associated with the a rasterizer object
{output_dir_and_name} is the name associated with this raster image. It will be used as the base path (directory + filename) if this image is written to disk as TIFF/BMP/RAW
{params_id} is a name of a variable of type QisMRasterParams* associated with the rasterization parameters
{lx} .. {uy} are the lower-left and upper-right co-ordinates of the window to be rasterized (in file units)
OR {window_set_id} is name of a variable of type QisMBoxSet* associated with the set of windows to be rasterized
{cellname} (if specified) is the name of the cell to be rasterized. (default: the deepest top cell in the file)
{spec_id} (if specified) is name of a variable of type QisMRasterPSInfo_p associated with the spec. (default: spec will be computed internally)
layers if specified is a comma-separated list of layer(s) or layer:datatype(s) to be rasterized. Default: ALL
If a format was specified, an image file will be created on disk at the specified base path
grayscale if specified generates a gray scale image. See raster.window for details
xxxxxxxxxxraster.format_image$img={id}outbase={base_path}format={TIF8 | TIF | BMP | VBMP | RAW}[thrnum={n}]
Create a formatted file on disk from the specified image buffer
{id} is the name of the rasterizer that holds the image buffer
{base_path} is the dir + filename of the output file. The extension will be added automatically depending on the format
{n} is the no. threads to be used for the formatting
Equivalent to Format_image
xxxxxxxxxxraster.queue_mt$filedb={filedb_id}$windows={window_set_id}$params={raster_params_id}basepath={image_base_path}[cell={cellname}][layers={layer_string}][thrnum_win={n_window_threads}][grayscale={sample_rate},{bpp}][p&s]
Use a multi-threaded queue to rasterize multiple windows in parallel
Equivalent to QisMRasterV3::Rasterize_win_queue_mt or QisMRasterV4::Raster_win_queue_mt_paint_scratch_v2
{filedb_id} is name of a variable of type QisMFile* associated with the database to be used
{window_set_id} is name associated with a variable of type QisMBoxSet* associated with a list of rectangular windows
{raster_params_id} is name associated with a variable of type QisMRasterParams* associated with the raster settings object
{image_base_path} is the base path (directory + base-name) of the images. A suffix of the format .{number} will be added where {number} is the position of the window in the list. The file extension will be automatically added based on the specified format
{cellname} if specified sets the view cell. Default view cell is the deepest top cell
{layer_string} if specified sets the view layers. Default all layers are ON
{n_window_threads} if specified sets the number of windows to be processed simultaneously. Each window thread will require 1 license of (14827) for rasterization. Default -- no. of processors in the system
p&s if specified uses the paint and scratch model instead of the default paint-only model
The number of threads to be user per image and other rasterization settings depends on the $params spec.
grayscale if specified generates a gray scale image. See raster.window for details
xxxxxxxxxxraster.large_disk_image$filedb={filedb_id}window={lx},{ly},{ux},{uy}$params={params_id}bufsz={mb}[overlap={px}][base={path}][cell={name}][layers={list}][thrnum={n}][alloc={rn}{rd}{sn}{sd}][grayscale={sample_rate},{bpp}][p&s]
Rasterize an image to disk that is too large to hold in a single buffer in memory
Equivalent to QisMRasterV4::Rasterize_large_disk_image or QisMRasterV4::Rasterize_large_disk_image_paint_scratch_v2
{filedb_id} is name of a variable of type QisMFile* associated with the database to be used
{lx}..{uy} are the extents of the window in file units
{params_id} is name of a variable of type QisMRasterParams* containing the rasterization parameters. See raster.create_params
{mb} is the buffer size to be used as a guide to control how much memory is allocated for rasterization (in Megabytes). See alloc= to understand how memory is allocated based on this parameter
overlap= if specified is the amount of overlapping rows between bands in pixels (default: 10)
base= if specified is the output dir+filename. (default: out)
cell= if specified is the view cell to be rasterized (default: deepest top cell)
layers= if specified is the comma-separated list of layers to be rasterized (default:ALL)
thrnum= if specified is the number of bands to be rasterized in parallel threads (default: no. cpus)
alloc= if specified is the allocation scheme to be used
Default: 2112
The allocation scheme is a 4-digit number of the format ABCD
The amount of memory to be allocated for rasterization is (A/B)*(bufsz_mb) while the amount of memory to be allocated for stitching the bands is (C/D)*(bufsz_mb)
The scheme can be used to find the optimal performance depending on whether the bottleneck is in the rasterization or the stitching
p&s if specified uses the paint and scratch model instead of the default paint-only model
If a format was specified, an image file will be created on disk at the specified base path
grayscale if specified generates a gray scale image. See raster.window for details
raster.get_dpi pixelsize={x}[,{y}] [units_m={units_in_meter}] [&var={var_id}]
raster.get_pixelsize dpi={x}[,{y}] [units_m={units_in_meter}] [&var={var_id}]
Convert resolution from pixel size to dots per inch and visa-versa
{x}[,{y}] is the image resolution in term of size of a pixel in file units (or dots per inch). Square pixel implied of {y} is omitted
units_m if specified is the data units in meters. Default: 1e-6 (um)
{var_id} if specified represents name of a string variable to be associated with the computed resolution in the format {res_x},{res_y}. It can be referenced subsequently in the script as (({var_id}))
xxxxxxxxxxraster.compute_px_sz{size={wdith}[,{height}] | window={lx},{ly},{ux},{uy}]buf={bytes}[&var={id}]
Compute the pixel-size (resolution) such that the raster image will fit into the specified buffer size
size= or window= represent the data to be rasterized
buf= specifies the available buffer size in bytes
&var= if specified will set the string variable {id} to the pixel-size value. It can be referenced elsewhere using (({id}))
xxxxxxxxxxraster.compute_buf_szsize={width}[,{height}]pixelsize={x}[,{y}]
Compute size of a raster image buffer based on the size of a pixel
{width},[{height}] are the dimensions of the data window in file units. Square tile implied if {height} is omitted
{x}[,{y}] is the image resolution in term of size of a pixel in file units. Square pixel implied of {y} is omitted
xxxxxxxxxxraster.compute_tile_szbuf_mb={buf_size_mb}pixelsize={x}[,{y}][roi={minx},{miny},{maxx},{maxy}][&width={width_id}][&height={height_id}]
Compute the size of a tile (window of data) based on the estimated buffer size in Mb (1024 * 1024 bytes)
{buf_sz_mb} is the estimated buffer size in Mb. to be filled with 1 bit pixels
{x}[,{y}] is the resolution in terms of size of a pixel along X and Y (in file units)
roi if specified determines the aspect ratio of the computed tile size. The aspect ratio of the tile is made to match that of the region of interest (in file units)
{widht_id} , {height_id} if specified represents names of string variables to be associated with the computed width and height respectively. These can then be referenced subsequently in the script as (({width_id})) and (({height_id})) respectively
xxxxxxxxxxraster.get_buffer_info$img={id}[&sz={id}][&szpx={id}][&pxsz={id}][&dpi={id}][&exts={id}]
Get information about an image created by a raster command
$img={id} specifies the name of the image (which is almost always the name of the associated rasterizer)
&sz={id} if specified, stores the image {size_in_bytes} in the string variable {id}
&szpx={id} if specified, stores the image {width},{height} in pixels in the string variable {id}
&pxsz={id} if specified, stores the image resolution {pixelsize_x},{pixelsize_y} (file units) in the string variable {id}
&dpi={id} if specified, stores the image resolution {dpi_x},{dpi_y} in the string variable {id}
&exts={id} if specified, stores the image data extents {extents_lx},{extents_ly},{extents_ux},{extents_uy} (file units) in the string variable {id}
Product name : QisMRaster License code :
14827
The following operations require ONE license of QisMRaster per call that is held until a corresponding END operation
The following operations require ONE or MORE licenses of QisMRaster that is held only while the operation is in progress. The no. licenses required depends on the CONTROL PARAM supplied to the operation
| OPERATION | CONTROL PARAM |
|---|---|
Rasterize_win_queue_mt | n_processors |
Rasterize_win_queue_mt_paint_scratch_v2 | n_processors |
Rasterize_win_queue_mt_ext | n_processors |
Rasterize_large_disk_image | RLDI_THRNUM |
Rasterize_large_disk_image_paint_scratch_v2 | RLDI_THRNUM |
Rasterize_window_synthesized requires ONE license of QisMLayerSynth and is held while the operation is in progress
Product name :
QisMRasterLicense code :14827
The following operations require ONE license of QisMRaster per call that is held until a corresponding END operation
The following operations require ONE or MORE licenses of QisMRaster that is held only while the operation is in progress. The no. licenses required depends on the CONTROL PARAM supplied to the operation
| OPERATION | CONTROL PARAM |
|---|---|
| raster.queue_mt | thrnum_win |
| raster.large_disk_image | thrnum |
raster.synthesized requires ONE license of QisMLayerSynth and is held while the operation is in progress
Support for a new path rasterizer (OrthoPath)
Bug fix - OemDither
New command raster.compute_px_sz
New command raster.get_buffer_info
Rasterization commands that generate a single image also register a handle of type unsigned char* with the same name as the rasterizer
New command oemdither.4x4 (reserved for internal use)
New API QisMRasterizerV11
Bug fix: Joints of paths with segments at highly obtuse angles were being rasterized improperly
New API QisMRasterizerV10 with some more options for overlaying data
New API QisMFormatterV4
New script commands raster.overlay_path and raster.format_image
Refresh callbacks during rasterization that also doubles as a mechanism to terminate it
Circle rasterization for paint&scratch is now multi-threaded
New support for rasterizing ellipses and paths natively
New API QisMRasterParamsV5 that provides generic Set/Get methods
New ON/OFF control to rasterize PATHs natively
New API QisMRasterizerV8 overlaying ellipses and paths on an existing image
New API QisMRasterNotifyV2 to get access to the thread-local rasterizer objects when using the *queue* based rasterization methods
New API QisMRasterPolygonSetV4 to add polygons to a polygon set
New API QisMRasterizerV7 for overlaying single polygons, creating a new blank image for subsequent overlays etc.
New API QisMRasterSharedBuf and QisMRasterV7 for having multiple rasterizers work together on a single shared image buffer
Support for 2x2 subsampling
New API QisMRasterPolygonSetV3 to allow third party polygon sets to feed data to the rasterizer
New API QisMFormatterV3 for writing big tiff format
Improved rasterization where single pixel aberrations have been fixed
Raster buffer is only re-allocated if the new image size greater than old or less than 2/3rd of the old
Multi-threaded TIF/TIF8 formatting for large disk images
New API and script for rasterizing paint & scratch data
New API and script for rasterizing very large images straight to disk (because there is not enough system memory to hold the image)
Limited support for trusted licensing
New API QisMRasterizerV4::Rasterize_px_window and script command raster.px_window to rasterize an exact window (without adjustments)
New API QisMRasterizerV3::Rasterize_window_paint_scratch and equivalent qismscript command raster.window_paint_scratch to rasterize a set of layers representing paint and scratch polygons
Fix for a bug in the window adjustment computation that could potentially introduce 1 pixel gaps between contiguous windows.
bug-fix: raster queue API resource&license leak
New image format QisMRasterFlags::IFF_VBMP for a bottom-top BMP image where only the header (biHeight) value is changed
New parameter option format=VBMP for the commands raster.create_params
bug fix: top row of a raster image was blank
New API QisMRasterV3 to rasterize a queue of windows using multiple window threads
New script commands raster.queue_mt, raster.get_pixelsize, raster.get_dpi, raster.compute_buf_sz, raster.compute_tile_sz
Improvement - Rasterization of vertical manhattan polygons (stripes) was significantly slower than comparable horizontal stripes
New rasterization parameter to generate bottom-up image (reverse-y)
Support for scripting using QisMScript
Bug-fix: Raster compare two files crashed when cell names were different
New API: QisMRasterWriter and QisMRasterV2 for creating an image writer that can write one or more polygons at a time
Support for comparing two files (QisMRstrCmp2Files)
Linux Build change -- the optimization flag in use -O1 was found to cause slower performance. -O3 fixes that issue
New API extension QisMRasterPolygonSetV2 to import polygons from QisMBStore
New API extension QisMRasterizerV2 with functions to generate multiple raster images from a preset cell, layers and overlay polygons on an existing raster image as well as enabling overlay via multiple rasterization calls
Bug fix: Significant jump in memory footprint if the raster window crosses polygon(s) that are significantly taller (along Y) relative to the window of interest
Compatible with QisMLib v3.20 (API break)
This extension will not load with earlier versions of QisMLib
Last Updated -- Fri Jan 23 01:21:06 UTC 2026