Article View: comp.sys.mac.programmer.codewarrior
Article #668Red Eye Removing, How?
From: wall
Date: Fri, 10 Oct 2003 07:11
Date: Fri, 10 Oct 2003 07:11
43 lines
2729 bytes
2729 bytes
I use this code selected the rect which has red eyes.
// the selected rect which has red eye
// the selected image part GWorld - theSelectImageGWorld
LGWorld* theSelectImageGWorld = NEW LGWorld( theSelectRect,32 );
ThrowIfNil_( theSelectImageGWorld );
// the orignal image GWorld - theImageGWorld
PixMapHandle theOPixMapH = ::GetGWorldPixMap(
theImageGWorld->GetMacGWorld() );
PixMapHandle theSelectPixMapH = ::GetGWorldPixMap(
theSelectImageGWorld->GetMacGWorld() );
Ptr theOBaseAddr = ::GetPixBaseAddr( theOPixMapH );
Ptr theSelectBaseAddr = ::GetPixBaseAddr( theSelectPixMapH );
short theORowBytes = ::GetPixRowBytes( theOPixMapH );
short theSelectRowBytes = ::GetPixRowBytes( theSelectPixMapH );
::LockPixels( theOPixMapH );
::LockPixels( theSelectPixMapH );
{
Ptr theSrcPtr, theDstPtr;
for(short theY = mSelRectToImageOrignal.top; theY <
mSelRectToImageOrignal.bottom; theY++)
{
theSrcPtr = theOBaseAddr + theORowBytes * theY;
theSrcPtr += mSelRectToImageOrignal.left << 2;
theDstPtr = theSelectBaseAddr + theSelectRowBytes * ( theY -
mSelRectToImageOrignal.top );
for (short theX = mSelRectToImageOrignal.left; theX <
mSelRectToImageOrignal.right; theX++)
{
* ((long*) theDstPtr++) = * ((long*) theSrcPtr++);
* ((long*) theDstPtr++) = * ((long*) theSrcPtr++);
* ((long*) theDstPtr++) = * ((long*) theSrcPtr++);
* ((long*) theDstPtr++) = * ((long*) theSrcPtr++);
}
}
}
::UnlockPixels( theOPixMapH );
::UnlockPixels( theSelectPixMapH );
what can I do to removing red eye in the selected image part?
Technical Details
Message-ID:
<7328a61a.0310092311.7ba03fa1@posting.google.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10bcce,ac196c6d17a8acce,start X-Google-Attributes: gid10bcce,public X-Google-Thread: f635e,ac196c6d17a8acce,start X-Google-Attributes: gidf635e,public X-Google-Thread: f98ee,ac196c6d17a8acce,start X-Google-Attributes: gidf98ee,public X-Google-Thread: 11100c,ac196c6d17a8acce,start X-Google-Attributes: gid11100c,public X-Google-ArrivalTime: 2003-10-10 00:11:36 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!postnews1.google.com!not-for-mail From: heroin_c@hotmail.com (wall) Newsgroups: comp.sys.mac.programmer.codewarrior,comp.os.ms-windows.programmer.tools.misc,codewarrior.mac,comp.sys.mac.programmer.tools Subject: Red Eye Removing, How? Date: 10 Oct 2003 00:11:35 -0700 Organization: http://groups.google.com Lines: 43 Message-ID: <7328a61a.0310092311.7ba03fa1@posting.google.com> NNTP-Posting-Host: 210.83.195.53 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1065769896 31763 127.0.0.1 (10 Oct 2003 07:11:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Fri, 10 Oct 2003 07:11:36 +0000 (UTC)