Questions tagged [reflect]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
1k views

runtime error in filter: reflect

I wish i could be more specific but i really don't understand the errors i'm getting This is my reflect function: // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[...
1
vote
1answer
748 views

pset4: filter reflect all check right except two of them

all checked right except two of them. it reflected the image correctly but I found two errors I can not understand them and how to solve it. void reflect(int height, int width, RGBTRIPLE image[...
1
vote
1answer
343 views

pset4 filter reflect. runtime error: index 601 out of bounds for type 'RGBTRIPLE [width]'

Below is the code that generated the error message. From what i can tell some part of this created a [j] value that was larger than the width. My thoughts on this problem was: With a hypothetical ...
1
vote
1answer
577 views

CS50 - Filter - Reflect Image

I am working through CS50's PSET #4, specifically filter -> reflect. I can get the image to present correctly (i.e., it is mirrored), but it is not exact enough to pass the CS50 Check. My code is as ...
1
vote
2answers
171 views

PSET 4 Reflect help

I am not sure why I am having issues with my code. I know I can store the rgb values for the left pixels in 3 temporary variables then assign the right values to the left and the temp values to the ...
0
votes
1answer
2k views

pset4 filter: reflect the image reflect half only

if I remove this line (*a = temp2) the left image only reflects and if I remove this line (*b = temp ) the right image only reflects but if I write both the image return into the original one no ...
0
votes
2answers
715 views

pset4 filter: reflect produces “UndefinedBehaviorSanitizer:DEADLYSIGNAL” forever

When I filter to reflect an image, it keeps printing the following without stopping: UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:DEADLYSIGNAL UndefinedBehaviorSanitizer:...
0
votes
2answers
106 views

Logic for reflect function in pset4 filter

I'm working through pset4 filter and the code for the reflect function. I'm still getting errors so clearly there's some kind of issue with my logic. When I try to apply filter to an actual image, I ...
0
votes
1answer
37 views

PSET filter reflect

Reflects sort of works, but when running cs50 check the message: :( reflect correctly filters 1x2 image expected "0 0 255\n255 0...", not "0 0 255\n0 0 2..." :( reflect ...
0
votes
1answer
83 views

Pset4 Reflect Filter Challenges - Not Reflecting

I am working on reflecting this image. I think I got the logic correctly, but I am not positive about that. However, my image did not reflect. Is this because I need to use malloc? I tried to but ...
0
votes
1answer
92 views

Pset4 reflect works but doesn't pass check50

I am so close on the reflect function for pset4. When I run the program it appears to work properly, but it doesn't pass check50. Does anyone know what I am doing wrong? void swap(RGBTRIPLE *a, ...
0
votes
1answer
46 views

CS50 PSET 4 REFLECT FAILS CS50

This code does indeed reflect the image, but, there is a slight line in the middle. And CS50 fails it completely // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[...
0
votes
1answer
57 views

PSET 4 BLUR and 2 of REFLECT

All of reflect works except reflected a 1 x 2 and a 4 x 4 (3x3 works fine) None of blur works except for when a point is in the corner, which makes little sense. I've sluthed around other answers and ...
0
votes
1answer
153 views

pset 4 reflect & blur work but don't test

My reflect function doesn't seem to do anything to the outputted image and my blur image fails check50 even though the resulting image looks visually blurred. Any insight into why this is the case is ...
0
votes
1answer
62 views

pset4 Filter Reflect could anyone check my code, I can't find the error as to why it does not output desirably

// Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[height][width]) { int t[3]; // using temporary array to swap values for(int i=0;i<height-1;i++) // loop thru ...
0
votes
2answers
39 views

Code divides image

I run my code and it complies and provides a (kind of) reflected image. It breaks the image in half and mirrors it instead of just reflecting. My goal was to switch the place of each pixel in the row, ...
0
votes
1answer
104 views

valgrind on filter -r. No leaks but errors

I am working on pset4 filter -r (reflection). How I want to achieve reflection: Reserve space in memory, enough to fit an image. Name it image-copy. Copy 1-to-1 the original file there. Original ...
0
votes
1answer
18 views

pset4 reflect half of the image

I have an issue with the reflect filter, it just reflects half of the image so what is the issue with my code here?! void swap(RGBTRIPLE *pixel1, RGBTRIPLE *pixel2) { RGBTRIPLE temp = *pixel1; ...
0
votes
1answer
31 views

Pset4 Reflection Less Comfortable - Check50 Errors

Hello CS50 community, my question is about the reflection filter (less comfortable): I have compiled a code that is reflecting (YEAH!) but there seems to be the following errors when checking: *:) ...
0
votes
0answers
16 views

CS50 Reflect Pset4 Runtime error

my code for reflect is this void swap (RGBTRIPLE *a, RGBTRIPLE *b) { RGBTRIPLE temp=*a; *a=*b; *b=temp; } // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[height][...
0
votes
0answers
40 views

Pset4 Filter/Less Reflect Not Working Properly

I tried this: // Reflect image horizontally void reflect(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE temp[height][width]; RGBTRIPLE reflection[height][width]; struct ...
0
votes
2answers
48 views

CS50 pset4 filter reflect issue

i am missing something here...but not sure what... it doesn't work on normal images... check50 passes for 1X2 and 1X3 images but fails for 3x3 and 4x4 images (so i guess it is an issue of iterating ...
0
votes
1answer
254 views

PSET4 Filter Reflect : No Reflection

Using Debug50, I can see that the RGB pixel values are appropriately swapped through. However the outfile is not actually reflected at all. The last comment section for the "fix" only seem to apply a ...
0
votes
2answers
1k views

Pset 4 filter: reflect help

I have been stuck on pset4 for a while and when I try to compile my code I now get 3 errors in the reflect function which are: helpers.c:83:6: error: conflicting types for 'swap' void swap(int *a,...
0
votes
1answer
81 views

PSET 4 Filters CS50

void reflect(int height, int width, RGBTRIPLE image[height][width]) { RGBTRIPLE temp[height][width]; for (int i = 0 ; i < height ; i++) { for (int j = 0 ; j < width ; j++...
0
votes
1answer
141 views

Pset 4 Filter Reflect less

I can't find why it doesn't work. That's the error message: index 600 out of bounds for type 'RGBTRIPLE [width] And I think it makes half reflection and half stays the same... That's my code: // ...
0
votes
1answer
90 views

Reflection - Pset4 - Code compiles however, not producing expected outcome

I have the following code below. The code compiles correctly, but the resulting images is exactly the same as the one that was used as the input file. I have gone through each line multiple times and ...
0
votes
2answers
1k views

CS50_2020 Pset 4 Filter Reflect

I'm currently working on the reflect function, I'm going to include my code below [removed] What problem are you having? Describe the problem in detail. If appropriate, include any error messages, ...