Iam trying to use PixelSetRed(),PixelSetGreen(),PixelSetBlue() functions...to change the r,g,b of a particular pixel...iam storing the actual r,g,b values in an array and manipulating them and then trying to produce an image with the modified values...I divided the image into sub-images(this is a requirement)..
Code: Select all
a=0;
while(a<v.n_sbimg)
{
modify_iterator=NewPixelRegionIterator(modify_wand,v.col[a],v.row[a],v.sbimg_wdt,v.sbimg_hgt);
for(y=0;y<v.sbimg_hgt;y++)
{
modify_pixels = PixelGetNextIteratorRow(modify_iterator, &v.sbimg_wdt);
for(x=0;x<v.sbimg_wdt;x++)
{
PixelSetRed(modify_pixels[x],pxl_data[(loc(y,x,v.sbimg_wdt)+ a*v.sbimg_pxl)]); //pxl_data is a 1-D array containing r,g,b values sub-image wise..Iam retreving the values using a macro
PixelSetGreen(modify_pixels[x],pxl_data[(loc(y,x,v.sbimg_wdt)+1+ a*v.sbimg_pxl)]);
PixelSetBlue(modify_pixels[x],pxl_data[(loc(y,x,v.sbimg_wdt)+2+ a*v.sbimg_pxl)]);
PixelSyncIterator(modify_iterator);
}
}
a++;
}