ImageProcessing

AddUndoImage, DisplayCurrentPicture, GetPixelValue, GetPixelValueEx, SetPixelValue, SetPixelValueEx

AddUndoImage

Description 

 AddUndoImage();

This function creates a copy of the current image and appends it to the undo history. This might be helpful when you perform some processing that changes the current image but need the current image data at the same time.

DisplayCurrentPicture

Description 

 DisplayCurrentPicture();

This function performs a refresh of the current image.

GetPixelValue

Description 

 GetPixelValue(
   int  UndoIndex,
   int  Row,
   int  Col,
   int  Component
);

This function retrieves a value of the pixel specified by given coordinates.

Parameters

int UndoIndex

Undo index determines the source image within the current undo history.

0

The current image

-1

The last undo image

int Row

The Y coordinate (the line number)

int Col

The X coordinate (column number).

int Component

Component (channel) index.

#importUC DisplayCurrentPicture;
int main()
   {
   int rows, cols;
   AddUndoImage();
   rows = 256;
   cols = 256;
   SetCommandText("Working...");
   Get_Size(SIZE_PICTURE,NULL,NULL,&cols,&rows);
   //Enable_Interrupt_InScript(0);
   Enable_Interrupt_InScript(2);
   inter_sharpen(cols, rows);
   DisplayCurrentPicture();
   }
__underC int inter_sharpen(int cols, int rows)
   {
   int i, j, value;
   for(i=0; i<rows; ++i)
  {
  for(j=0; j<cols; ++j)
     {
     value = 5 * GetPixelValue(-1,i,j,0);
     value = value - GetPixelValue(-1, i-1,j, 0);
     value = value - GetPixelValue(-1, i+1,j, 0);
     value = value - GetPixelValue(-1, i,j+1, 0);
     value = value - GetPixelValue(-1, i,j-1, 0);
     if(value <0) value=0;
     if(value >255) value=255;
     SetPixelValue(0,value,i,j,0);
     }
  if(0 == i % 20)
     DisplayCurrentPicture();
  }
  }

See Also 
AddUndoImage

GetPixelValueEx

Description 

 GetPixelValueEx(
   int  OpenDocumentIndex,
   int  UndoIndex,
   int  Row,
   int  Col,
   int *ComponentArray
);

Retrieves a value of the pixel specified by given coordinates in any opened document.

Parameters

int OpenDocumentIndex

Document to work in. Use -1 for the current document.

int UndoIndex

Undo index determines the source image within the current undo history.

0

The current image

-1

The last undo image

int Row

The Y coordinate (the line number)

int Col

The X coordinate (column number).

int *ComponentArray

Array of the values to be filled. The size of the array has to be equal to number of components of the image.

See Also 
GetPixelValue

SetPixelValue

Description 

 SetPixelValue(
   int  UndoIndex,
   int  ValM,
   int  Row,
   int  Col,
   int  Component
);

This function sets a new value to a pixel according to the given parameters.

Parameters

int UndoIndex

Undo index determines the target image within the current undo history.

0

The current image

-1

The last undo image

int ValM

The target value

int Row

The Y coordinate (the line number)

int Col

The X coordinate (column number).

int Component

Component (channel) index.

See Also 
AddUndoImage

SetPixelValueEx

Description 

 SetPixelValueEx(
   int  OpenDocumentIndex,
   int  UndoIndex,
   int  Row,
   int  Col,
   int *ComponentArray
);

Sets the value of the pixel specified by given coordinates in any opened document. To set only one component value, you can use function.

Parameters

int OpenDocumentIndex

Document to work in. Use -1 for the current document.

int UndoIndex

Undo index determines the source image within the current undo history.

0

The current image.

-1

The last undo image.

int Row

The Y coordinate (the line number).

int Col

The X coordinate (column number).

int *ComponentArray

Array of the values to be filled. The size of the array has to be equal to number of components of the image.