1. 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?

2. Originally Posted by taurus
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?
0xFFFFFF-RGB should work if the RGB colours are in the low 24 bits. Since the highest value for a byte is 0xFF, there's no problem with overflow seeping from one colour to another.

--
Mats

3. well in my assignment there is some mention about separating it into red green and blue

Code:
```red is (image_data[row][column]>>16)&0xff)
blue is ((image_data[row][column]>>8)&0xff)
green is ((image_data[row][column])&0xff)```
so would i then take it i have to invert each of those, ie say
Code:
`red = (image_data[row][column]>>16)&0xff)`
so 255 - red? or wat

thanks

4. so 255 - red? or wat
Yes. And then you have to shift the red element back to its position in the integer. along with the other colour elements.

5. would u mind explaing how that is done?

6. Originally Posted by taurus
would u mind explaing how that is done?
How do you think it's done?

--
Mats

7. thats what i dont know

8. Originally Posted by taurus
thats what i dont know
Yes, and you should know by now that we are perfectly happy to HELP you get it right, but not to write the code for you without you trying.

--
Mats

9. 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?

And again, TRY TO do something yourself.

--
Mats

11. Hey my thread got hijacked

12. 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.

13. Originally Posted by ICool
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 .
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

14. 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 “;```

15. It has indentation , but it got lost when I copy / pasted