libUEMF
A portable library for reading and writing WMF, EMF and EMF+ files
|
Functions for manipulating EMF files and structures. More...
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <iconv.h>
#include <wchar.h>
#include <errno.h>
#include <limits.h>
#include <math.h>
#include <stddef.h>
#include "uemf.h"
Functions | |
char * | U_emr_names (unsigned int idx) |
Look up the name of the EMR record by type. Returns U_EMR_INVALID if out of range. More... | |
int | memprobe (const void *buf, size_t size) |
Debugging utility, used with valgrind to find uninitialized values. Not for use in production code. More... | |
void | dumpeht (char *string, unsigned int *handle, EMFHANDLES *eht) |
Dump an EMFHANDLES structure. Not for use in production code. More... | |
uint32_t * | dx_set (int32_t height, uint32_t weight, uint32_t members) |
Make up an approximate dx array to pass to emrtext_set(), based on character height and weight. More... | |
uint32_t | emr_properties (uint32_t type) |
Look up the properties (a bit map) of a type of EMR record. Bits that may be set are defined in "Draw Properties" in uemf.h, they are U_DRAW_NOTEMPTY, etc.. More... | |
int | emr_arc_points_common (PU_RECTL rclBox, PU_POINTL ArcStart, PU_POINTL ArcEnd, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size) |
Derive from bounding rect, start and end radials, for arc, chord, or pie, the center, start, and end points, and the bounding rectangle. More... | |
int | emr_arc_points (PU_ENHMETARECORD record, int *f1, int f2, PU_PAIRF center, PU_PAIRF start, PU_PAIRF end, PU_PAIRF size) |
Derive from an EMF arc, chord, or pie the center, start, and end points, and the bounding rectangle. More... | |
int | RGBA_to_DIB (char **px, uint32_t *cbPx, PU_RGBQUAD *ct, int *numCt, const char *rgba_px, int w, int h, int stride, uint32_t colortype, int use_ct, int invert) |
Convert a U_RGBA 32 bit pixmap to one of many different types of DIB pixmaps. More... | |
int | get_real_color_count (const char *Bmih) |
Get the actual number of colors in the color table from the BitMapInfoHeader. More... | |
int | get_real_color_icount (int Colors, int BitCount, int Width, int Height) |
Get the actual number of colors in the color table from the ClrUsed, BitCount, Width, and Height. More... | |
int | get_DIB_params (void *pEmr, uint32_t offBitsSrc, uint32_t offBmiSrc, const char **px, const U_RGBQUAD **ct, uint32_t *numCt, uint32_t *width, uint32_t *height, uint32_t *colortype, uint32_t *invert) |
Get the DIB parameters from the BMI of the record for use by DBI_to_RGBA() More... | |
int | DIB_to_RGBA (const char *px, const U_RGBQUAD *ct, int numCt, char **rgba_px, int w, int h, uint32_t colortype, int use_ct, int invert) |
Convert one of many different types of DIB pixmaps to an RGBA 32 bit pixmap. More... | |
char * | RGBA_to_RGBA (char *rgba_px, int w, int h, int sl, int st, int *eew, int *eeh) |
Extract a subset of an RGBA bitmap array. Frees the incoming bitmap array IF a subset is extracted, otherwise it is left alone. If the entire array is extracted it just returns the incoming pointer. If the subset requested is partially outside of the bitmap the region is clipped to the bitmap boundaries and extracted. This seems to be a (very) grey area in EMF files, and even different Microsoft applications do not always do the same thing. For instance, XP Preview gives some different images for EMR_BITBLT records than does the "import image" (but not unpacked) view in PowerPoint. Since all of these states are probably best viewed as undefined or errors we can only try to do something reasonable and not blow up when encountering one. More... | |
char * | emr_dup (const char *emr) |
Duplicate an EMR record. More... | |
int | emf_start (const char *name, const uint32_t initsize, const uint32_t chunksize, EMFTRACK **et) |
Start constructing an emf in memory. Supply the file name and initial size. More... | |
int | emf_finish (EMFTRACK *et, EMFHANDLES *eht) |
Finalize the emf in memory and write it to the file. More... | |
int | emf_free (EMFTRACK **et) |
Release memory for an emf structure in memory. Call this after emf_finish(). More... | |
FILE * | emf_fopen (const char *filename, const int mode) |
wrapper for fopen, works on any platform More... | |
int | emf_readdata (const char *filename, char **contents, size_t *length) |
Retrieve contents of an EMF file by name. More... | |
int | emf_append (U_ENHMETARECORD *rec, EMFTRACK *et, int freerec) |
Append an EMF record to an emf in memory. This may reallocate buf memory. More... | |
int | emf_htable_create (uint32_t initsize, uint32_t chunksize, EMFHANDLES **eht) |
Create a handle table. Entries filled with 0 are empty, entries >0 hold a handle. More... | |
int | emf_htable_delete (uint32_t *ih, EMFHANDLES *eht) |
Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with a 0. More... | |
int | emf_htable_insert (uint32_t *ih, EMFHANDLES *eht) |
Returns the index of the first free slot. Call realloc() if needed. The slot is set to handle (indicates occupied) and the peak value is adjusted. More... | |
int | emf_htable_free (EMFHANDLES **eht) |
Free all memory in an htable. Sets the pointer to NULL. More... | |
int | device_size (const int xmm, const int ymm, const float dpmm, U_SIZEL *szlDev, U_SIZEL *szlMm) |
Set up fields for an EMR_HEADER from the physical device's width and height in mm and dots per millimeter. Typically this is something like 216,279,47.244 (Letter paper, 1200 DPI = 47.244 DPmm) More... | |
int | drawing_size (const int xmm, const int ymm, const float dpmm, U_RECTL *rclBounds, U_RECTL *rclFrame) |
Set up fields for an EMR_HEADER for drawing by physical size in mm and dots per millimeter. Technically rclBounds is supposed to be the extent of the drawing within the EMF, but libUEMF has no way of knowing this since it never actually draws anything. Instead this is set to the full drawing size. Coordinates are inclusive inclusive, so 297 -> 0,29699. More... | |
U_COLORREF | colorref3_set (uint8_t red, uint8_t green, uint8_t blue) |
Set a U_COLORREF value from separate R,G,B values. More... | |
U_COLORREF | colorref4_set (uint8_t red, uint8_t green, uint8_t blue, uint8_t Reserved) |
Set a U_COLORREF value from separate R,G,B, and Reserved values. More... | |
U_RGBQUAD | rgbquad_set (uint8_t red, uint8_t green, uint8_t blue, uint8_t reserved) |
Set a U_RGBQUAD value from separate R,G,B, Reserved values. More... | |
U_RECTL | rectl_set (U_POINTL ul, U_POINTL lr) |
Set rect and rectl objects from Upper Left and Lower Right corner points. More... | |
U_SIZEL | sizel_set (int32_t x, int32_t y) |
Set sizel objects with X,Y values. More... | |
U_POINTL | point32_set (int32_t x, int32_t y) |
Set pointl objects with X,Y values. More... | |
U_POINT16 | point16_set (int16_t x, int16_t y) |
Set point16 objects with 16 bit X,Y values. More... | |
U_RECT | findbounds (uint32_t count, PU_POINT pts, uint32_t width) |
Find the bounding rectangle from a polyline of a given width. More... | |
U_RECT | findbounds16 (uint32_t count, PU_POINT16 pts, uint32_t width) |
Find the bounding rectangle from a polyline of a given width. More... | |
U_LOGBRUSH | logbrush_set (uint32_t lbStyle, U_COLORREF lbColor, int32_t lbHatch) |
Construct a U_LOGBRUSH structure. More... | |
U_XFORM | xform_set (U_FLOAT eM11, U_FLOAT eM12, U_FLOAT eM21, U_FLOAT eM22, U_FLOAT eDx, U_FLOAT eDy) |
Construct a U_XFORM structure. More... | |
U_XFORM | xform_alt_set (U_FLOAT scale, U_FLOAT ratio, U_FLOAT rot, U_FLOAT axisrot, U_FLOAT eDx, U_FLOAT eDy) |
Construct a U_XFORM structure. More... | |
U_LOGCOLORSPACEA | logcolorspacea_set (int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, char *lcsFilename) |
Construct a U_LOGCOLORSPACEA structure. More... | |
U_LOGCOLORSPACEW | logcolorspacew_set (int32_t lcsCSType, int32_t lcsIntent, U_CIEXYZTRIPLE lcsEndpoints, U_LCS_GAMMARGB lcsGammaRGB, uint16_t *lcsFilename) |
Construct a U_LOGCOLORSPACEW structure. More... | |
U_PANOSE | panose_set (uint8_t bFamilyType, uint8_t bSerifStyle, uint8_t bWeight, uint8_t bProportion, uint8_t bContrast, uint8_t bStrokeVariation, uint8_t bArmStyle, uint8_t bLetterform, uint8_t bMidline, uint8_t bXHeight) |
Construct a U_PANOSE structure. More... | |
U_LOGFONT | logfont_set (int32_t lfHeight, int32_t lfWidth, int32_t lfEscapement, int32_t lfOrientation, int32_t lfWeight, uint8_t lfItalic, uint8_t lfUnderline, uint8_t lfStrikeOut, uint8_t lfCharSet, uint8_t lfOutPrecision, uint8_t lfClipPrecision, uint8_t lfQuality, uint8_t lfPitchAndFamily, uint16_t *lfFaceName) |
Construct a U_LOGFONT structure. More... | |
U_LOGFONT_PANOSE | logfont_panose_set (U_LOGFONT elfLogFont, uint16_t *elfFullName, uint16_t *elfStyle, uint32_t elfStyleSize, U_PANOSE elfPanose) |
Construct a U_LOGFONT_PANOSE structure. More... | |
U_BITMAPINFOHEADER | bitmapinfoheader_set (int32_t biWidth, int32_t biHeight, uint16_t biPlanes, uint16_t biBitCount, uint32_t biCompression, uint32_t biSizeImage, int32_t biXPelsPerMeter, int32_t biYPelsPerMeter, U_NUM_RGBQUAD biClrUsed, uint32_t biClrImportant) |
Construct a U_BITMAPINFOHEADER structure. More... | |
PU_BITMAPINFO | bitmapinfo_set (U_BITMAPINFOHEADER BmiHeader, PU_RGBQUAD BmiColors) |
Allocate and construct a U_BITMAPINFO structure. More... | |
PU_EXTLOGPEN | extlogpen_set (uint32_t elpPenStyle, uint32_t elpWidth, uint32_t elpBrushStyle, U_COLORREF elpColor, int32_t elpHatch, U_NUM_STYLEENTRY elpNumEntries, U_STYLEENTRY *elpStyleEntry) |
Allocate and construct a U_EXTLOGPEN structure. More... | |
U_LOGPEN | logpen_set (uint32_t lopnStyle, U_POINT lopnWidth, U_COLORREF lopnColor) |
Construct a U_LOGPEN structure. More... | |
U_LOGPLTNTRY | logpltntry_set (uint8_t peReserved, uint8_t peRed, uint8_t peGreen, uint8_t peBlue) |
Construct a U_LOGPLTNTRY structure. More... | |
PU_LOGPALETTE | logpalette_set (U_NUM_LOGPLTNTRY palNumEntries, PU_LOGPLTNTRY *palPalEntry) |
Allocate and construct a U_LOGPALETTE structure. More... | |
U_RGNDATAHEADER | rgndataheader_set (U_NUM_RECTL nCount, U_RECTL rclBounds) |
Construct a U_RGNDATAHEADER structure. More... | |
PU_RGNDATA | rgndata_set (U_RGNDATAHEADER rdh, PU_RECTL Buffer) |
Allocate and construct a U_RGNDATA structure. More... | |
U_COLORADJUSTMENT | coloradjustment_set (uint16_t Size, uint16_t Flags, uint16_t IlluminantIndex, uint16_t RedGamma, uint16_t GreenGamma, uint16_t BlueGamma, uint16_t ReferenceBlack, uint16_t ReferenceWhite, int16_t Contrast, int16_t Brightness, int16_t Colorfulness, int16_t RedGreenTint) |
Construct a U_COLORADJUSTMENT structure. More... | |
U_PIXELFORMATDESCRIPTOR | pixelformatdescriptor_set (uint32_t dwFlags, uint8_t iPixelType, uint8_t cColorBits, uint8_t cRedBits, uint8_t cRedShift, uint8_t cGreenBits, uint8_t cGreenShift, uint8_t cBlueBits, uint8_t cBlueShift, uint8_t cAlphaBits, uint8_t cAlphaShift, uint8_t cAccumBits, uint8_t cAccumRedBits, uint8_t cAccumGreenBits, uint8_t cAccumBlueBits, uint8_t cAccumAlphaBits, uint8_t cDepthBits, uint8_t cStencilBits, uint8_t cAuxBuffers, uint8_t iLayerType, uint8_t bReserved, uint32_t dwLayerMask, uint32_t dwVisibleMask, uint32_t dwDamageMask) |
Construct a U_PIXELFORMATDESCRIPTOR structure. More... | |
char * | emrtext_set (U_POINTL ptlReference, U_NUM_STR NumString, uint32_t cbChar, void *String, uint32_t fOptions, U_RECTL rcl, uint32_t *Dx) |
Allocate and create a U_EMRTEXT structure followed by its variable pieces via a char* pointer. Dx cannot be NULL, if the calling program has no appropriate values call dx_set() first. More... | |
char * | textcomment_set (const char *string) |
Allocate and construct a U_EMRCOMMENT structure with a UTF8 string. A U_EMRCOMMENT contains application specific data, and that may include contain null characters. This function may be used when the comment only incluces UT8 text. More... | |
char * | deleteobject_set (uint32_t *ihObject, EMFHANDLES *eht) |
Allocate and construct a U_EMRDELETEOBJECT structure and also delete the requested object from the table. Use this function instead of calling U_EMRDELETEOBJECT_set() directly. More... | |
char * | selectobject_set (uint32_t ihObject, EMFHANDLES *eht) |
Allocate and construct a U_EMRSELECTOBJECT structure, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_EMRSELECTOBJECT_set() directly. More... | |
char * | extcreatepen_set (uint32_t *ihPen, EMFHANDLES *eht, PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, PU_EXTLOGPEN elp) |
Allocate and construct a U_EMREXTCREATEPEN structure, create a handle and return it. Use this function instead of calling U_EMREXTCREATEPEN_set() directly. More... | |
char * | createpen_set (uint32_t *ihPen, EMFHANDLES *eht, U_LOGPEN lopn) |
Allocate and construct a U_EMRCREATEPEN structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPEN_set() directly. More... | |
char * | createbrushindirect_set (uint32_t *ihBrush, EMFHANDLES *eht, U_LOGBRUSH lb) |
Allocate and construct a U_EMRCREATEBRUSHINDIRECT structure, create a handle and returns it Use this function instead of calling U_EMRCREATEBRUSHINDIRECT_set() directly. More... | |
char * | createdibpatternbrushpt_set (uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px) |
Allocate and construct a U_EMRCREATEDIBPATTERNBRUSHPT_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEDIBPATTERNBRUSHPT_set() directly. More... | |
char * | createmonobrush_set (uint32_t *ihBrush, EMFHANDLES *eht, const uint32_t iUsage, PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px) |
Allocate and construct a U_EMRCREATEMONOBRUSH_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEMONOBRUSH_set() directly. More... | |
char * | createcolorspace_set (uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEA lcs) |
Allocate and construct a U_EMRCREATECOLORSPACE structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACE_set() directly. More... | |
char * | createcolorspacew_set (uint32_t *ihCS, EMFHANDLES *eht, U_LOGCOLORSPACEW lcs, uint32_t dwFlags, U_CBDATA cbData, uint8_t *Data) |
Allocate and construct a U_EMRCREATECOLORSPACEW structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACEW_set() directly. More... | |
char * | extcreatefontindirectw_set (uint32_t *ihFont, EMFHANDLES *eht, const char *elf, const char *elfw) |
Allocate and construct a U_EMREXTCREATEFONTINDIRECTW structure, create a handle and returns it Use this function instead of calling U_EMREXTCREATEFONTINDIRECTW_set() directly. More... | |
char * | createpalette_set (uint32_t *ihPal, EMFHANDLES *eht, U_LOGPALETTE lgpl) |
Allocate and construct a U_EMRCREATEPALETTE structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPALETTE_set() directly. More... | |
char * | setpaletteentries_set (uint32_t *ihPal, EMFHANDLES *eht, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries) |
Allocate and construct a U_EMRSETPALETTEENTRIES structure, create a handle and returns it Use this function instead of calling U_EMRSETPALETTEENTRIES_set() directly. More... | |
char * | fillrgn_set (uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const PU_RGNDATA RgnData) |
Allocate and construct a U_EMRFILLRGN structure, create a handle and returns it Use this function instead of calling U_EMRFILLRGN_set() directly. More... | |
char * | framergn_set (uint32_t *ihBrush, EMFHANDLES *eht, const U_RECTL rclBounds, const U_SIZEL szlStroke, const PU_RGNDATA RgnData) |
Allocate and construct a U_EMRFRAMERGN structure, create a handle and returns it Use this function instead of calling U_EMRFRAMERGN_set() directly. More... | |
PU_POINT | points_transform (PU_POINT points, int count, U_XFORM xform) |
Allocate and construct an array of U_POINT objects which has been subjected to a U_XFORM. More... | |
PU_POINT16 | point16_transform (PU_POINT16 points, int count, U_XFORM xform) |
Allocate and construct an array of U_POINT16 objects which has been subjected to a U_XFORM. More... | |
PU_TRIVERTEX | trivertex_transform (PU_TRIVERTEX tv, int count, U_XFORM xform) |
Allocate and construct an array of U_TRIVERTEX objects which has been subjected to a U_XFORM. More... | |
PU_POINT | point16_to_point (PU_POINT16 points, int count) |
Allocate and construct an array of U_POINT objects from a set of U_POINT16 objects. More... | |
PU_POINT16 | point_to_point16 (PU_POINT points, int count) |
Allocate and construct an array of U_POINT16 objects from a set of U_POINT objects. More... | |
char * | U_EMRHEADER_set (const U_RECTL rclBounds, const U_RECTL rclFrame, U_PIXELFORMATDESCRIPTOR *const pfmtDesc, U_CBSTR nDesc, uint16_t *const Description, const U_SIZEL szlDevice, const U_SIZEL szlMillimeters, const uint32_t bOpenGL) |
Allocate and construct a U_EMRHEADER record. More... | |
char * | U_EMRPOLYBEZIER_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYBEZIER record. More... | |
char * | U_EMRPOLYGON_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYGON record. More... | |
char * | U_EMRPOLYLINE_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYLINE record. More... | |
char * | U_EMRPOLYBEZIERTO_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYBEZIERTO record. More... | |
char * | U_EMRPOLYLINETO_set (const U_RECTL rclBounds, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYLINETO record. More... | |
char * | U_EMRPOLYPOLYLINE_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYPOLYLINE record. More... | |
char * | U_EMRPOLYPOLYGON_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cptl, const U_POINTL *points) |
Allocate and construct a U_EMR_POLYPOLYGON record. More... | |
char * | U_EMRSETWINDOWEXTEX_set (const U_SIZEL szlExtent) |
Allocate and construct a U_EMR_SETWINDOWEXTEX record. More... | |
char * | U_EMRSETWINDOWORGEX_set (const U_POINTL ptlOrigin) |
Allocate and construct a U_EMR_SETWINDOWORGEX record. More... | |
char * | U_EMRSETVIEWPORTEXTEX_set (const U_SIZEL szlExtent) |
Allocate and construct a U_EMR_SETVIEWPORTEXTEX record. More... | |
char * | U_EMRSETVIEWPORTORGEX_set (const U_POINTL ptlOrigin) |
Allocate and construct a U_EMR_SETVIEWPORTORGEX record. More... | |
char * | U_EMRSETBRUSHORGEX_set (const U_POINTL ptlOrigin) |
Allocate and construct a U_EMR_SETBRUSHORGEX record. More... | |
char * | U_EMREOF_set (const U_CBPLENTRIES cbPalEntries, const PU_LOGPLTNTRY PalEntries, EMFTRACK *et) |
Allocate and construct a U_EMR_EOF record. More... | |
char * | U_EMRSETPIXELV_set (const U_POINTL ptlPixel, const U_COLORREF crColor) |
Allocate and construct a U_EMR_SETPIXELV record. More... | |
char * | U_EMRSETMAPPERFLAGS_set (void) |
Allocate and construct a U_EMR_SETMAPPERFLAGS record. More... | |
char * | U_EMRSETMAPMODE_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETMAPMODE record. More... | |
char * | U_EMRSETBKMODE_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETBKMODE record. More... | |
char * | U_EMRSETPOLYFILLMODE_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETPOLYFILLMODE record. More... | |
char * | U_EMRSETROP2_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETROP2 record. More... | |
char * | U_EMRSETSTRETCHBLTMODE_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETSTRETCHBLTMODE record. More... | |
char * | U_EMRSETTEXTALIGN_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETTEXTALIGN record. More... | |
char * | U_EMRSETCOLORADJUSTMENT_set (const U_COLORADJUSTMENT ColorAdjustment) |
Allocate and construct a U_EMR_SETCOLORADJUSTMENT record. More... | |
char * | U_EMRSETTEXTCOLOR_set (const U_COLORREF crColor) |
Allocate and construct a U_EMR_SETTEXTCOLOR record. More... | |
char * | U_EMRSETBKCOLOR_set (const U_COLORREF crColor) |
Allocate and construct a U_EMR_SETBKCOLOR record. More... | |
char * | U_EMROFFSETCLIPRGN_set (const U_POINTL ptl) |
Allocate and construct a U_EMR_OFFSETCLIPRGN record. More... | |
char * | U_EMRMOVETOEX_set (const U_POINTL ptl) |
Allocate and construct a U_EMR_MOVETOEX record. More... | |
char * | U_EMRSETMETARGN_set (void) |
Allocate and construct a U_EMR_SETMETARGN record. More... | |
char * | U_EMREXCLUDECLIPRECT_set (const U_RECTL rclClip) |
Allocate and construct a U_EMR_EXCLUDECLIPRECT record. More... | |
char * | U_EMRINTERSECTCLIPRECT_set (const U_RECTL rclClip) |
Allocate and construct a U_EMR_INTERSECTCLIPRECT record. More... | |
char * | U_EMRSCALEVIEWPORTEXTEX_set (const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom) |
Allocate and construct a U_EMR_SCALEVIEWPORTEXTEX record. More... | |
char * | U_EMRSCALEWINDOWEXTEX_set (const int32_t xNum, const int32_t xDenom, const int32_t yNum, const int32_t yDenom) |
Allocate and construct a U_EMR_SCALEWINDOWEXTEX record. More... | |
char * | U_EMRSAVEDC_set (void) |
Allocate and construct a U_EMR_SAVEDC record. More... | |
char * | U_EMRRESTOREDC_set (const int32_t iRelative) |
Allocate and construct a U_EMR_RESTOREDC record. More... | |
char * | U_EMRSETWORLDTRANSFORM_set (const U_XFORM xform) |
Allocate and construct a U_EMR_SETWORLDTRANSFORM record. More... | |
char * | U_EMRMODIFYWORLDTRANSFORM_set (const U_XFORM xform, const uint32_t iMode) |
Allocate and construct a U_EMR_MODIFYWORLDTRANSFORM record. More... | |
char * | U_EMRSELECTOBJECT_set (const uint32_t ihObject) |
Allocate and construct a U_EMR_SELECTOBJECT record. Use selectobject_set() instead of calling this function directly. More... | |
char * | U_EMRCREATEPEN_set (const uint32_t ihPen, const U_LOGPEN lopn) |
Allocate and construct a U_EMR_CREATEPEN record. Use createpen_set() instead of calling this function directly. More... | |
char * | U_EMRCREATEBRUSHINDIRECT_set (const uint32_t ihBrush, const U_LOGBRUSH lb) |
Allocate and construct a U_EMR_CREATEBRUSHINDIRECT record. Use createbrushindirect_set() instead of calling this function directly. More... | |
char * | U_EMRDELETEOBJECT_set (const uint32_t ihObject) |
Allocate and construct a U_EMR_DELETEOBJECT record. Use deleteobject_set() instead of calling this function directly. More... | |
char * | U_EMRANGLEARC_set (const U_POINTL ptlCenter, const uint32_t nRadius, const U_FLOAT eStartAngle, const U_FLOAT eSweepAngle) |
Allocate and construct a U_EMR_ANGLEARC record. More... | |
char * | U_EMRELLIPSE_set (const U_RECTL rclBox) |
Allocate and construct a U_EMR_ELLIPSE record. More... | |
char * | U_EMRRECTANGLE_set (const U_RECTL rclBox) |
Allocate and construct a U_EMR_RECTANGLE record. More... | |
char * | U_EMRROUNDRECT_set (const U_RECTL rclBox, const U_SIZEL szlCorner) |
Allocate and construct a U_EMR_ROUNDRECT record. More... | |
char * | U_EMRARC_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd) |
Allocate and construct a U_EMR_ARC record. More... | |
char * | U_EMRCHORD_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd) |
Allocate and construct a U_EMR_CHORD record. More... | |
char * | U_EMRPIE_set (const U_RECTL rclBox, const U_POINTL ptlStart, const U_POINTL ptlEnd) |
Allocate and construct a U_EMR_PIE record. More... | |
char * | U_EMRSELECTPALETTE_set (const uint32_t ihPal) |
Allocate and construct a U_EMR_SELECTPALETTE record. More... | |
char * | U_EMRCREATEPALETTE_set (const uint32_t ihPal, const U_LOGPALETTE lgpl) |
Allocate and construct a U_EMR_CREATEPALETTE record. Use createpalette_set() instead of calling this function directly. More... | |
char * | U_EMRSETPALETTEENTRIES_set (const uint32_t ihPal, const uint32_t iStart, const U_NUM_LOGPLTNTRY cEntries, const PU_LOGPLTNTRY aPalEntries) |
Allocate and construct a U_EMR_SETPALETTEENTRIES record. Use setpaletteentries_set() instead of calling this function directly. More... | |
char * | U_EMRRESIZEPALETTE_set (const uint32_t ihPal, const uint32_t cEntries) |
Allocate and construct a U_EMR_RESIZEPALETTE record. More... | |
char * | U_EMRREALIZEPALETTE_set (void) |
Allocate and construct a U_EMR_REALIZEPALETTE record. More... | |
char * | U_EMREXTFLOODFILL_set (const U_POINTL ptlStart, const U_COLORREF crColor, const uint32_t iMode) |
Allocate and construct a U_EMR_EXTFLOODFILL record. More... | |
char * | U_EMRLINETO_set (const U_POINTL ptl) |
Allocate and construct a U_EMR_LINETO record. More... | |
char * | U_EMRARCTO_set (U_RECTL rclBox, U_POINTL ptlStart, U_POINTL ptlEnd) |
Allocate and construct a U_EMR_ARCTO record. More... | |
char * | U_EMRPOLYDRAW_set (const U_RECTL rclBounds, const U_NUM_POINTL cptl, const U_POINTL *aptl, const uint8_t *abTypes) |
Allocate and construct a U_EMR_POLYDRAW record. More... | |
char * | U_EMRSETARCDIRECTION_set (const uint32_t iArcDirection) |
Allocate and construct a U_EMR_SETARCDIRECTION record. More... | |
char * | U_EMRSETMITERLIMIT_set (const uint32_t eMiterLimit) |
Allocate and construct a U_EMR_SETMITERLIMIT record. More... | |
char * | U_EMRBEGINPATH_set (void) |
Allocate and construct a U_EMR_BEGINPATH record. More... | |
char * | U_EMRENDPATH_set (void) |
Allocate and construct a U_EMR_ENDPATH record. More... | |
char * | U_EMRCLOSEFIGURE_set (void) |
Allocate and construct a U_EMR_CLOSEFIGURE record. More... | |
char * | U_EMRFILLPATH_set (const U_RECTL rclBox) |
Allocate and construct a U_EMR_FILLPATH record. More... | |
char * | U_EMRSTROKEANDFILLPATH_set (const U_RECTL rclBox) |
Allocate and construct a U_EMR_STROKEANDFILLPATH record. More... | |
char * | U_EMRSTROKEPATH_set (const U_RECTL rclBox) |
Allocate and construct a U_EMR_STROKEPATH record. More... | |
char * | U_EMRFLATTENPATH_set (void) |
Allocate and construct a U_EMR_FLATTENPATH record. More... | |
char * | U_EMRWIDENPATH_set (void) |
Allocate and construct a U_EMR_WIDENPATH record. More... | |
char * | U_EMRSELECTCLIPPATH_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SELECTCLIPPATH record. More... | |
char * | U_EMRABORTPATH_set (void) |
Allocate and construct a U_EMR_ABORTPATH record. More... | |
char * | U_EMRCOMMENT_set (const U_CBDATA cbData, const char *Data) |
Allocate and construct a U_EMR_COMMENT record. More... | |
char * | U_EMRFILLRGN_set (const U_RECTL rclBounds, const uint32_t ihBrush, const PU_RGNDATA RgnData) |
Allocate and construct a U_EMR_FILLRGN record. Use fillrgn_set() instead of calling this function directly. More... | |
char * | U_EMRFRAMERGN_set (const U_RECTL rclBounds, const uint32_t ihBrush, const U_SIZEL szlStroke, const PU_RGNDATA RgnData) |
Allocate and construct a U_EMR_FRAMERGN record. Use framegrn_set() instead of calling this function directly. More... | |
char * | U_EMRINVERTRGN_set (const PU_RGNDATA RgnData) |
Allocate and construct a U_EMR_INVERTRGN record. More... | |
char * | U_EMRPAINTRGN_set (const PU_RGNDATA RgnData) |
Allocate and construct a U_EMR_PAINTRGN record. More... | |
char * | U_EMREXTSELECTCLIPRGN_set (const uint32_t iMode, const PU_RGNDATA RgnData) |
Allocate and construct a U_EMR_EXTSELECTCLIPRGN record. More... | |
char * | U_EMRBITBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_BITBLT record. More... | |
char * | U_EMRSTRETCHBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_STRETCHBLT record. More... | |
char * | U_EMRMASKBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk) |
Allocate and construct a U_EMR_MASKBLT record. More... | |
char * | U_EMRPLGBLT_set (const U_RECTL rclBounds, const PU_POINTL aptlDst, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_POINTL Mask, const uint32_t iUsageMask, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_BITMAPINFO MskBmi, const uint32_t cbMsk, char *Msk) |
Allocate and construct a U_EMRPLGBLT record. More... | |
char * | U_EMRSETDIBITSTODEVICE_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t iStartScan, const uint32_t cScans, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_SETDIBITSTODEVICE record. More... | |
char * | U_EMRSTRETCHDIBITS_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const uint32_t iUsageSrc, const uint32_t dwRop, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_EMRSTRETCHDIBITS record. More... | |
char * | U_EMREXTCREATEFONTINDIRECTW_set (const uint32_t ihFont, const char *elf, const char *elfw) |
Allocate and construct a U_EMR_EXTCREATEFONTINDIRECTW record. Use extcreatefontindirectw_set() instead of calling this function directly. More... | |
char * | U_EMREXTTEXTOUTA_set (const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext) |
Allocate and construct a U_EMR_EXTTEXTOUTA record. More... | |
char * | U_EMREXTTEXTOUTW_set (const U_RECTL rclBounds, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const PU_EMRTEXT emrtext) |
Allocate and construct a U_EMR_EXTTEXTOUTW record. More... | |
char * | U_EMRPOLYBEZIER16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYBEZIER16 record. More... | |
char * | U_EMRPOLYGON16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYGON16 record. More... | |
char * | U_EMRPOLYLINE16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYLINE16 record. More... | |
char * | U_EMRPOLYBEZIERTO16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYBEZIERTO record. More... | |
char * | U_EMRPOLYLINETO16_set (const U_RECTL rclBounds, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYLINETO record. More... | |
char * | U_EMRPOLYPOLYLINE16_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYPOLYLINE16 record. More... | |
char * | U_EMRPOLYPOLYGON16_set (const U_RECTL rclBounds, const uint32_t nPolys, const uint32_t *aPolyCounts, const uint32_t cpts, const U_POINT16 *points) |
Allocate and construct a U_EMR_POLYPOLYGON16 record. More... | |
char * | U_EMRPOLYDRAW16_set (const U_RECTL rclBounds, const U_NUM_POINT16 cpts, const U_POINT16 *aptl, const uint8_t *abTypes) |
Allocate and construct a U_EMR_POLYDRAW16 record. More... | |
char * | U_EMRCREATEMONOBRUSH_set (const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px) |
Allocate and construct a U_EMR_CREATEMONOBRUSH record. More... | |
char * | U_EMRCREATEDIBPATTERNBRUSHPT_set (const uint32_t ihBrush, const uint32_t iUsage, const PU_BITMAPINFO Bmi, const uint32_t cbPx, const char *Px) |
Allocate and construct a U_EMR_CREATEDIBPATTERNBRUSHPT record. Use createdibpatternbrushpt_set() instead of calling this function directly. More... | |
char * | U_EMREXTCREATEPEN_set (const uint32_t ihPen, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px, const PU_EXTLOGPEN elp) |
Allocate and construct a U_EMR_EXTCREATEPEN record. Use extcreatepen_set() instead of calling this function directly. More... | |
char * | U_EMRSETICMMODE_set (const uint32_t iMode) |
Allocate and construct a U_EMR_SETICMMODE record. More... | |
char * | U_EMRCREATECOLORSPACE_set (const uint32_t ihCS, const U_LOGCOLORSPACEA lcs) |
Allocate and construct a U_EMR_CREATECOLORSPACE record. Use createcolorspace_set() instead of calling this function directly. More... | |
char * | U_EMRSETCOLORSPACE_set (const uint32_t ihCS) |
Allocate and construct a U_EMR_SETCOLORSPACE record. More... | |
char * | U_EMRDELETECOLORSPACE_set (const uint32_t ihCS) |
Allocate and construct a U_EMR_DELETECOLORSPACE record. More... | |
char * | U_EMRPIXELFORMAT_set (const U_PIXELFORMATDESCRIPTOR pfd) |
Allocate and construct a U_EMR_PIXELFORMAT record. More... | |
char * | U_EMRSMALLTEXTOUT_set (const U_POINTL Dest, const U_NUM_STR cChars, const uint32_t fuOptions, const uint32_t iGraphicsMode, const U_FLOAT exScale, const U_FLOAT eyScale, const U_RECTL rclBounds, const char *TextString) |
Allocate and construct a U_EMR_SMALLTEXTOUT record. More... | |
char * | U_EMRALPHABLEND_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const U_BLEND Blend, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_ALPHABLEND record. More... | |
char * | U_EMRSETLAYOUT_set (uint32_t iMode) |
Allocate and construct a U_EMR_SETLAYOUT record. More... | |
char * | U_EMRTRANSPARENTBLT_set (const U_RECTL rclBounds, const U_POINTL Dest, const U_POINTL cDest, const U_POINTL Src, const U_POINTL cSrc, const U_XFORM xformSrc, const U_COLORREF crBkColorSrc, const uint32_t iUsageSrc, const uint32_t TColor, const PU_BITMAPINFO Bmi, const uint32_t cbPx, char *Px) |
Allocate and construct a U_EMR_TRANSPARENTBLT record. More... | |
char * | U_EMRGRADIENTFILL_set (const U_RECTL rclBounds, const U_NUM_TRIVERTEX nTriVert, const U_NUM_GRADOBJ nGradObj, const uint32_t ulMode, const PU_TRIVERTEX TriVert, const uint32_t *GradObj) |
Allocate and construct a U_EMR_TRANSPARENTBLT record. More... | |
char * | U_EMRCREATECOLORSPACEW_set (const uint32_t ihCS, const U_LOGCOLORSPACEW lcs, const uint32_t dwFlags, const U_CBDATA cbData, const uint8_t *Data) |
Allocate and construct a U_EMR_CREATECOLORSPACEW record. Use createcolorspacew_set() instead of calling this function directly. More... | |
Functions for manipulating EMF files and structures.
[U_EMR]_set all take data and return a pointer to memory holding the constructed record. The size of that record is also returned in recsize. It is also in the second int32 in the record, but may have been byte swapped and so not usable. If something goes wrong a NULL pointer is returned and recsize is set to 0.
Compile with "U_VALGRIND" defined defined to enable code which lets valgrind check each record for uninitialized data.
Compile with "SOL8" defined for Solaris 8 or 9 (Sparc).
PU_BITMAPINFO bitmapinfo_set | ( | U_BITMAPINFOHEADER | BmiHeader, |
PU_RGBQUAD | BmiColors | ||
) |
Allocate and construct a U_BITMAPINFO structure.
BmiHeader | Geometry and pixel properties |
BmiColors | Color table (must be NULL for some values of BmiHeader->biBitCount) |
U_BITMAPINFOHEADER bitmapinfoheader_set | ( | int32_t | biWidth, |
int32_t | biHeight, | ||
uint16_t | biPlanes, | ||
uint16_t | biBitCount, | ||
uint32_t | biCompression, | ||
uint32_t | biSizeImage, | ||
int32_t | biXPelsPerMeter, | ||
int32_t | biYPelsPerMeter, | ||
U_NUM_RGBQUAD | biClrUsed, | ||
uint32_t | biClrImportant | ||
) |
Construct a U_BITMAPINFOHEADER structure.
biWidth | Bitmap width in pixels |
biHeight | Bitmap height in pixels |
biPlanes | Planes (must be 1) |
biBitCount | BitCount Enumeration |
biCompression | BI_Compression Enumeration |
biSizeImage | Size in bytes of image |
biXPelsPerMeter | X Resolution in pixels/meter |
biYPelsPerMeter | Y Resolution in pixels/meter |
biClrUsed | Number of bmciColors in U_BITMAPCOREINFO |
biClrImportant | Number of bmciColors needed (0 means all). |
U_COLORADJUSTMENT coloradjustment_set | ( | uint16_t | Size, |
uint16_t | Flags, | ||
uint16_t | IlluminantIndex, | ||
uint16_t | RedGamma, | ||
uint16_t | GreenGamma, | ||
uint16_t | BlueGamma, | ||
uint16_t | ReferenceBlack, | ||
uint16_t | ReferenceWhite, | ||
int16_t | Contrast, | ||
int16_t | Brightness, | ||
int16_t | Colorfulness, | ||
int16_t | RedGreenTint | ||
) |
Construct a U_COLORADJUSTMENT structure.
Size | Size of this structure in bytes |
Flags | ColorAdjustment Enumeration |
IlluminantIndex | Illuminant Enumeration |
RedGamma | Red Gamma correction (range:2500:65000, 10000 is no correction) |
GreenGamma | Green Gamma correction (range:2500:65000, 10000 is no correction) |
BlueGamma | Blue Gamma correction (range:2500:65000, 10000 is no correction) |
ReferenceBlack | Values less than this are black (range:0:4000) |
ReferenceWhite | Values more than this are white (range:6000:10000) |
Contrast | Contrast adjustment (range:-100:100, 0 is no correction) |
Brightness | Brightness adjustment (range:-100:100, 0 is no correction) |
Colorfulness | Colorfulness adjustment (range:-100:100, 0 is no correction) |
RedGreenTint | Tine adjustment (range:-100:100, 0 is no correction) |
U_COLORREF colorref3_set | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue | ||
) |
Set a U_COLORREF value from separate R,G,B values.
red | Red component |
green | Green component |
blue | Blue component |
U_COLORREF colorref4_set | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue, | ||
uint8_t | Reserved | ||
) |
Set a U_COLORREF value from separate R,G,B, and Reserved values.
red | Red component |
green | Green component |
blue | Blue component |
Reserved | Reserved component |
char* createbrushindirect_set | ( | uint32_t * | ihBrush, |
EMFHANDLES * | eht, | ||
U_LOGBRUSH | lb | ||
) |
Allocate and construct a U_EMRCREATEBRUSHINDIRECT structure, create a handle and returns it Use this function instead of calling U_EMRCREATEBRUSHINDIRECT_set() directly.
ihBrush | handle to be used by new object |
eht | EMF handle table |
lb | Brush parameters |
char* createcolorspace_set | ( | uint32_t * | ihCS, |
EMFHANDLES * | eht, | ||
U_LOGCOLORSPACEA | lcs | ||
) |
Allocate and construct a U_EMRCREATECOLORSPACE structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACE_set() directly.
ihCS | ColorSpace handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
lcs | ColorSpace parameters |
char* createcolorspacew_set | ( | uint32_t * | ihCS, |
EMFHANDLES * | eht, | ||
U_LOGCOLORSPACEW | lcs, | ||
uint32_t | dwFlags, | ||
U_CBDATA | cbData, | ||
uint8_t * | Data | ||
) |
Allocate and construct a U_EMRCREATECOLORSPACEW structure, create a handle and returns it Use this function instead of calling U_EMRCREATECOLORSPACEW_set() directly.
ihCS | ColorSpace handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
lcs | ColorSpace parameters |
dwFlags | If low bit set Data is present |
cbData | Number of bytes of theData field. |
Data | (Optional, dwFlags & 1) color profile data |
char* createdibpatternbrushpt_set | ( | uint32_t * | ihBrush, |
EMFHANDLES * | eht, | ||
const uint32_t | iUsage, | ||
PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
const char * | Px | ||
) |
Allocate and construct a U_EMRCREATEDIBPATTERNBRUSHPT_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEDIBPATTERNBRUSHPT_set() directly.
ihBrush | handle to be used by new object |
eht | EMF handle table |
iUsage | DIBColors enumeration |
Bmi | Bitmap info |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* createmonobrush_set | ( | uint32_t * | ihBrush, |
EMFHANDLES * | eht, | ||
const uint32_t | iUsage, | ||
PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
const char * | Px | ||
) |
Allocate and construct a U_EMRCREATEMONOBRUSH_set structure, create a handle and returns it Use this function instead of calling U_EMRCREATEMONOBRUSH_set() directly.
ihBrush | handle to be used by new object |
eht | EMF handle table |
iUsage | DIBColors enumeration |
Bmi | Bitmap info |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* createpalette_set | ( | uint32_t * | ihPal, |
EMFHANDLES * | eht, | ||
U_LOGPALETTE | lgpl | ||
) |
Allocate and construct a U_EMRCREATEPALETTE structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPALETTE_set() directly.
ihPal | Palette handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
lgpl | PaletteFont parameters |
char* createpen_set | ( | uint32_t * | ihPen, |
EMFHANDLES * | eht, | ||
U_LOGPEN | lopn | ||
) |
Allocate and construct a U_EMRCREATEPEN structure, create a handle and returns it Use this function instead of calling U_EMRCREATEPEN_set() directly.
ihPen | handle to be used by new object |
eht | EMF handle table |
lopn | Pen parameters |
char* deleteobject_set | ( | uint32_t * | ihObject, |
EMFHANDLES * | eht | ||
) |
Allocate and construct a U_EMRDELETEOBJECT structure and also delete the requested object from the table. Use this function instead of calling U_EMRDELETEOBJECT_set() directly.
ihObject | Pointer to handle to delete. This value is set to 0 if the function succeeds. |
eht | EMF handle table |
Note that calling this function should always be conditional on the specifed object being defined. It is easy to write a program where deleteobject_set() is called in a sequence where, at the time, we know that ihObject is defined. Then a later modification, possibly quite far away in the code, causes it to be undefined. That distant change will result in a failure when this function reutrns. That problem cannot be handled here because the only values which may be returned are a valid U_EMRDELETEOBJECT record or a NULL, and other errors could result in the NULL. So the object must be checked before the call.
int device_size | ( | const int | xmm, |
const int | ymm, | ||
const float | dpmm, | ||
U_SIZEL * | szlDev, | ||
U_SIZEL * | szlMm | ||
) |
Set up fields for an EMR_HEADER from the physical device's width and height in mm and dots per millimeter. Typically this is something like 216,279,47.244 (Letter paper, 1200 DPI = 47.244 DPmm)
xmm | Device width in millimeters |
ymm | Device height in millimeters |
dpmm | Dots per millimeter |
szlDev | Device size structure in pixels |
szlMm | Device size structure in mm |
int DIB_to_RGBA | ( | const char * | px, |
const U_RGBQUAD * | ct, | ||
int | numCt, | ||
char ** | rgba_px, | ||
int | w, | ||
int | h, | ||
uint32_t | colortype, | ||
int | use_ct, | ||
int | invert | ||
) |
Convert one of many different types of DIB pixmaps to an RGBA 32 bit pixmap.
px | DIB pixel array |
ct | DIB color table |
numCt | DIB color table number of entries |
rgba_px | U_RGBA pixel array (32 bits), created by this routine, caller must free. |
w | Width of pixel array in the record |
h | Height of pixel array in the record |
colortype | DIB BitCount Enumeration |
use_ct | Kept for symmetry with RGBA_to_DIB, should be set to numCt |
invert | If DIB rows are in opposite order from RGBA rows |
int drawing_size | ( | const int | xmm, |
const int | ymm, | ||
const float | dpmm, | ||
U_RECTL * | rclBounds, | ||
U_RECTL * | rclFrame | ||
) |
Set up fields for an EMR_HEADER for drawing by physical size in mm and dots per millimeter. Technically rclBounds is supposed to be the extent of the drawing within the EMF, but libUEMF has no way of knowing this since it never actually draws anything. Instead this is set to the full drawing size. Coordinates are inclusive inclusive, so 297 -> 0,29699.
xmm | Drawing width in millimeters |
ymm | Drawing height in millimeters |
dpmm | Dots per millimeter |
rclBounds | Drawing size structure in pixels |
rclFrame | Drawing size structure in mm |
void dumpeht | ( | char * | string, |
unsigned int * | handle, | ||
EMFHANDLES * | eht | ||
) |
Dump an EMFHANDLES structure. Not for use in production code.
string | Text to output before dumping eht structure |
handle | Handle |
eht | EMFHANDLES structure to dump |
uint32_t* dx_set | ( | int32_t | height, |
uint32_t | weight, | ||
uint32_t | members | ||
) |
Make up an approximate dx array to pass to emrtext_set(), based on character height and weight.
Take abs. value of character height, get width by multiplying by 0.6, and correct weight approximately, with formula (measured on screen for one text line of Arial). Caller is responsible for free() on the returned pointer.
height | character height (absolute value will be used) |
weight | LF_Weight Enumeration (character weight) |
members | Number of entries to put into dx |
int emf_append | ( | U_ENHMETARECORD * | rec, |
EMFTRACK * | et, | ||
int | freerec | ||
) |
Append an EMF record to an emf in memory. This may reallocate buf memory.
rec | Record to append to EMF in memory |
et | EMF in memory |
freerec | If true, free rec after append |
int emf_finish | ( | EMFTRACK * | et, |
EMFHANDLES * | eht | ||
) |
Finalize the emf in memory and write it to the file.
et | EMF in memory |
eht | EMF handle table (peak handle number needed) |
FILE* emf_fopen | ( | const char * | filename, |
const int | mode | ||
) |
wrapper for fopen, works on any platform
filename | file to open (either ASCII or UTF-8) |
mode | U_READ or U_WRITE (these map to "rb" and "wb") |
int emf_free | ( | EMFTRACK ** | et | ) |
Release memory for an emf structure in memory. Call this after emf_finish().
et | EMF in memory |
int emf_htable_create | ( | uint32_t | initsize, |
uint32_t | chunksize, | ||
EMFHANDLES ** | eht | ||
) |
Create a handle table. Entries filled with 0 are empty, entries >0 hold a handle.
initsize | Initialize with space for this number of handles |
chunksize | When needed increase space by this number of handles |
eht | EMF handle table |
int emf_htable_delete | ( | uint32_t * | ih, |
EMFHANDLES * | eht | ||
) |
Delete an entry from the handle table. Move it back onto the stack. The specified slot is filled with a 0.
ih | handle |
eht | EMF handle table |
int emf_htable_free | ( | EMFHANDLES ** | eht | ) |
Free all memory in an htable. Sets the pointer to NULL.
eht | EMF handle table |
int emf_htable_insert | ( | uint32_t * | ih, |
EMFHANDLES * | eht | ||
) |
Returns the index of the first free slot. Call realloc() if needed. The slot is set to handle (indicates occupied) and the peak value is adjusted.
ih | handle |
eht | EMF handle table |
int emf_readdata | ( | const char * | filename, |
char ** | contents, | ||
size_t * | length | ||
) |
Retrieve contents of an EMF file by name.
filename | Name of file to open, including the path |
contents | Contents of the file. Buffer must be free()'d by caller. |
length | Number of bytes in Contents |
int emf_start | ( | const char * | name, |
const uint32_t | initsize, | ||
const uint32_t | chunksize, | ||
EMFTRACK ** | et | ||
) |
Start constructing an emf in memory. Supply the file name and initial size.
name | EMF filename (will be opened) |
initsize | Initialize EMF in memory to hold this many bytes |
chunksize | When needed increase EMF in memory by this number of bytes |
et | EMF in memory |
int emr_arc_points | ( | PU_ENHMETARECORD | record, |
int * | f1, | ||
int | f2, | ||
PU_PAIRF | center, | ||
PU_PAIRF | start, | ||
PU_PAIRF | end, | ||
PU_PAIRF | size | ||
) |
Derive from an EMF arc, chord, or pie the center, start, and end points, and the bounding rectangle.
record | U_EMRPIE, U_EMRCHORD, or _EMRARC record |
f1 | 1 if rotation angle >= 180, else 0 |
f2 | Rotation direction, 1 if counter clockwise, else 0 |
center | Center coordinates |
start | Start coordinates (point on the ellipse defined by rect) |
end | End coordinates (point on the ellipse defined by rect) |
size | W,H of the x,y axes of the bounding rectangle. |
int emr_arc_points_common | ( | PU_RECTL | rclBox, |
PU_POINTL | ArcStart, | ||
PU_POINTL | ArcEnd, | ||
int * | f1, | ||
int | f2, | ||
PU_PAIRF | center, | ||
PU_PAIRF | start, | ||
PU_PAIRF | end, | ||
PU_PAIRF | size | ||
) |
Derive from bounding rect, start and end radials, for arc, chord, or pie, the center, start, and end points, and the bounding rectangle.
rclBox | bounding rectangle |
ArcStart | start of arc |
ArcEnd | end of arc |
f1 | 1 if rotation angle >= 180, else 0 |
f2 | Rotation direction, 1 if counter clockwise, else 0 |
center | Center coordinates |
start | Start coordinates (point on the ellipse defined by rect) |
end | End coordinates (point on the ellipse defined by rect) |
size | W,H of the x,y axes of the bounding rectangle. |
char* emr_dup | ( | const char * | emr | ) |
Duplicate an EMR record.
emr | record to duplicate |
uint32_t emr_properties | ( | uint32_t | type | ) |
Look up the properties (a bit map) of a type of EMR record. Bits that may be set are defined in "Draw Properties" in uemf.h, they are U_DRAW_NOTEMPTY, etc..
type | EMR record type. If U_EMR_INVALID release memory. (There is no U_EMR_INVALID EMR record type) |
char* emrtext_set | ( | U_POINTL | ptlReference, |
U_NUM_STR | NumString, | ||
uint32_t | cbChar, | ||
void * | String, | ||
uint32_t | fOptions, | ||
U_RECTL | rcl, | ||
uint32_t * | Dx | ||
) |
Allocate and create a U_EMRTEXT structure followed by its variable pieces via a char* pointer. Dx cannot be NULL, if the calling program has no appropriate values call dx_set() first.
ptlReference | String start coordinates |
NumString | Number of characters in string, does NOT include a terminator |
cbChar | Number of bytes per character |
String | String to write |
fOptions | ExtTextOutOptions Enumeration |
rcl | (Optional, when fOptions & 7) grayed/clipping/opaque rectangle |
Dx | Character spacing array from the start of the RECORD |
char* extcreatefontindirectw_set | ( | uint32_t * | ihFont, |
EMFHANDLES * | eht, | ||
const char * | elf, | ||
const char * | elfw | ||
) |
Allocate and construct a U_EMREXTCREATEFONTINDIRECTW structure, create a handle and returns it Use this function instead of calling U_EMREXTCREATEFONTINDIRECTW_set() directly.
ihFont | Font handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
elf | Pointer to Font parameters asPU_LOGFONT |
elfw | Pointer to Font parameters as U_LOGFONT_PANOSE |
char* extcreatepen_set | ( | uint32_t * | ihPen, |
EMFHANDLES * | eht, | ||
PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px, | ||
PU_EXTLOGPEN | elp | ||
) |
Allocate and construct a U_EMREXTCREATEPEN structure, create a handle and return it. Use this function instead of calling U_EMREXTCREATEPEN_set() directly.
ihPen | handle to be used by new object |
eht | EMF handle table |
Bmi | bitmapbuffer |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | pixel array (NULL if cbPx == 0) |
elp | Pen parameters (Size is Variable!!!!) |
PU_EXTLOGPEN extlogpen_set | ( | uint32_t | elpPenStyle, |
uint32_t | elpWidth, | ||
uint32_t | elpBrushStyle, | ||
U_COLORREF | elpColor, | ||
int32_t | elpHatch, | ||
U_NUM_STYLEENTRY | elpNumEntries, | ||
U_STYLEENTRY * | elpStyleEntry | ||
) |
Allocate and construct a U_EXTLOGPEN structure.
elpPenStyle | PenStyle Enumeration |
elpWidth | Width in logical units (elpPenStyle & U_PS_GEOMETRIC) or 1 (pixel) |
elpBrushStyle | LB_Style Enumeration |
elpColor | Pen color |
elpHatch | HatchStyle Enumeration |
elpNumEntries | Count of StyleEntry array |
elpStyleEntry | Array of StyleEntry (For user specified dot/dash patterns) |
char* fillrgn_set | ( | uint32_t * | ihBrush, |
EMFHANDLES * | eht, | ||
const U_RECTL | rclBounds, | ||
const PU_RGNDATA | RgnData | ||
) |
Allocate and construct a U_EMRFILLRGN structure, create a handle and returns it Use this function instead of calling U_EMRFILLRGN_set() directly.
ihBrush | Brush handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
rclBounds | Bounding rectangle in device units |
RgnData | Pointer to a U_RGNDATA structure |
Find the bounding rectangle from a polyline of a given width.
count | number of points in the polyline |
pts | the polyline |
width | width of drawn line |
U_RECT findbounds16 | ( | uint32_t | count, |
PU_POINT16 | pts, | ||
uint32_t | width | ||
) |
Find the bounding rectangle from a polyline of a given width.
count | number of points in the polyline |
pts | the polyline |
width | width of drawn line |
char* framergn_set | ( | uint32_t * | ihBrush, |
EMFHANDLES * | eht, | ||
const U_RECTL | rclBounds, | ||
const U_SIZEL | szlStroke, | ||
const PU_RGNDATA | RgnData | ||
) |
Allocate and construct a U_EMRFRAMERGN structure, create a handle and returns it Use this function instead of calling U_EMRFRAMERGN_set() directly.
ihBrush | Brush handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
rclBounds | Bounding rectangle in device units |
szlStroke | W & H of Brush stroke |
RgnData | Pointer to a U_RGNDATA structure |
int get_DIB_params | ( | void * | pEmr, |
uint32_t | offBitsSrc, | ||
uint32_t | offBmiSrc, | ||
const char ** | px, | ||
const U_RGBQUAD ** | ct, | ||
uint32_t * | numCt, | ||
uint32_t * | width, | ||
uint32_t * | height, | ||
uint32_t * | colortype, | ||
uint32_t * | invert | ||
) |
Get the DIB parameters from the BMI of the record for use by DBI_to_RGBA()
pEmr | pointer to EMR record that has a U_BITMAPINFO and bitmap |
offBitsSrc | Offset to the bitmap |
offBmiSrc | Offset to the U_BITMAPINFO |
px | pointer to DIB pixel array in pEmr |
ct | pointer to DIB color table in pEmr |
numCt | DIB color table number of entries, for PNG or JPG returns the number of bytes in the image |
width | Width of pixel array |
height | Height of pixel array (always returned as a positive number) |
colortype | DIB BitCount Enumeration |
invert | If DIB rows are in opposite order from RGBA rows |
int get_real_color_count | ( | const char * | Bmih | ) |
Get the actual number of colors in the color table from the BitMapInfoHeader.
Bmih | char * pointer to the U_BITMAPINFOHEADER |
BitmapInfoHeader may list 0 for some types which implies the maximum value. If the image is big enough, that is set by the bit count, as in 256 for an 8 bit image. If the image is smaller it is set by width * height. Note, this may be called by WMF code, so it is not safe to assume the data is aligned.
int get_real_color_icount | ( | int | Colors, |
int | BitCount, | ||
int | Width, | ||
int | Height | ||
) |
Get the actual number of colors in the color table from the ClrUsed, BitCount, Width, and Height.
Colors | Number of colors in the table. |
BitCount | BitCount Enumeration |
Width | bitmap width |
Height | bitmap height |
U_LOGBRUSH logbrush_set | ( | uint32_t | lbStyle, |
U_COLORREF | lbColor, | ||
int32_t | lbHatch | ||
) |
Construct a U_LOGBRUSH structure.
lbStyle | LB_Style Enumeration |
lbColor | Brush color |
lbHatch | HatchStyle Enumertaion |
U_LOGCOLORSPACEA logcolorspacea_set | ( | int32_t | lcsCSType, |
int32_t | lcsIntent, | ||
U_CIEXYZTRIPLE | lcsEndpoints, | ||
U_LCS_GAMMARGB | lcsGammaRGB, | ||
char * | lcsFilename | ||
) |
Construct a U_LOGCOLORSPACEA structure.
lcsCSType | LCS_CSType Enumeration |
lcsIntent | LCS_Intent Enumeration |
lcsEndpoints | CIE XYZ color space endpoints |
lcsGammaRGB | Gamma For RGB |
lcsFilename | Could name an external color profile file, otherwise empty string |
U_LOGCOLORSPACEW logcolorspacew_set | ( | int32_t | lcsCSType, |
int32_t | lcsIntent, | ||
U_CIEXYZTRIPLE | lcsEndpoints, | ||
U_LCS_GAMMARGB | lcsGammaRGB, | ||
uint16_t * | lcsFilename | ||
) |
Construct a U_LOGCOLORSPACEW structure.
lcsCSType | LCS_CSType Enumeration |
lcsIntent | LCS_Intent Enumeration |
lcsEndpoints | CIE XYZ color space endpoints |
lcsGammaRGB | Gamma For RGB |
lcsFilename | Could name an external color profile file, otherwise empty string |
U_LOGFONT_PANOSE logfont_panose_set | ( | U_LOGFONT | elfLogFont, |
uint16_t * | elfFullName, | ||
uint16_t * | elfStyle, | ||
uint32_t | elfStyleSize, | ||
U_PANOSE | elfPanose | ||
) |
Construct a U_LOGFONT_PANOSE structure.
elfLogFont | Basic font attributes |
elfFullName | Font full name, truncates at U_LF_FULLFACESIZE, smaller must be null terminated |
elfStyle | Font style, truncates at U_LF_FULLFACESIZE, smaller must be null terminated |
elfStyleSize | Font hinting starting at this point size, if 0, starts at Height |
elfPanose | Panose Object. If all zero, it is ignored. |
U_LOGFONT logfont_set | ( | int32_t | lfHeight, |
int32_t | lfWidth, | ||
int32_t | lfEscapement, | ||
int32_t | lfOrientation, | ||
int32_t | lfWeight, | ||
uint8_t | lfItalic, | ||
uint8_t | lfUnderline, | ||
uint8_t | lfStrikeOut, | ||
uint8_t | lfCharSet, | ||
uint8_t | lfOutPrecision, | ||
uint8_t | lfClipPrecision, | ||
uint8_t | lfQuality, | ||
uint8_t | lfPitchAndFamily, | ||
uint16_t * | lfFaceName | ||
) |
Construct a U_LOGFONT structure.
lfHeight | Height in Logical units |
lfWidth | Average Width in Logical units |
lfEscapement | Angle in 0.1 degrees betweem escapement vector and X axis |
lfOrientation | Angle in 0.1 degrees between baseline and X axis |
lfWeight | LF_Weight Enumeration |
lfItalic | Italics: 0 or 1 |
lfUnderline | Underline: 0 or 1 |
lfStrikeOut | Strikeout: 0 or 1 |
lfCharSet | LF_CharSet Enumeration |
lfOutPrecision | LF_OutPrecision Enumeration |
lfClipPrecision | LF_ClipPrecision Enumeration |
lfQuality | LF_Quality Enumeration |
lfPitchAndFamily | LF_PitchAndFamily Enumeration |
lfFaceName | Name of font. truncates at U_LF_FACESIZE, smaller must be null terminated |
PU_LOGPALETTE logpalette_set | ( | U_NUM_LOGPLTNTRY | palNumEntries, |
PU_LOGPLTNTRY * | palPalEntry | ||
) |
Allocate and construct a U_LOGPALETTE structure.
palNumEntries | Number of U_LOGPLTNTRY objects |
palPalEntry | array, PC_Entry Enumeration |
U_LOGPEN logpen_set | ( | uint32_t | lopnStyle, |
U_POINT | lopnWidth, | ||
U_COLORREF | lopnColor | ||
) |
U_LOGPLTNTRY logpltntry_set | ( | uint8_t | peReserved, |
uint8_t | peRed, | ||
uint8_t | peGreen, | ||
uint8_t | peBlue | ||
) |
Construct a U_LOGPLTNTRY structure.
peReserved | Ignore |
peRed | Palette entry Red Intensity |
peGreen | Palette entry Green Intensity |
peBlue | Palette entry Blue Intensity |
int memprobe | ( | const void * | buf, |
size_t | size | ||
) |
Debugging utility, used with valgrind to find uninitialized values. Not for use in production code.
buf | memory area to examine ! |
size | length in bytes of buf! |
U_PANOSE panose_set | ( | uint8_t | bFamilyType, |
uint8_t | bSerifStyle, | ||
uint8_t | bWeight, | ||
uint8_t | bProportion, | ||
uint8_t | bContrast, | ||
uint8_t | bStrokeVariation, | ||
uint8_t | bArmStyle, | ||
uint8_t | bLetterform, | ||
uint8_t | bMidline, | ||
uint8_t | bXHeight | ||
) |
Construct a U_PANOSE structure.
bFamilyType | FamilyType Enumeration |
bSerifStyle | SerifType Enumeration |
bWeight | Weight Enumeration |
bProportion | Proportion Enumeration |
bContrast | Contrast Enumeration |
bStrokeVariation | StrokeVariation Enumeration |
bArmStyle | ArmStyle Enumeration |
bLetterform | Letterform Enumeration |
bMidline | Midline Enumeration |
bXHeight | XHeight Enumeration |
U_PIXELFORMATDESCRIPTOR pixelformatdescriptor_set | ( | uint32_t | dwFlags, |
uint8_t | iPixelType, | ||
uint8_t | cColorBits, | ||
uint8_t | cRedBits, | ||
uint8_t | cRedShift, | ||
uint8_t | cGreenBits, | ||
uint8_t | cGreenShift, | ||
uint8_t | cBlueBits, | ||
uint8_t | cBlueShift, | ||
uint8_t | cAlphaBits, | ||
uint8_t | cAlphaShift, | ||
uint8_t | cAccumBits, | ||
uint8_t | cAccumRedBits, | ||
uint8_t | cAccumGreenBits, | ||
uint8_t | cAccumBlueBits, | ||
uint8_t | cAccumAlphaBits, | ||
uint8_t | cDepthBits, | ||
uint8_t | cStencilBits, | ||
uint8_t | cAuxBuffers, | ||
uint8_t | iLayerType, | ||
uint8_t | bReserved, | ||
uint32_t | dwLayerMask, | ||
uint32_t | dwVisibleMask, | ||
uint32_t | dwDamageMask | ||
) |
Construct a U_PIXELFORMATDESCRIPTOR structure.
dwFlags | PFD_dwFlags Enumeration |
iPixelType | PFD_iPixelType Enumeration |
cColorBits | RGBA: total bits per pixel |
cRedBits | Red bits per pixel |
cRedShift | Red shift to data bits |
cGreenBits | Green bits per pixel |
cGreenShift | Green shift to data bits |
cBlueBits | Blue bits per pixel |
cBlueShift | Blue shift to data bits |
cAlphaBits | Alpha bits per pixel |
cAlphaShift | Alpha shift to data bits |
cAccumBits | Accumulator buffer, total bitplanes |
cAccumRedBits | Red accumulator buffer bitplanes |
cAccumGreenBits | Green accumulator buffer bitplanes |
cAccumBlueBits | Blue accumulator buffer bitplanes |
cAccumAlphaBits | Alpha accumulator buffer bitplanes |
cDepthBits | Depth of Z-buffer |
cStencilBits | Depth of stencil buffer |
cAuxBuffers | Depth of auxilliary buffers (not supported) |
iLayerType | PFD_iLayerType Enumeration, may be ignored |
bReserved | Bits 0:3/4:7 are number of Overlay/Underlay planes |
dwLayerMask | may be ignored |
dwVisibleMask | color or index of underlay plane |
dwDamageMask | may be ignored |
U_POINT16 point16_set | ( | int16_t | x, |
int16_t | y | ||
) |
Set point16 objects with 16 bit X,Y values.
x | X coordinate |
y | Y coordinate |
PU_POINT point16_to_point | ( | PU_POINT16 | points, |
int | count | ||
) |
PU_POINT16 point16_transform | ( | PU_POINT16 | points, |
int | count, | ||
U_XFORM | xform | ||
) |
Allocate and construct an array of U_POINT16 objects which has been subjected to a U_XFORM.
points | pointer to the source U_POINT16 structures |
count | number of members in points |
xform | U_XFORM to apply |
Transformed src points {x0,y0} appear at {x0*xscale + x, y0*yscale + y}
U_POINTL point32_set | ( | int32_t | x, |
int32_t | y | ||
) |
Set pointl objects with X,Y values.
x | X coordinate |
y | Y coordinate |
PU_POINT16 point_to_point16 | ( | PU_POINT | points, |
int | count | ||
) |
Allocate and construct an array of U_POINT objects which has been subjected to a U_XFORM.
points | pointer to the source U_POINT structures |
count | number of members in points |
xform | U_XFORM to apply |
May also be used to modify U_RECT by doubling the count and casting the pointer.
Set rect and rectl objects from Upper Left and Lower Right corner points.
ul | upper left corner of rectangle |
lr | lower right corner of rectangle |
int RGBA_to_DIB | ( | char ** | px, |
uint32_t * | cbPx, | ||
PU_RGBQUAD * | ct, | ||
int * | numCt, | ||
const char * | rgba_px, | ||
int | w, | ||
int | h, | ||
int | stride, | ||
uint32_t | colortype, | ||
int | use_ct, | ||
int | invert | ||
) |
Convert a U_RGBA 32 bit pixmap to one of many different types of DIB pixmaps.
Conversions to formats using color tables assume that the color table can hold every color in the input image. If that assumption is false then the conversion will fail. Conversion from 8 bit color to N bit colors (N<8) do so by shifting the appropriate number of bits.
px | DIB pixel array |
cbPx | DIB pixel array size in bytes |
ct | DIB color table |
numCt | DIB color table number of entries |
rgba_px | U_RGBA pixel array (32 bits) |
w | Width of pixel array |
h | Height of pixel array |
stride | Row stride of input pixel array in bytes |
colortype | DIB BitCount Enumeration |
use_ct | If true use color table (only for 1-16 bit DIBs). |
invert | If DIB rows are in opposite order from RGBA rows |
char* RGBA_to_RGBA | ( | char * | rgba_px, |
int | w, | ||
int | h, | ||
int | sl, | ||
int | st, | ||
int * | eew, | ||
int * | eeh | ||
) |
Extract a subset of an RGBA bitmap array. Frees the incoming bitmap array IF a subset is extracted, otherwise it is left alone. If the entire array is extracted it just returns the incoming pointer. If the subset requested is partially outside of the bitmap the region is clipped to the bitmap boundaries and extracted. This seems to be a (very) grey area in EMF files, and even different Microsoft applications do not always do the same thing. For instance, XP Preview gives some different images for EMR_BITBLT records than does the "import image" (but not unpacked) view in PowerPoint. Since all of these states are probably best viewed as undefined or errors we can only try to do something reasonable and not blow up when encountering one.
rgba_px | U_RGBA pixel array (32 bits), created by this routine, caller must free. |
w | Width of pixel array in the record |
h | Height of pixel array in the record |
sl | start left position in the pixel array in the record to start extracting |
st | start top position in the pixel array in the record to start extracting |
eew | Width of pixel array to extract |
eeh | Height of pixel array to extract |
U_RGBQUAD rgbquad_set | ( | uint8_t | red, |
uint8_t | green, | ||
uint8_t | blue, | ||
uint8_t | reserved | ||
) |
Set a U_RGBQUAD value from separate R,G,B, Reserved values.
red | Red component |
green | Green component |
blue | Blue component |
reserved | Reserved component |
PU_RGNDATA rgndata_set | ( | U_RGNDATAHEADER | rdh, |
PU_RECTL | Buffer | ||
) |
U_RGNDATAHEADER rgndataheader_set | ( | U_NUM_RECTL | nCount, |
U_RECTL | rclBounds | ||
) |
Construct a U_RGNDATAHEADER structure.
nCount | Number of rectangles in region |
rclBounds | Region bounds |
char* selectobject_set | ( | uint32_t | ihObject, |
EMFHANDLES * | eht | ||
) |
Allocate and construct a U_EMRSELECTOBJECT structure, checks that the handle specified is one that can actually be selected. Use this function instead of calling U_EMRSELECTOBJECT_set() directly.
ihObject | handle to select |
eht | EMF handle table |
char* setpaletteentries_set | ( | uint32_t * | ihPal, |
EMFHANDLES * | eht, | ||
const uint32_t | iStart, | ||
const U_NUM_LOGPLTNTRY | cEntries, | ||
const PU_LOGPLTNTRY | aPalEntries | ||
) |
Allocate and construct a U_EMRSETPALETTEENTRIES structure, create a handle and returns it Use this function instead of calling U_EMRSETPALETTEENTRIES_set() directly.
ihPal | Palette handle, will be created and returned |
eht | Pointer to structure holding all EMF handles |
iStart | First Palette entry in selected object to set |
cEntries | Number of Palette entries in selected object to set |
aPalEntries | Values to set with |
U_SIZEL sizel_set | ( | int32_t | x, |
int32_t | y | ||
) |
Set sizel objects with X,Y values.
x | X coordinate |
y | Y coordinate |
char* textcomment_set | ( | const char * | string | ) |
Allocate and construct a U_EMRCOMMENT structure with a UTF8 string. A U_EMRCOMMENT contains application specific data, and that may include contain null characters. This function may be used when the comment only incluces UT8 text.
string | UTF8 string to store in the comment |
PU_TRIVERTEX trivertex_transform | ( | PU_TRIVERTEX | tv, |
int | count, | ||
U_XFORM | xform | ||
) |
Allocate and construct an array of U_TRIVERTEX objects which has been subjected to a U_XFORM.
tv | pointer to the source U_TRIVERTEX structures |
count | number of members in points |
xform | U_XFORM to apply |
Transformed Trivertex points {x0,y0} appear at {x0*xscale + x, y0*yscale + y}
char* U_emr_names | ( | unsigned int | idx | ) |
Look up the name of the EMR record by type. Returns U_EMR_INVALID if out of range.
idx | EMR record type. |
char* U_EMRABORTPATH_set | ( | void | ) |
Allocate and construct a U_EMR_ABORTPATH record.
char* U_EMRALPHABLEND_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const U_BLEND | Blend, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_ALPHABLEND record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination width in logical units |
Src | Source UL corner in logical units |
cSrc | Src W & H in logical units |
xformSrc | Transform to apply to source |
crBkColorSrc | Background color |
iUsageSrc | DIBcolors Enumeration |
Blend | Blend function |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRANGLEARC_set | ( | const U_POINTL | ptlCenter, |
const uint32_t | nRadius, | ||
const U_FLOAT | eStartAngle, | ||
const U_FLOAT | eSweepAngle | ||
) |
Allocate and construct a U_EMR_ANGLEARC record.
ptlCenter | Center in logical units |
nRadius | Radius in logical units |
eStartAngle | Starting angle in degrees (counter clockwise from x axis) |
eSweepAngle | Sweep angle in degrees |
Allocate and construct a U_EMR_ARC record.
rclBox | bounding rectangle in logical units |
ptlStart | Start point in logical units |
ptlEnd | End point in logical units |
Allocate and construct a U_EMR_ARCTO record.
rclBox | bounding rectangle in logical units |
ptlStart | Start point in logical units |
ptlEnd | End point in logical units |
Note that the draw begins with a line from the current point to ptlStart, which is not indicated in the Microsoft EMF documentation for this record.
char* U_EMRBEGINPATH_set | ( | void | ) |
Allocate and construct a U_EMR_BEGINPATH record.
char* U_EMRBITBLT_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const uint32_t | dwRop, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_BITBLT record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination width in logical units |
Src | Source rectangle UL corner in logical units |
xformSrc | Source bitmap transform (world to page coordinates) |
crBkColorSrc | Source bitmap background color |
iUsageSrc | DIBcolors Enumeration |
dwRop | Ternary Raster Operation enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
Allocate and construct a U_EMR_CHORD record.
rclBox | bounding rectangle in logical units |
ptlStart | Start point in logical units |
ptlEnd | End point in logical units |
char* U_EMRCLOSEFIGURE_set | ( | void | ) |
Allocate and construct a U_EMR_CLOSEFIGURE record.
char* U_EMRCOMMENT_set | ( | const U_CBDATA | cbData, |
const char * | Data | ||
) |
Allocate and construct a U_EMR_COMMENT record.
cbData | Number of bytes in comment |
Data | Comment (any binary data, interpretation is program specific) |
char* U_EMRCREATEBRUSHINDIRECT_set | ( | const uint32_t | ihBrush, |
const U_LOGBRUSH | lb | ||
) |
Allocate and construct a U_EMR_CREATEBRUSHINDIRECT record. Use createbrushindirect_set() instead of calling this function directly.
ihBrush | Index to place object in EMF object table (this entry must not yet exist) |
lb | Brush properties |
char* U_EMRCREATECOLORSPACE_set | ( | const uint32_t | ihCS, |
const U_LOGCOLORSPACEA | lcs | ||
) |
Allocate and construct a U_EMR_CREATECOLORSPACE record. Use createcolorspace_set() instead of calling this function directly.
ihCS | Index to place object in EMF object table (this entry must not yet exist) |
lcs | ColorSpace parameters |
char* U_EMRCREATECOLORSPACEW_set | ( | const uint32_t | ihCS, |
const U_LOGCOLORSPACEW | lcs, | ||
const uint32_t | dwFlags, | ||
const U_CBDATA | cbData, | ||
const uint8_t * | Data | ||
) |
Allocate and construct a U_EMR_CREATECOLORSPACEW record. Use createcolorspacew_set() instead of calling this function directly.
ihCS | Index to place object in EMF object table (this entry must not yet exist) |
lcs | ColorSpace parameters |
dwFlags | If low bit set Data is present |
cbData | Number of bytes of theData field. |
Data | (Optional, dwFlags & 1) color profile data |
char* U_EMRCREATEDIBPATTERNBRUSHPT_set | ( | const uint32_t | ihBrush, |
const uint32_t | iUsage, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
const char * | Px | ||
) |
Allocate and construct a U_EMR_CREATEDIBPATTERNBRUSHPT record. Use createdibpatternbrushpt_set() instead of calling this function directly.
ihBrush | Index to place object in EMF object table (this entry must not yet exist) |
iUsage | DIBcolors Enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO + pixel array) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRCREATEMONOBRUSH_set | ( | const uint32_t | ihBrush, |
const uint32_t | iUsage, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
const char * | Px | ||
) |
Allocate and construct a U_EMR_CREATEMONOBRUSH record.
ihBrush | Index to place object in EMF object table (this entry must not yet exist) |
iUsage | DIBcolors Enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO + pixel array) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRCREATEPALETTE_set | ( | const uint32_t | ihPal, |
const U_LOGPALETTE | lgpl | ||
) |
Allocate and construct a U_EMR_CREATEPALETTE record. Use createpalette_set() instead of calling this function directly.
ihPal | Index to place object in EMF object table (this entry must not yet exist) |
lgpl | Palette properties |
char* U_EMRCREATEPEN_set | ( | const uint32_t | ihPen, |
const U_LOGPEN | lopn | ||
) |
Allocate and construct a U_EMR_CREATEPEN record. Use createpen_set() instead of calling this function directly.
ihPen | Handle of created pen |
lopn | U_LOGPEN structure describing this pen |
char* U_EMRDELETECOLORSPACE_set | ( | const uint32_t | ihCS | ) |
Allocate and construct a U_EMR_DELETECOLORSPACE record.
ihCS | Index of object in EMF object table |
char* U_EMRDELETEOBJECT_set | ( | const uint32_t | ihObject | ) |
Allocate and construct a U_EMR_DELETEOBJECT record. Use deleteobject_set() instead of calling this function directly.
ihObject | Number of a stock or created object |
char* U_EMRELLIPSE_set | ( | const U_RECTL | rclBox | ) |
Allocate and construct a U_EMR_ELLIPSE record.
rclBox | bounding rectangle in logical units |
char* U_EMRENDPATH_set | ( | void | ) |
Allocate and construct a U_EMR_ENDPATH record.
char* U_EMREOF_set | ( | const U_CBPLENTRIES | cbPalEntries, |
const PU_LOGPLTNTRY | PalEntries, | ||
EMFTRACK * | et | ||
) |
Allocate and construct a U_EMR_EOF record.
cbPalEntries | Number of palette entries |
PalEntries | (optional) array of PalEntries |
et | tracking information, needed for nSizeLast calculation |
char* U_EMREXCLUDECLIPRECT_set | ( | const U_RECTL | rclClip | ) |
Allocate and construct a U_EMR_EXCLUDECLIPRECT record.
rclClip | Clipping Region |
char* U_EMREXTCREATEFONTINDIRECTW_set | ( | const uint32_t | ihFont, |
const char * | elf, | ||
const char * | elfw | ||
) |
Allocate and construct a U_EMR_EXTCREATEFONTINDIRECTW record. Use extcreatefontindirectw_set() instead of calling this function directly.
ihFont | Index of the font in the EMF object table |
elf | Font parameters as U_LOGFONT |
elfw | Font parameters as U_LOGFONT_PANOSE |
char* U_EMREXTCREATEPEN_set | ( | const uint32_t | ihPen, |
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px, | ||
const PU_EXTLOGPEN | elp | ||
) |
Allocate and construct a U_EMR_EXTCREATEPEN record. Use extcreatepen_set() instead of calling this function directly.
ihPen | ihPen Index to place object in EMF object table (this entry must not yet exist) |
Bmi | Bmi bitmapbuffer |
cbPx | cbPx Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | Px pixel array (NULL if cbPx == 0) |
elp | elp Pen parameters (Size is Variable!!!!) |
char* U_EMREXTFLOODFILL_set | ( | const U_POINTL | ptlStart, |
const U_COLORREF | crColor, | ||
const uint32_t | iMode | ||
) |
Allocate and construct a U_EMR_EXTFLOODFILL record.
ptlStart | Start point in logical units |
crColor | Color to fill with |
iMode | FloodFill Enumeration |
char* U_EMREXTSELECTCLIPRGN_set | ( | const uint32_t | iMode, |
const PU_RGNDATA | RgnData | ||
) |
Allocate and construct a U_EMR_EXTSELECTCLIPRGN record.
iMode | RegionMode Enumeration |
RgnData | Variable size U_RGNDATA structure |
char* U_EMREXTTEXTOUTA_set | ( | const U_RECTL | rclBounds, |
const uint32_t | iGraphicsMode, | ||
const U_FLOAT | exScale, | ||
const U_FLOAT | eyScale, | ||
const PU_EMRTEXT | emrtext | ||
) |
Allocate and construct a U_EMR_EXTTEXTOUTA record.
rclBounds | Bounding rectangle in device units |
iGraphicsMode | Graphics mode Enumeration |
exScale | scale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE) |
eyScale | scale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE) |
emrtext | Text parameters |
char* U_EMREXTTEXTOUTW_set | ( | const U_RECTL | rclBounds, |
const uint32_t | iGraphicsMode, | ||
const U_FLOAT | exScale, | ||
const U_FLOAT | eyScale, | ||
const PU_EMRTEXT | emrtext | ||
) |
Allocate and construct a U_EMR_EXTTEXTOUTW record.
rclBounds | Bounding rectangle in device units |
iGraphicsMode | Graphics mode Enumeration |
exScale | scale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE) |
eyScale | scale to 0.01 mm units ( only if iGraphicsMode & GM_COMPATIBLE) |
emrtext | Text parameters |
char* U_EMRFILLPATH_set | ( | const U_RECTL | rclBox | ) |
Allocate and construct a U_EMR_FILLPATH record.
rclBox | Bounding rectangle in device units |
U_EMR_FILLPATH closes the open figure before filling.
char* U_EMRFILLRGN_set | ( | const U_RECTL | rclBounds, |
const uint32_t | ihBrush, | ||
const PU_RGNDATA | RgnData | ||
) |
Allocate and construct a U_EMR_FILLRGN record. Use fillrgn_set() instead of calling this function directly.
rclBounds | Bounding rectangle in device units |
ihBrush | Index of a Brush object in the EMF object table |
RgnData | Pointer to a U_RGNDATA structure |
char* U_EMRFLATTENPATH_set | ( | void | ) |
Allocate and construct a U_EMR_FLATTENPATH record.
char* U_EMRFRAMERGN_set | ( | const U_RECTL | rclBounds, |
const uint32_t | ihBrush, | ||
const U_SIZEL | szlStroke, | ||
const PU_RGNDATA | RgnData | ||
) |
Allocate and construct a U_EMR_FRAMERGN record. Use framegrn_set() instead of calling this function directly.
rclBounds | Bounding rectangle in device units |
ihBrush | Index of a Brush object in the EMF object table |
szlStroke | W & H of Brush stroke |
RgnData | Pointer to a U_RGNDATA structure |
char* U_EMRGRADIENTFILL_set | ( | const U_RECTL | rclBounds, |
const U_NUM_TRIVERTEX | nTriVert, | ||
const U_NUM_GRADOBJ | nGradObj, | ||
const uint32_t | ulMode, | ||
const PU_TRIVERTEX | TriVert, | ||
const uint32_t * | GradObj | ||
) |
Allocate and construct a U_EMR_TRANSPARENTBLT record.
rclBounds | Bounding rectangle in device units |
nTriVert | Number of TriVertex objects in TriVert |
nGradObj | Number of gradient triangle/rectangle objects |
ulMode | Gradientfill Enumeration (determines Triangle/Rectangle) |
TriVert | Array of TriVertex objects |
GradObj | Array of gradient objects (each has 2 [rect] or 3 [triangle] indices into TriVert array) |
char* U_EMRHEADER_set | ( | const U_RECTL | rclBounds, |
const U_RECTL | rclFrame, | ||
U_PIXELFORMATDESCRIPTOR *const | pfmtDesc, | ||
U_CBSTR | nDesc, | ||
uint16_t *const | Description, | ||
const U_SIZEL | szlDevice, | ||
const U_SIZEL | szlMillimeters, | ||
const uint32_t | bOpenGL | ||
) |
Allocate and construct a U_EMRHEADER record.
rclBounds | Bounding rectangle in device units |
rclFrame | Bounding rectangle in 0.01 mm units |
pfmtDesc | Pointer to a PixelFormatDescriptor |
nDesc | number of characters in Description, will include first three '\0' |
Description | Description, formatted like: text1\0text2\0\0 |
szlDevice | Reference device size in pixels |
szlMillimeters | Reference device size in 0.01 mm |
bOpenGL | nonZero if OpenGL commands are included |
char* U_EMRINTERSECTCLIPRECT_set | ( | const U_RECTL | rclClip | ) |
Allocate and construct a U_EMR_INTERSECTCLIPRECT record.
rclClip | Clipping Region |
char* U_EMRINVERTRGN_set | ( | const PU_RGNDATA | RgnData | ) |
Allocate and construct a U_EMR_INVERTRGN record.
RgnData | Variable size U_RGNDATA structure |
char* U_EMRLINETO_set | ( | const U_POINTL | ptl | ) |
Allocate and construct a U_EMR_LINETO record.
ptl | Point coordinates |
char* U_EMRMASKBLT_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const U_POINTL | Mask, | ||
const uint32_t | iUsageMask, | ||
const uint32_t | dwRop, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px, | ||
const PU_BITMAPINFO | MskBmi, | ||
const uint32_t | cbMsk, | ||
char * | Msk | ||
) |
Allocate and construct a U_EMR_MASKBLT record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination width in logical units |
Src | Source UL corner in logical units |
xformSrc | Transform to apply to source |
crBkColorSrc | Background color |
iUsageSrc | DIBcolors Enumeration |
Mask | Mask UL corner in logical units |
iUsageMask | DIBcolors Enumeration |
dwRop | Ternary Raster Operation enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
MskBmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbMsk | Size in bytes of mask array (row stride * height, there may be some padding at the end of each row) |
Msk | (Optional) bitmapbuffer (mask section ) |
char* U_EMRMODIFYWORLDTRANSFORM_set | ( | const U_XFORM | xform, |
const uint32_t | iMode | ||
) |
Allocate and construct a U_EMR_MODIFYWORLDTRANSFORM record.
xform | Transform to use |
iMode | ModifyWorldTransformMode Enumeration |
char* U_EMRMOVETOEX_set | ( | const U_POINTL | ptl | ) |
Allocate and construct a U_EMR_MOVETOEX record.
ptl | Point coordinates |
char* U_EMROFFSETCLIPRGN_set | ( | const U_POINTL | ptl | ) |
Allocate and construct a U_EMR_OFFSETCLIPRGN record.
ptl | Clipping region |
char* U_EMRPAINTRGN_set | ( | const PU_RGNDATA | RgnData | ) |
Allocate and construct a U_EMR_PAINTRGN record.
RgnData | Variable size U_RGNDATA structure |
Allocate and construct a U_EMR_PIE record.
rclBox | bounding rectangle in logical units |
ptlStart | Start point in logical units |
ptlEnd | End point in logical units |
char* U_EMRPIXELFORMAT_set | ( | const U_PIXELFORMATDESCRIPTOR | pfd | ) |
Allocate and construct a U_EMR_PIXELFORMAT record.
pfd | PixelFormatDescriptor |
char* U_EMRPLGBLT_set | ( | const U_RECTL | rclBounds, |
const PU_POINTL | aptlDst, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const U_POINTL | Mask, | ||
const uint32_t | iUsageMask, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px, | ||
const PU_BITMAPINFO | MskBmi, | ||
const uint32_t | cbMsk, | ||
char * | Msk | ||
) |
Allocate and construct a U_EMRPLGBLT record.
rclBounds | Bounding rectangle in device units |
aptlDst | Defines parallelogram, UL, UR, LL corners, LR is derived (3 points) |
Src | Source UL corner in logical units |
cSrc | Source width in logical units |
xformSrc | Transform to apply to source |
crBkColorSrc | Background color |
iUsageSrc | DIBcolors Enumeration |
Mask | Mask UL corner in logical units |
iUsageMask | DIBcolors Enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
MskBmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbMsk | Size in bytes of mask array (row stride * height, there may be some padding at the end of each row) |
Msk | (Optional) bitmapbuffer (mask section ) |
char* U_EMRPOLYBEZIER16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYBEZIER16 record.
rclBounds | Bounding rectangle in device units |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
Allocate and construct a U_EMR_POLYBEZIER record.
rclBounds | bounding rectangle in device units |
cptl | Number of points to draw |
points | array of points |
char* U_EMRPOLYBEZIERTO16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYBEZIERTO record.
rclBounds | Bounding rectangle in device units |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
char* U_EMRPOLYBEZIERTO_set | ( | const U_RECTL | rclBounds, |
const uint32_t | cptl, | ||
const U_POINTL * | points | ||
) |
Allocate and construct a U_EMR_POLYBEZIERTO record.
rclBounds | bounding rectangle in device units |
cptl | Number of points to draw |
points | array of points |
char* U_EMRPOLYDRAW16_set | ( | const U_RECTL | rclBounds, |
const U_NUM_POINT16 | cpts, | ||
const U_POINT16 * | aptl, | ||
const uint8_t * | abTypes | ||
) |
Allocate and construct a U_EMR_POLYDRAW16 record.
rclBounds | Bounding rectangle in device units |
cpts | Number of U_POINTL objects |
aptl | Array of U_POINTL objects |
abTypes | Array of Point Enumeration |
char* U_EMRPOLYDRAW_set | ( | const U_RECTL | rclBounds, |
const U_NUM_POINTL | cptl, | ||
const U_POINTL * | aptl, | ||
const uint8_t * | abTypes | ||
) |
Allocate and construct a U_EMR_POLYDRAW record.
rclBounds | Bounding rectangle in device units |
cptl | Number of U_POINTL objects |
aptl | Array of U_POINTL objects |
abTypes | Array of Point Enumeration |
Allocate and construct a U_EMR_POLYGON16 record.
rclBounds | Bounding rectangle in device units |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
Allocate and construct a U_EMR_POLYGON record.
rclBounds | bounding rectangle in device units |
cptl | Number of points to draw |
points | array of points |
char* U_EMRPOLYLINE16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYLINE16 record.
rclBounds | Bounding rectangle in device units |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
Allocate and construct a U_EMR_POLYLINE record.
rclBounds | bounding rectangle in device units |
cptl | Number of points to draw |
points | array of points |
char* U_EMRPOLYLINETO16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYLINETO record.
rclBounds | Bounding rectangle in device units |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
Allocate and construct a U_EMR_POLYLINETO record.
rclBounds | bounding rectangle in device units |
cptl | Number of points to draw |
points | array of points |
char* U_EMRPOLYPOLYGON16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | nPolys, | ||
const uint32_t * | aPolyCounts, | ||
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYPOLYGON16 record.
rclBounds | Bounding rectangle in device units |
nPolys | Number of elements in aPolyCounts |
aPolyCounts | Number of points in each poly (sequential) |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
char* U_EMRPOLYPOLYGON_set | ( | const U_RECTL | rclBounds, |
const uint32_t | nPolys, | ||
const uint32_t * | aPolyCounts, | ||
const uint32_t | cptl, | ||
const U_POINTL * | points | ||
) |
Allocate and construct a U_EMR_POLYPOLYGON record.
rclBounds | bounding rectangle in device units |
nPolys | Number of elements in aPolyCounts |
aPolyCounts | Number of points in each poly (sequential) |
cptl | Total number of points (over all poly) |
points | array of points |
char* U_EMRPOLYPOLYLINE16_set | ( | const U_RECTL | rclBounds, |
const uint32_t | nPolys, | ||
const uint32_t * | aPolyCounts, | ||
const uint32_t | cpts, | ||
const U_POINT16 * | points | ||
) |
Allocate and construct a U_EMR_POLYPOLYLINE16 record.
rclBounds | Bounding rectangle in device units |
nPolys | Number of elements in aPolyCounts |
aPolyCounts | Number of points in each poly (sequential) |
cpts | Number of POINT16 in array |
points | Array of POINT16 |
char* U_EMRPOLYPOLYLINE_set | ( | const U_RECTL | rclBounds, |
const uint32_t | nPolys, | ||
const uint32_t * | aPolyCounts, | ||
const uint32_t | cptl, | ||
const U_POINTL * | points | ||
) |
Allocate and construct a U_EMR_POLYPOLYLINE record.
rclBounds | bounding rectangle in device units |
nPolys | Number of elements in aPolyCounts |
aPolyCounts | Number of points in each poly (sequential) |
cptl | Total number of points (over all poly) |
points | array of points |
char* U_EMRREALIZEPALETTE_set | ( | void | ) |
Allocate and construct a U_EMR_REALIZEPALETTE record.
char* U_EMRRECTANGLE_set | ( | const U_RECTL | rclBox | ) |
Allocate and construct a U_EMR_RECTANGLE record.
rclBox | bounding rectangle in logical units |
char* U_EMRRESIZEPALETTE_set | ( | const uint32_t | ihPal, |
const uint32_t | cEntries | ||
) |
Allocate and construct a U_EMR_RESIZEPALETTE record.
ihPal | Index of a Palette object in the EMF object table |
cEntries | Number to expand or truncate the Palette entry list to |
char* U_EMRRESTOREDC_set | ( | const int32_t | iRelative | ) |
Allocate and construct a U_EMR_RESTOREDC record.
iRelative | DC to restore. -1 is preceding |
Allocate and construct a U_EMR_ROUNDRECT record.
rclBox | bounding rectangle in logical units |
szlCorner | W & H in logical units of ellipse used to round corner |
char* U_EMRSAVEDC_set | ( | void | ) |
Allocate and construct a U_EMR_SAVEDC record.
char* U_EMRSCALEVIEWPORTEXTEX_set | ( | const int32_t | xNum, |
const int32_t | xDenom, | ||
const int32_t | yNum, | ||
const int32_t | yDenom | ||
) |
Allocate and construct a U_EMR_SCALEVIEWPORTEXTEX record.
xNum | Horizontal multiplier (!=0) |
xDenom | Horizontal divisor (!=0) |
yNum | Vertical multiplier (!=0) |
yDenom | Vertical divisor (!=0) |
char* U_EMRSCALEWINDOWEXTEX_set | ( | const int32_t | xNum, |
const int32_t | xDenom, | ||
const int32_t | yNum, | ||
const int32_t | yDenom | ||
) |
Allocate and construct a U_EMR_SCALEWINDOWEXTEX record.
xNum | Horizontal multiplier (!=0) |
xDenom | Horizontal divisor (!=0) |
yNum | Vertical multiplier (!=0) |
yDenom | Vertical divisor (!=0) |
char* U_EMRSELECTCLIPPATH_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SELECTCLIPPATH record.
iMode | RegionMode Enumeration |
char* U_EMRSELECTOBJECT_set | ( | const uint32_t | ihObject | ) |
Allocate and construct a U_EMR_SELECTOBJECT record. Use selectobject_set() instead of calling this function directly.
ihObject | Number of a stock or created object |
char* U_EMRSELECTPALETTE_set | ( | const uint32_t | ihPal | ) |
Allocate and construct a U_EMR_SELECTPALETTE record.
ihPal | Index of a Palette object in the EMF object table |
char* U_EMRSETARCDIRECTION_set | ( | const uint32_t | iArcDirection | ) |
Allocate and construct a U_EMR_SETARCDIRECTION record.
iArcDirection | ArcDirection Enumeration |
char* U_EMRSETBKCOLOR_set | ( | const U_COLORREF | crColor | ) |
Allocate and construct a U_EMR_SETBKCOLOR record.
crColor | Background Color |
char* U_EMRSETBKMODE_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETBKMODE record.
iMode | BackgroundMode Enumeration |
char* U_EMRSETBRUSHORGEX_set | ( | const U_POINTL | ptlOrigin | ) |
Allocate and construct a U_EMR_SETBRUSHORGEX record.
ptlOrigin | H & V origin in logical units |
char* U_EMRSETCOLORADJUSTMENT_set | ( | const U_COLORADJUSTMENT | ColorAdjustment | ) |
Allocate and construct a U_EMR_SETCOLORADJUSTMENT record.
ColorAdjustment | Color Adjustment |
char* U_EMRSETCOLORSPACE_set | ( | const uint32_t | ihCS | ) |
Allocate and construct a U_EMR_SETCOLORSPACE record.
ihCS | Index of object in EMF object table |
char* U_EMRSETDIBITSTODEVICE_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const uint32_t | iUsageSrc, | ||
const uint32_t | iStartScan, | ||
const uint32_t | cScans, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_SETDIBITSTODEVICE record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
Src | Source UL corner in logical units |
cSrc | Source W & H in logical units |
iUsageSrc | DIBColors Enumeration |
iStartScan | First scan line |
cScans | Number of scan lines |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRSETICMMODE_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETICMMODE record.
iMode | ICMMode Enumeration |
char* U_EMRSETLAYOUT_set | ( | uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETLAYOUT record.
iMode | Mirroring Enumeration |
char* U_EMRSETMAPMODE_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETMAPMODE record.
iMode | MapMode Enumeration |
char* U_EMRSETMAPPERFLAGS_set | ( | void | ) |
Allocate and construct a U_EMR_SETMAPPERFLAGS record.
char* U_EMRSETMETARGN_set | ( | void | ) |
Allocate and construct a U_EMR_SETMETARGN record.
char* U_EMRSETMITERLIMIT_set | ( | const uint32_t | eMiterLimit | ) |
Allocate and construct a U_EMR_SETMITERLIMIT record.
eMiterLimit | MapMode Enumeration |
char* U_EMRSETPALETTEENTRIES_set | ( | const uint32_t | ihPal, |
const uint32_t | iStart, | ||
const U_NUM_LOGPLTNTRY | cEntries, | ||
const PU_LOGPLTNTRY | aPalEntries | ||
) |
Allocate and construct a U_EMR_SETPALETTEENTRIES record. Use setpaletteentries_set() instead of calling this function directly.
ihPal | Index of a Palette object in the EMF object table |
iStart | First Palette entry in selected object to set |
cEntries | Number of Palette entries in selected object to set |
aPalEntries | Values to set with |
char* U_EMRSETPIXELV_set | ( | const U_POINTL | ptlPixel, |
const U_COLORREF | crColor | ||
) |
Allocate and construct a U_EMR_SETPIXELV record.
ptlPixel | Pixel coordinates (logical) |
crColor | Pixel color |
char* U_EMRSETPOLYFILLMODE_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETPOLYFILLMODE record.
iMode | PolygonFillMode Enumeration |
char* U_EMRSETROP2_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETROP2 record.
iMode | RasterOperation2 Enumeration |
char* U_EMRSETSTRETCHBLTMODE_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETSTRETCHBLTMODE record.
iMode | StretchMode Enumeration |
char* U_EMRSETTEXTALIGN_set | ( | const uint32_t | iMode | ) |
Allocate and construct a U_EMR_SETTEXTALIGN record.
iMode | TextAlignment Enumeration |
char* U_EMRSETTEXTCOLOR_set | ( | const U_COLORREF | crColor | ) |
Allocate and construct a U_EMR_SETTEXTCOLOR record.
crColor | Text Color |
char* U_EMRSETVIEWPORTEXTEX_set | ( | const U_SIZEL | szlExtent | ) |
Allocate and construct a U_EMR_SETVIEWPORTEXTEX record.
szlExtent | H & V extent in logical units |
char* U_EMRSETVIEWPORTORGEX_set | ( | const U_POINTL | ptlOrigin | ) |
Allocate and construct a U_EMR_SETVIEWPORTORGEX record.
ptlOrigin | H & V origin in logical units |
char* U_EMRSETWINDOWEXTEX_set | ( | const U_SIZEL | szlExtent | ) |
Allocate and construct a U_EMR_SETWINDOWEXTEX record.
szlExtent | H & V extent in logical units |
char* U_EMRSETWINDOWORGEX_set | ( | const U_POINTL | ptlOrigin | ) |
Allocate and construct a U_EMR_SETWINDOWORGEX record.
ptlOrigin | H & V origin in logical units |
char* U_EMRSETWORLDTRANSFORM_set | ( | const U_XFORM | xform | ) |
Allocate and construct a U_EMR_SETWORLDTRANSFORM record.
xform | Transform to use |
char* U_EMRSMALLTEXTOUT_set | ( | const U_POINTL | Dest, |
const U_NUM_STR | cChars, | ||
const uint32_t | fuOptions, | ||
const uint32_t | iGraphicsMode, | ||
const U_FLOAT | exScale, | ||
const U_FLOAT | eyScale, | ||
const U_RECTL | rclBounds, | ||
const char * | TextString | ||
) |
Allocate and construct a U_EMR_SMALLTEXTOUT record.
Dest | Where to draw the text |
cChars | Characters in TextString (not null terminated) |
fuOptions | ExtTextOutOptions Enumeration |
iGraphicsMode | GraphicsMode Enumeration |
exScale | scale on X axis |
eyScale | scale on Y axis |
rclBounds | OPTIONAL Bounding rectangle (absent when: fuOPtions & ETO_NO_U_RECT) |
TextString | text to output (fuOptions & ETO_SMALL_CHARS ? 8 bit : 16 bit) |
char* U_EMRSTRETCHBLT_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const uint32_t | dwRop, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_STRETCHBLT record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination width in logical units |
Src | Source UL corner in logical units |
cSrc | Src W & H in logical units |
xformSrc | Transform to apply to source |
crBkColorSrc | Background color |
iUsageSrc | DIBcolors Enumeration |
dwRop | Ternary Raster Operation enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRSTRETCHDIBITS_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const uint32_t | iUsageSrc, | ||
const uint32_t | dwRop, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_EMRSTRETCHDIBITS record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination W & H in logical units |
Src | Source UL corner in logical units |
cSrc | Source W & H in logical units |
iUsageSrc | DIBColors Enumeration |
dwRop | RasterOPeration Enumeration |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row STRIDE * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRSTROKEANDFILLPATH_set | ( | const U_RECTL | rclBox | ) |
Allocate and construct a U_EMR_STROKEANDFILLPATH record.
rclBox | Bounding rectangle in device units |
U_EMR_STROKEANDFILLPATH closes the open figure before filling and stroking. There appears to be no way to fill an open path while stroking it, as any one of U_EMRFILLPATH, U_EMRSTROKEPATH, or U_EMRSTROKEANDFILEPATH will "use up" the path,
char* U_EMRSTROKEPATH_set | ( | const U_RECTL | rclBox | ) |
Allocate and construct a U_EMR_STROKEPATH record.
rclBox | Bounding rectangle in device units |
U_EMR_STROKEPATH does NOT close the open figure before stroking it.
char* U_EMRTRANSPARENTBLT_set | ( | const U_RECTL | rclBounds, |
const U_POINTL | Dest, | ||
const U_POINTL | cDest, | ||
const U_POINTL | Src, | ||
const U_POINTL | cSrc, | ||
const U_XFORM | xformSrc, | ||
const U_COLORREF | crBkColorSrc, | ||
const uint32_t | iUsageSrc, | ||
const uint32_t | TColor, | ||
const PU_BITMAPINFO | Bmi, | ||
const uint32_t | cbPx, | ||
char * | Px | ||
) |
Allocate and construct a U_EMR_TRANSPARENTBLT record.
rclBounds | Bounding rectangle in device units |
Dest | Destination UL corner in logical units |
cDest | Destination width in logical units |
Src | Source UL corner in logical units |
cSrc | Src W & H in logical units |
xformSrc | Transform to apply to source |
crBkColorSrc | Background color |
iUsageSrc | DIBcolors Enumeration |
TColor | Bitmap color to be treated as transparent |
Bmi | (Optional) bitmapbuffer (U_BITMAPINFO section) |
cbPx | Size in bytes of pixel array (row stride * height, there may be some padding at the end of each row) |
Px | (Optional) bitmapbuffer (pixel array section ) |
char* U_EMRWIDENPATH_set | ( | void | ) |
Allocate and construct a U_EMR_WIDENPATH record.
U_XFORM xform_alt_set | ( | U_FLOAT | scale, |
U_FLOAT | ratio, | ||
U_FLOAT | rot, | ||
U_FLOAT | axisrot, | ||
U_FLOAT | eDx, | ||
U_FLOAT | eDy | ||
) |
Construct a U_XFORM structure.
scale | Scale factor |
ratio | Ratio of minor axis/major axis |
rot | Rotation angle in degrees, positive is counter clockwise from the x axis. |
axisrot | Angle in degrees defining the major axis before rotation, positive is counter clockwise from the x axis. |
eDx | Translation element |
eDy | Translation element |
Operation is: 1 Conformal map of points based on scale, axis rotation, and axis ratio,