Article View: adobe.photoshop.scripting
Article #1986Re: Why does not update color?
From: Barbu_Bogdan
Date: Sat, 03 Jul 2004 14:56
Date: Sat, 03 Jul 2004 14:56
13 lines
1326 bytes
1326 bytes
I resolved the problem :
I was mixing access methods here. BeginBaseAddressAccess() an ASByte pointer, which I can use to walk thru the image and set values in the 0 to 255 range. Like:
ASByte* theImage = sADMImage->BeginBaseAddressAccess(imageRef);
for(long i=0;i<imageLen;i++) { theImage[i] = 128; } sADMImage->EndBaseAddressAccess(imageRef);
On the other hand, SetPixel is expecting an ASRGBColor, which expects a short, so color values in the 0 to 255 range should be shifted left by 8:
color.red = (100 << 8);
Either method works, but SetPixel() is much slower to call repeatedly, so it's not the best method for speed.
Bogdan.
Technical Details
Message-ID:
<3bb4e219.2@webx.la2eafNXanI>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webxReferences:
<3bb4e219.-1@webx.la2eafNXanI>Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,7b6689a9db9beab9 X-Google-Attributes: gidf5839,public X-Google-Language: ENGLISH,ASCII-7-bit From: Barbu_Bogdan@adobeforums.com Path: arc1-ca.pugleaf.net!g2news1.google.com!news2.google.com!proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx Newsgroups: adobe.photoshop.scripting Subject: Re: Why does not update color? Message-ID: <3bb4e219.2@webx.la2eafNXanI> Date: Sat, 3 Jul 2004 07:56:54 -0700 References: <3bb4e219.-1@webx.la2eafNXanI> Lines: 22 MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit