Images


Functions

Boolean_t TecUtilImageRGBBitmapCreate (BitDumpRegion_e Region)
  Call this function to initialize the export state if you are exporting using the RGB functions.
Boolean_t TecUtilImageIndexedBitmapCreate (BitDumpRegion_e Region, short *RedColorTable_Array, short *GreenColorTable_Array, short *BlueColorTable_Array)
  Call this function to initialize the export state if you are exporting using the index functions.
void TecUtilImageBitmapDestroy (void)
  Destroy the bitmap buffer.
Boolean_t TecUtilImageGetDimensions (short *Width, short *Height)
  Gets the image dimensions.
Boolean_t TecUtilImageRGBGetScanLine (short ScanLine, short *Red_Array, short *Green_Array, short *Blue_Array)
  Gets the RGB values of a scan line.
Boolean_t TecUtilImageIndexedGetScanLine (short ScanLine, short *RGBIndex_Array)
  Gets the color table indices for a scan line.
void TecUtilImageGetColorTable (Byte_t *Red_Array, Byte_t *Green_Array, Byte_t *Blue_Array)
  Get the color table, that is, the palette, of a color-reduced image.
Boolean_t TecUtilImageBitmapCreateX (ArgList_pa ArgList)
  Create a true color or color-reduced bitmap of a specified width.


Function Documentation

Boolean_t TecUtilImageBitmapCreateX ( ArgList_pa  ArgList  ) 

Create a true color or color-reduced bitmap of a specified width.

Parameters:
ArgList Set of Arglist entries. This is built using calls to TecUtilArgListAppendXXXX functions.

Arglist Values

SV_CONVERTTO256COLORS
Type: Boolean_t
Arg Function: TecUtilArgListAppendInt()
Default: TRUE
Required: No
Notes: Set this to TRUE to create a color-reduced bitmap. A 256-color indexed bitmap will be created. After rendering the image using this function, call TecUtilImageGetColorTable() to get the palette, and TecUtilImageIndexedGetScanLine() to retrieve the palette indices for a scan line. Set this to FALSE to create a true color image. After rendering the image using this function, call TecUtilImageRGBGetScanLine() to get the red, green, and blue values for a scan line.

SV_IMAGEWIDTH
Type: ScreenDim_t
Arg Function: TecUtilArgListAppendInt()
Default: 512
Required: No
Notes: This value specifies the resolution in pixels of the created image. The height is automatically calculated based on the export region and the width. The approximate amount of memory required to generate an image, either color-reduced or true color, is Width by Height by three. Thus, very large values for this parameter will require a large amount of memory. This function will return FALSE if there is insufficient memory to render an image of the requested size

SV_EXPORTREGION
Type: DumpRegion_e
Arg Function: TecUtilArgListAppendInt()
Default: ExportRegion_CurrentFrame
Required: No
Notes: Export region. Set this ExportRegion_Currentframe, ExportRegion_AllFrames, or ExportRegion_WorkArea


Returns:
TRUE if the image was successfully created and rendered, otherwise FALSE.
Precondition:
ArgList Argument list must be valid or NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageBitmapCreateX(ArgListPtr)
    POINTER (ArgListPtr, ArgList)

Python Syntax:

  Results = TecUtil.ImageBitmapCreateX(ArgList)

  Input:
                  ArgList              dictionary
  Output:
    Results[0]    ReturnVal            boolean

ArgList_pa ArgList;

   TecUtilLockStart(AddOnID);
   ArgList = TecUtilArgListAlloc();
   TecUtilArgListAppendInt(ArgList,SV_CONVERTTO256COLORS,FALSE);
   // Create a true color image.
   TecUtilArgListAppendInt(ArgList,SV_IMAGEWIDTH,1000);
   // The image will be rendered with a width of 1000 pixels.
   TecUtilArgListAppendInt(ArgList,SV_EXPORTREGION,(LgIndex_t)ExportRegion_WorkArea);
   TecUtilImageBitmapCreateX(ArgList);
   // Export the image.
   TecUtilArgListDealloc(&ArgList);
   TecUtilLockFinish(AddOnID);

void TecUtilImageBitmapDestroy ( void   ) 

Destroy the bitmap buffer.

Fortran Syntax:

Python Syntax:

  Results = TecUtil.ImageBitmapDestroy()

  Output:
    Results[0]    ReturnVal            NONE

void TecUtilImageGetColorTable ( Byte_t Red_Array,
Byte_t Green_Array,
Byte_t Blue_Array 
)

Get the color table, that is, the palette, of a color-reduced image.

You must call either TecUtilImageIndexedBitmapCreate() or TecUtilImageBitmapCreateX() before calling this function. The caller of this function must allocate three arrays of at least 256 bytes and pass them to this function.

