hey to invert an image, do i have to invert red, green and blue parts of it? or can i just says 255 - image_data for example?
hey to invert an image, do i have to invert red, green and blue parts of it? or can i just says 255 - image_data for example?
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
well in my assignment there is some mention about separating it into red green and blue
so would i then take it i have to invert each of those, ie sayCode:red is (image_data[row][column]>>16)&0xff) blue is ((image_data[row][column]>>8)&0xff) green is ((image_data[row][column])&0xff)
so 255 - red? or watCode:red = (image_data[row][column]>>16)&0xff)
thanks
Yes. And then you have to shift the red element back to its position in the integer. along with the other colour elements.so 255 - red? or wat
would u mind explaing how that is done?
thats what i dont know
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
well i got this function:
// This routine will set the image pixel data from the supplied matrix
// from top left to bottom right. You must ensure that enough space is
// available.
void ep100_lib_set_data(int data[EP100_LIB_MAX_X][EP100_LIB_MAX_Y])
but not sure after i have inverted the three colors how it applies?
Don't ask almost the same question in two different threads.
And again, TRY TO do something yourself.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Hey my thread got hijacked
Hmm taurus seems to get more help than me , Where Im stuck is interpreting in pseudocode how I would use memmove() to scroll an image . I see no other way than using simple english description on what would happen . Our lecturer didn't go over any more advanced c functions and how they would be interpreted in pseudocode.
And what have YOU got to show for your efforts? Show us what you're doing, and we'll do our best to help. I try to treat everyone the same (obviously based on their abilities - someone who knows what they are doing will (hopefully) get a different answer than a beginner).
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
I have this so far
Code:Algorith Image_Operations; // The following algorithm shall do a number of operations on the source // image file. INTEGER data[program_LIB_MAX_X][EP100_LIB_MAX_Y] ; // This routine will put the image pixel data into the supplied matrix // from top left to bottom right. You must ensure that enough space is // available. PROCEDURE program_lib_get_data(intdata[program_LIB_MAX_X] [EP100_LIB_MAX_Y]) ; FUNCTION program_lib_get_data(data); // Get the image data from the user, by calling a function PROCEDURE Image_Invert(float data); Array new[1024][1024] INTEGER Max_y<--y INTEGER Max_x<--x INTEGER Current_y INTEGER Current_x While Current_x < than Max_x; array[x]<--array[x-255] // meant to invert colour , by changing pixel value EndWhile; While Current_y less than Max_y; Array[y]<--array[y-255]; EndWhile; new <-- Invert(array x y); FUNCTION main() // We must check that image is not bigger than 1024x1024 Output " Please enter size of image { width x height}"; INTEGER X,Y; Input x,y; If X>1024 OR Y>1024; Then Output “ Image too large , try another image “;
It has indentation , but it got lost when I copy / pasted