🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.windows.x
Article #25266

modifications to the bitmap editor

#25266
From: bradley
Date: Fri, 27 Mar 1987 01:27
80 lines
2558 bytes
I've modified the bitmap editor (the one that comes with X 10.4) so that it has
two extra commands, Flip Horizontal and Flip Vertical.  Useful for quickly 
converting a bitmap of a left-facing Blue Space Lemur into a right-facing 
Blue Space Lemur.  Or something like that.

Anyhow, here's the diffs to apply to bitmap.c, via the command:
  ( cat diffs ; echo '1,$p' ) | ed - bitmap.c > bitmap.c.new

John Bradley  (bradley@cis.upenn.edu)

"Patch program?!?  WHAT patch program?"

---------------(cut here, save as 'diffs' (or don't))--------------------------
1865a

FlipH() {
  register int i,j;

  for (i=0; i<squares_high; i++)
    for (j=0; j<(squares_wide/2); j++) {
      bit b,b1;
      b =GetRasterBit(raster, j, i);
      b1=GetRasterBit(raster, squares_wide-1-j, i);
      SetRasterBit(raster, j, i, b1);
      SetRasterBit(raster, squares_wide-1-j, i, b);
      }

  changed = TRUE;

  RefillGrid(TRUE);
  RepaintRaster();
  RepaintRasterInverted();
  }  /* end of FlipH procedure */

FlipV() {
  register int i,j;

  for (i=0; i<squares_wide; i++)
    for (j=0; j<(squares_high/2); j++) {
      bit b,b1;
      b =GetRasterBit(raster, i, j);
      b1=GetRasterBit(raster, i, squares_high-1-j);
      SetRasterBit(raster, i, j, b1);
      SetRasterBit(raster, i, squares_high-1-j, b);
      }

  changed = TRUE;

  RefillGrid(TRUE);
  RepaintRaster();
  RepaintRasterInverted();
  }  /* end of FlipV procedure */
.
1084c
    if (i==2 || i == 5 || i == 8 || i == 11 || i == 13 || i == 15)
.
1063a
  commands[17].name = "Quit";
  commands[17].proc = Quit;

.
1062a
  commands[16].name = "Write Output";
  commands[16].proc = WriteOutput;
.
1060,1061c
  commands[15].name = "Flip Vertical";
  commands[15].proc = FlipV;
.
1057,1058c
  commands[14].name = "Flip Horizontal";
  commands[14].proc = FlipH;
.
1004c
      WriteOutput(), Quit(), FlipH(), FlipV();
.
85c
#define N_COMMANDS 	18
.
Technical Details
Message-ID: <8703270127.AA02280@dsl.cis.upenn.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!lll-lcc!ames!ucbcad!ucbvax!DSL.CIS.UPENN.EDU!bradley

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!utgpu!water!watnot!watmath!clyde!rutgers!lll-lcc!ames!ucbcad!ucbvax!DSL.CIS.UPENN.EDU!bradley
From: bradley@DSL.CIS.UPENN.EDU.UUCP
Newsgroups: comp.windows.x
Subject: modifications to the bitmap editor
Message-ID: <8703270127.AA02280@dsl.cis.upenn.edu>
Date: Thu, 26-Mar-87 20:27:16 EST
Article-I.D.: dsl.8703270127.AA02280
Posted: Thu Mar 26 20:27:16 1987
Date-Received: Sat, 28-Mar-87 07:16:34 EST
Sender: daemon@ucbvax.BERKELEY.EDU
Distribution: world
Organization: The ARPA Internet
Lines: 80