Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : BGIPIXEL.C

 
Output of file : BGIPIXEL.C contained in archive : CUJ0894.ZIP
/*****************************************************
* BGIPIXEL.C - this is a compiler-specific function
* to examine and fill pixels.
z *
* for TurboC V 2.0
*
* by Anton Treuenfels
* last revision: 04/11/94
*****************************************************/

#include "usrdef.h"

/*******************************
* Header Section - BGIPIXEL.C *
*******************************/

#ifndef SEEN_BGIPIX
#define SEEN_BGIPIX

/* function prototype */

void checkflood(int, int, Boolean);

#endif

/*****************************
* Code Section - BGIPIXEL.C *
*****************************/

#include
#include
#include

#include "bgigrh.h"
#include "flood.h"
#include "uflood.h"

/* efficiency counts */

static long readcnt, writecnt;

/*****************************************************/

/* check and fill pixel */

static int bgipixel(int xpos, int ypos) {

int pixval;

readcnt++;
if ((ypos >= 0) && (ypos <= MaxYPos)

&& (xpos >= 0) && (xpos <= MaxXPos)) {
pixval = getpixel(xpos, ypos);
if (pixval == 0) {
writecnt++;
if (xpos & 1)
putpixel(xpos, ypos, MaxColor);
return(TRUE);
}
pixval = max(0, pixval - 1);
putpixel(xpos, ypos, pixval);
}
return(FALSE);
}

/* checking fill using Borland Graphics Interface */

void checkflood(int xpos, int ypos, Boolean fastfill) {

char txtbuf[80];

readcnt = writecnt = 0;
abspoint(&xpos, &ypos);
if (fastfill)
flood(xpos, ypos, bgipixel);
else
uflood(xpos, ypos, bgipixel);
sprintf(txtbuf, "Pixels read= %ld", readcnt);
outtextxy(1, 1, txtbuf);
sprintf(txtbuf, "Pixels written= %ld", writecnt);
outtextxy(1, 10, txtbuf);
sprintf(txtbuf, "Write/Read= %.2f",
(float)writecnt / (float)readcnt);
outtextxy(1, 21, txtbuf);
}
/*****************************************************
* BGIPIXEL.C - this is a compiler-specific function
* to examine and fill pixels.
*
* for TurboC V 2.0
*
* by Anton Treuenfels
* last revision: 04/11/94
*****************************************************/

#include "usrdef.h"

/*******************************
* Header Section - BGIPIXEL.C *
*******************************/

#ifndef SEEN_BGIPIX
#define SEEN_BGIPIX

/* function prototype */

void checkflood(int, int, Boolean);

#endif

/*****************************
* Code Section - BGIPIXEL.C *
*****************************/

#include
#include
#include

#include "bgigrh.h"
#include "flood.h"
#include "uflood.h"

/* efficiency counts */

static long readcnt, writecnt;

/*****************************************************/

/* check and fill pixel */

static int bgipixel(int xpos, int ypos) {

int pixval;

readcnt++;
if ((ypos >= 0) && (ypos <= MaxYPos)
&& (xpos >= 0) && (xpos <= MaxXPos)) {
pixval = getpixel(xpos, ypos);
if (pixval == 0) {
writecnt++;
if (xpos & 1)
putpixel(xpos, ypos, MaxColor);
return(TRUE);
}
pixval = max(0, pixval - 1);
putpixel(xpos, ypos, pixval);
}
return(FALSE);
}

/* checking fill using Borland Graphics Interface */

void checkflood(int xpos, int ypos, Boolean fastfill) {

char txtbuf[80];

readcnt = writecnt = 0;
abspoint(&xpos, &ypos);
if (fastfill)
flood(xpos, ypos, bgipixel);
else
uflood(xpos, ypos, bgipixel);
sprintf(txtbuf, "Pixels read= %ld", readcnt);
outtextxy(1, 1, txtbuf);
sprintf(txtbuf, "Pixels written= %ld", writecnt);
outtextxy(1, 10, txtbuf);
sprintf(txtbuf, "Write/Read= %.2f",
(float)writecnt / (float)readcnt);
outtextxy(1, 21, txtbuf);
}


  3 Responses to “Category : Files from Magazines
Archive   : CUJ0894.ZIP
Filename : BGIPIXEL.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/