Article View: sci.image.processing
Article #267Re: image processing loops: a c programming question
From: Yecheng Wu
Date: Fri, 07 Aug 1992 17:38
Date: Fri, 07 Aug 1992 17:38
25 lines
1052 bytes
1052 bytes
Original source code is omitted here.
One solution to the messy problem is to make some functions to do
the offset calculation. For example, we can PutPixel and
GetPixel() here. They should look like:
BYTE GetPixel(BYTE *ImageBuf, long RowOffset, long Col)
{
return ImageBuf[RowOffset+Col];
}
BYTE PutPixel(BYTE *ImageBuf, long RowOffset, long Col, BYTE Value)
{
ImageBuf[RowOffset+Col] = Value;
}
Use this two function to whereever you need to access the pixel and the
code will look nicer. The efficiency will not be too much worse than
the one you have.
Good luck.
Yecheng
Technical Details
Message-ID:
<93123@bu.edu>Path:
arc1-ca.pugleaf.net!sparky!uunet!sun-barr!decwrl!elroy.jpl.nasa.gov!lll-winken!uwm.edu!rpi!bu.edu!bucrsb!wycReferences:
<SLEHAR.92Aug7111245@kendall.bu.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!sun-barr!decwrl!elroy.jpl.nasa.gov!lll-winken!uwm.edu!rpi!bu.edu!bucrsb!wyc From: wyc@bucrsb.bu.edu (Yecheng Wu) Newsgroups: sci.image.processing Subject: Re: image processing loops: a c programming question Message-ID: <93123@bu.edu> Date: 7 Aug 92 17:38:18 GMT References: <SLEHAR.92Aug7111245@kendall.bu.edu> Sender: news@bu.edu Distribution: sci.image.processing Organization: Boston University Lines: 25