Parameters:
Red_Array Pointer to 256-byte array which will receive the red values of the color table. Must not be NULL
Green_Array Pointer to 256-byte array which will receive the green values of the color table. Must not be NULL
Blue_Array Pointer to 256-byte array which will receive the blue values of the color table. Must not be NULL.
Fortran Syntax:
    SUBROUTINE TecUtilImageGetColorTable(
   &           Red_Array,
   &           Green_Array,
   &           Blue_Array)
    INTEGER*4       Red_Array
    INTEGER*4       Green_Array
    INTEGER*4       Blue_Array

Python Syntax:

  Results = TecUtil.ImageGetColorTable()

  Output:
    Results[0]    Red_Array            
    Results[1]    Green_Array          
    Results[2]    Blue_Array           

   {
     Byte_t Red[256];
     Byte_t Green[256];
     Byte_t Blue[256];

     TecUtilLockStart(AddOnID);
     TecUtilImageBitmapCreateX(NULL);
     // Will create a 256-color image.
     TecUtilImageGetColorTable(Red,Green,Blue);
     // Export the image.
     TecUtilImageBitmapDestroy();
     TecUtilLockFinish(AddOnID);
   }

Boolean_t TecUtilImageGetDimensions ( short *  Width,
short *  Height 
)

Gets the image dimensions.

You must call TecUtilImageRGBBitmapCreate() before using this function.

Parameters:
Width Receives the width of the image in pixels. May be NULL.
Height Receives the height of the image in scan lines. May be NULL
Returns:
TRUE if successful, FALSE otherwise
Precondition:
Width Pointer must be a valid address or NULL.

Height Pointer must be a valid address or NULL.

Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageGetDimensions(
   &                   Width,
   &                   Height)
    INTEGER*4       Width
    INTEGER*4       Height

Python Syntax:

  Results = TecUtil.ImageGetDimensions()

  Output:
    Results[0]    ReturnVal            boolean
    Results[1]    Width                int
    Results[2]    Height               int

Create an indexed bitmap and get the dimensions.

   {
     short Width,Height;
     short ColorTable[256]; // Must be at least 256

     TecUtilLockStart(AddOnID);

     if (TecUtilImageIndexedBitmapCreate(BitDumpRegion_CurrentFrame,
                                         ColorTable))
       {
         TecUtilImageGetDimensions(&Width,&Height);
         // Dimensions are now in the Width and Height variables
         TecUtilImageBitmapDestroy(); // Through with the bitmap
       }
     TecUtilLockFinish(AddOnID);
   }

Boolean_t TecUtilImageIndexedBitmapCreate ( BitDumpRegion_e  Region,
short *  RedColorTable_Array,
short *  GreenColorTable_Array,
short *  BlueColorTable_Array 
)

Call this function to initialize the export state if you are exporting using the index functions.

Must be called before calling TecUtilImageIndexedGetScanLine() and TecUtilImageGetDimensions().

Parameters:
Region Region to export. Must be a valid region
RedColorTable_Array Receives the color table Red component. Caller must allocate this array and they must have 256 elements. You can also pass NULL for this arrays, using TecUtilImageGetColorTable() to get the color table. Note that in Version 9.0 or higher, the indices are guaranteed to be less than 256
GreenColorTable_Array Receives the color table Green component.
BlueColorTable_Array Receives the color table Blue component.
Returns:
TRUE if successful, FALSE otherwise
Precondition:
IMPLICATION(RedColorTableArray != NULL,VALID_REF(RedColorTableArray)) Pointer must be a valid address or NULL.

IMPLICATION(GreenColorTableArray != NULL,VALID_REF(GreenColorTableArray)) Pointer must be a valid address or NULL.

IMPLICATION(BlueColorTableArray != NULL,VALID_REF(BlueColorTableArray)) Pointer must be a valid address or NULL.

Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageIndexedBitmapCreate(
   &                   Region,
   &                   RedColorTable_Array,
   &                   GreenColorTable_Array,
   &                   BlueColorTable_Array)
    INTEGER*4       Region
    INTEGER*4       RedColorTable_Array
    INTEGER*4       GreenColorTable_Array
    INTEGER*4       BlueColorTable_Array

Python Syntax:

  Results = TecUtil.ImageIndexedBitmapCreate(Region)

  Input:
                  Region               BitDumpRegion_e  (defined in TecVals.py)
  Output:
    Results[0]    ReturnVal            boolean
    Results[1]    RedColorTable_Array  int
    Results[2]    GreenColorTable_Array int
    Results[3]    BlueColorTable_Array int

Create an indexed bitmap.

   {
     short RedColorTable[256];
     short BlueColorTable[256];
     short GreenColorTable[256];

     TecUtilLockStart(AddOnID);
     if (TecUtilImageIndexedBitmapCreate(BitDumpRegion_CurrentFrame,
                                         RedColorTable,
                                         GreenColorTable,
                                         BlueColorTable))
       {
         // Bitmap has been created
         TecUtilImageBitmapDestroy(); // When you're finished with it
       }

     TecUtilLockFinish(AddOnID);
   }

Boolean_t TecUtilImageIndexedGetScanLine ( short  ScanLine,
short *  RGBIndex_Array 
)

