Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

XieCreateImage(3X)  —  Subroutines

Digital

NAME

XieCreateImage − This routine creates a client XieImage using specified image record attributes passed as parameters. The image contains no image data. 

C Format

image = XieCreateImage(width, height, cmpres, cmp_org, cmp_map,
               cmp_cnt, cmp_lvl, pxl_mod, scn_mod)

C Argument Information

XieImage     image;
unsigned long  width;
unsigned long  height;
unsigned char  cmpres;
unsigned char  cmp_org;
unsigned char  cmp_map;
unsigned char  cmp_cnt;
unsigned long  ∗cmp_lvl;
unsigned char  pxl_mod;
unsigned char  scn_mod;

RETURN VALUES

The routine returns the newly created image. You can free the image using the XieFreeImage routine. 

PARAMETERS

widthThe width argument specifies the image width in pixels. 

heightThe height argument specifies the image height in scanlines. 

cmpresThe cmpres argument specifies the image compression scheme. 

cmp_orgThe cmp_org argument specifies the image component organization. 

cmp_mapThe cmp_map argument specifies the image component mapping. 

cmp_cntThe cmp_cnt argument specifies the number of image components. 

cmp_lvlThe cmp_lvl argument specifies the pointer to an array of image component levels. The array must be at least XieK_MaxComponents in length. 

pxl_modThe pxl_mod argument specifies the image pixel stride modulo. The pixel stride modulo is the modulo of the number of bits between the starting points of adjacent pixels on a scanline. For example, a pixel stride modulo of 8 indicates the pixel stride is a multiple of a byte. If you specify a value of less than 2 for this argument, the routine does not add padding bits. 

scn_modThe scn_mod argument specifies the image scanline stride modulo. The scanline stride modulo is the modulo of the number of bits between the starting points of adjacent scanlines. For example, a scanline stride modulo of 32 indicates that the scanline stride is a multiple of a longword. If you specify a scanline stride modulo of less than 2, the routine does not add scanline padding bits. 

DESCRIPTION

This routine creates a client XieImage using specified image record attributes passed as parameters. The image contains no image data. 

The routine fills in the XieImageRec fields. 

XieImage Field Initial Value
Compression compression_scheme
CmpOrg component_organization
CmpMap component_mapping
CmpCnt component_count
CmpLvl component_levels
CmpLen ceil(log10(component_levels)/log10(2.0))
PxlPol dependent on component_mapping:

Component_mapping Initial Value
XieK_Bitonal XieK_ZeroBright
XieK_GrayScale XieK_ZeroDark
XieK_RGB XieK_ZeroDark

PxlProg XieK_PP0
ScnProg XieK_LP270
OwnData False
Stream 0
Xport Null
PxlRatio 1.0
Plane UdpPtr’s, dependent on component_organization:

Component_organization UdpRec’s Allocated
XieK_BandByPixel 1
XieK_BandByPlane component_count
XieK_BitByPlane total of CmpLen

The routine fills in all fields in each UdpRec. 

UdpRec Field Initial Value
UdpW_PixelLength dependent on component_organization:

Component_organization Initial Value
XieK_BandByPixel total of CmpLen
XieK_BandByPlane CmpLen
XieK_BitByPlane 1

UdpB_DType UdpK_DTypeV if compression_scheme is not XieK_PCM, otherwise dependent on UdpW_PixelLength:

UdpW_PixelLength Data Type
8 UdpK_DTypeBU
16 UdpK_DTypeWU
32 UdpK_DTypeLU
other UdpK_DTypeVU

UdpB_Class UdpK_ClassUBS if compression_scheme is not XieK_PCM, otherwise dependent on UdpW_PixelLength:

UdpW_PixelLength Data Type
8, 16, or 32 UdpK_ClassA
other UdpK_ClassUBA

UdpA_Base Null
UdpL_ArSize UdpL_ScnStride ∗ height
UdpL_PxlStride UdpW_PixelLength, rounded up to pixel_stride_modulo
UdpL_ScnStride UdpL_PxlStride ∗ width, rounded up to scanline_stride_modulo
UdpL_X1 0
UdpL_X2 width - 1
UdpL_Y1 0
UdpL_Y2 height - 1
UdpL_PxlPerScn width
UdpL_ScnCnt height
UdpL_Pos 0
UdpL_CompIdx dependent on component_organization:

Component_organization Initial Value
XieK_BandByPixel 0
XieK_BandByPlane plane index (0,1, or 2)
XieK_BitByPlane component index (0,1,2)

UdpL_Levels 2 ^ UdpW_PixelLength

XIE Events and Error Messages

Protocol Messages: None

XIE event returned: None

XieLib errors: Fatal, invalid component organization argument

XieServer errors: None

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026