#include int main () { int x, y; Npic_image *np1; Npic_image_2l *p1; /* Create a 2L image = 2D image with signed long pixels (4 bytes). height is ymax=12, width is xmax=20, external borders are ybor=0, xbor=0. */ np1 = NpicCreateImage_2l (12, 20, 0, 0); if (np1 == NULL) exit (1); /* Assign values to pixels */ p1 = NpicCastImage (np1); for (y = 0; y < p1->ymax; y++) for (x = 0; x < p1->xmax; x++) p1->pix[y][x] = (x + y) % 16; /* Print image */ NpicPrintImage (np1); /* Destroy image */ NpicDestroyImage (np1); exit(0); }