Gets the color table indices for a scan line.

The calling application must allocate/free the RGBIndex array and ensure that it has enough space.

Parameters:
ScanLine One-based scan line to get the RGB values from. Must be between one and the height of the image
RGBIndex_Array Array which receives the indicies. These values can be indexed into the color table returned by TecUtilImageIndexedBitmapCreate().
Returns:
TRUE if successful, FALSE otherwise
Precondition:
VALID_REF(RGBIndex) Pointer must be a valid address and non-NULL.
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageIndexedGetScanLine(
   &                   ScanLine,
   &                   RGBIndex_Array)
    INTEGER*4       ScanLine
    INTEGER*4       RGBIndex_Array

Python Syntax:

  Results = TecUtil.ImageIndexedGetScanLine(ScanLine)

  Input:
                  ScanLine             int
  Output:
    Results[0]    ReturnVal            boolean
    Results[1]    RGBIndex_Array       int

Get the color table indices for the first scan line line.

   {
     short Width,Height;
     short *RGBIndex = NULL;
     short ColorTableR[256]; // Must be at least 256
     short ColorTableG[256];
     short ColorTableB[256];

     TecUtilLockStart(AddOnID);

     if  (TecUtilImageIndexedBitmapCreate(BitDumpRegion_CurrentFrame,
                                          ColorTableR)
                                          ColorTableG)
                                          ColorTableB)
       {
         TecUtilImageGetDimensions(&Width,&Height);
         RGBIndex = (short*) malloc(Width * sizeof(short));
         TecUtilImageIndexedGetScanLine(1, // scan lines are 1-based
                                        RGBIndex);
         TecUtilImageBitmapDestroy();
       }

     TecUtilLockFinish(AddOnID);
   }

Boolean_t TecUtilImageRGBBitmapCreate ( BitDumpRegion_e  Region  ) 

Call this function to initialize the export state if you are exporting using the RGB functions.

Must be called before calling TecUtilImageRGBGetScanLine() and TecUtilImageGetDimensions().

Parameters:
Region Region to export. Must be a valid region
Returns:
TRUE if the export state was successfully initialized, FALSE otherwise
Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageRGBBitmapCreate(Region)
    INTEGER*4 Region

Python Syntax:

  Results = TecUtil.ImageRGBBitmapCreate(Region)

  Input:
                  Region               BitDumpRegion_e  (defined in TecVals.py)
  Output:
    Results[0]    ReturnVal            boolean

Create an RGB (24-bit) bitmap.

See the Example for TecUtilImageRGBBitmapCreate().

Boolean_t TecUtilImageRGBGetScanLine ( short  ScanLine,
short *  Red_Array,
short *  Green_Array,
short *  Blue_Array 
)

Gets the RGB values of a scan line.

The calling application must allocate/free the arrays and ensure that they have enough space.

Parameters:
ScanLine One-based scan line to get the RGB values from. Must be between one and the height of the image
Red_Array Array which receives the RED components. Caller must allocate this array. May not be NULL.
Green_Array Array which receives the GREEN components. Caller must allocate this array. May not be NULL
Blue_Array Array which receives the BLUE components. Caller must allocate this array. May not be NULL
Returns:
TRUE if successful, FALSE otherwise.
Precondition:
VALID_REF(RedArray) Pointer must be a valid address and non-NULL.

VALID_REF(GreenArray) Pointer must be a valid address and non-NULL.

VALID_REF(BlueArray) Pointer must be a valid address and non-NULL.

Fortran Syntax:
    INTEGER*4 FUNCTION TecUtilImageRGBGetScanLine(
   &                   ScanLine,
   &                   Red_Array,
   &                   Green_Array,
   &                   Blue_Array)
    INTEGER*4       ScanLine
    INTEGER*4       Red_Array
    INTEGER*4       Green_Array
    INTEGER*4       Blue_Array

Python Syntax:

  Results = TecUtil.ImageRGBGetScanLine(ScanLine)

  Input:
                  ScanLine             int
  Output:
    Results[0]    ReturnVal            boolean
    Results[1]    Red_Array            int
    Results[2]    Green_Array          int
    Results[3]    Blue_Array           int

Get the first scan line.

   {
     // 24-bit color
     short *Red;
     short *Green;
     short *Blue;
     short Width,Height;

     TecUtilLockStart(AddOnID);

     if (TecUtilImageRGBBitmapCreate(BitDumpRegion_CurrentFrame))
      {
        TecUtilImageGetDimensions(&Width,&Height);
        Red = (short*) malloc(Width * sizeof(short));
        Green = (short*) malloc(Width * sizeof(short));
        Blue = (short*) malloc(Width * sizeof(short));

        TecUtilImageRGBGetScanLine(1,Red,Green,Blue);

        TecUtilImageBitmapDestroy();
      }

     TecUtilLockFinish(AddOnID);
   }


Generated on Tue Mar 12 02:24:42 2013 for Tecplot by  doxygen 1.5.5