🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: adobe.photoshop.scripting
Article #1914

About the pixels and ADMImageRef

#1914
From: Barbu_Bogdan
Date: Tue, 06 Jul 2004 12:01
95 lines
3712 bytes
Hi!
Me again!
Right now I try something else and it started to show something that looks with my image, but not very correct.
The function i use i now is:

ADMImageRef GetImage()
{
     int16 tileHeight = filterRecord->outTileHeight;
     int16 tileWidth = filterRecord->outTileWidth;

if (tileWidth == 0 || tileHeight == 0 || filterRecord->advanceState == NULL)
     {
          return 0;
     }

uint8 *red, *green, *blue, *alpha;

VRect outRect = GetOutRect();
     VRect filterRect = GetFilterRect();

int32 imageVert = filterRect.bottom - filterRect.top;
     int32 imageHor = filterRect.right - filterRect.left;

uint32 tilesVert = (tileHeight - 1 + imageVert) / tileHeight;
     uint32 tilesHoriz = (tileWidth - 1 + imageHor) / tileWidth;

int16 layerPlanes = 0;
     if (filterRecord->filterCase > 2)
              layerPlanes = filterRecord->outLayerPlanes;
     else
              layerPlanes = filterRecord->planes;

int32 progress_total = layerPlanes * tilesVert;
     int32 progress_complete = 0;

ADMImageRef imageRef = sADMImage->Create(imageHor, imageVert);
     ASByte* theImage = sADMImage->BeginBaseAddressAccess(imageRef);
     ASRGBColor **color = (ASRGBColor**)malloc(sizeof(ASRGBColor)*imageVert*imageHor);
     long jjj = 0;
     long aaa = 0;
     long i = 0;
      for(int16 planeCount = 0; planeCount < layerPlanes; planeCount++) { filterRecord->outLoPlane = 0;
          filterRecord->outHiPlane = planeCount;
         for(uint16 vertTile = 0; vertTile < tilesVert; vertTile++) { for(uint16 horizTile = 0; horizTile < tilesHoriz; horizTile++) { outRect.top = 0;//vertTile * tileHeight; outRect.left = 0;//horizTile * tileWidth; outRect.bottom = 100;//imageVert/5;//outRect.top + tileHeight; outRect.right = 500;//imageHor/5;//outRect.left + tileWidth; if (outRect.bottom > imageVert)
                               outRect.bottom = imageVert;
                    if (outRect.right > imageHor)
                             outRect.right = imageHor;

SetOutRect(outRect);
                    filterRecord->advanceState();
                    outRect = GetOutRect();
                    long bitDepth = 8;
                    long len = imageHor * imageVert * bitDepth;
//
// I tried the for in here
// aaa = strlen((char*)filterRecord->outData);
// for(i=0; i<53248;i++) // { // theImage[jjj++] = ((ASByte*)filterRecord->outData)[i];
// }
//
//
//
         }
//
// And here
//

filterRecord->progressProc(++progress_complete, progress_total);

if (filterRecord->abortProc())
           {
            goto done;
           }

}
//
// End finally here.
//
      aaa = strlen((char*)filterRecord->outData);
      for(i=0; i<53248;i++) { theImage[jjj++] = ((ASByte*)filterRecord->outData)[i];
          }
 }
done:
 outRect.top = 0;
 outRect.left = 0;
 outRect.bottom = 0;
 outRect.right = 0;
 SetOutRect(outRect);

return imageRef;
}
...................................................................

How can I create this ADMImageRef, because right now I do not have any more ideas.

Bogdan!
Technical Details
Message-ID: <3bb4eb86.-1@webx.la2eafNXanI>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!npeer.de.kpn-eurorings.net!feed.news.schlund.de!schlund.de!newsfeed01.sul.t-online.de!t-online.de!webx

Show Full Headers
Complete Article Headers
X-Google-Thread: f5839,7496f731bb5caddd,start
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!news1.google.com!news.glorb.com!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: About the pixels and ADMImageRef
Message-ID: <3bb4eb86.-1@webx.la2eafNXanI>
Date: Tue, 6 Jul 2004 05:01:04 -0700
Lines: 116
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit