Questions tagged [reflect]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
11 views

CS50 Pset 4 Reflect with Bubble Sort

I tried using bubble sort for Reflect, it goes something like this pretend I defined temp here for (int i = 0; i = height; i++) for (int j = 0; j = width - 1; j++) for (int k = 0; k = width - 1; k++) ...
user avatar
0 votes
0 answers
11 views

reflect PSET4 -filter(less)

void reflect(int height, int width, RGBTRIPLE image[height][width]) { width = width/2; for (int i = 0; i < height; i++) { int n = 1; for (int j = 0; j < width; j++) { swap(&...
user avatar
  • 7
0 votes
1 answer
37 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; ...
user avatar
0 votes
1 answer
55 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: *:) ...
user avatar
  • 17
0 votes
0 answers
18 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][...
user avatar
0 votes
1 answer
70 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 ...
user avatar
0 votes
1 answer
141 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 ...
user avatar
0 votes
1 answer
156 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, ...
user avatar
0 votes
1 answer
59 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[...
user avatar
0 votes
2 answers
156 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 ...
user avatar
0 votes
2 answers
86 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 ...
user avatar
  • 109
0 votes
1 answer
58 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 ...
user avatar
  • 15
2 votes
2 answers
259 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 ...
user avatar
0 votes
1 answer
331 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 ...
user avatar
0 votes
1 answer
209 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 ...
user avatar
0 votes
2 answers
2k 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,...
user avatar
0 votes
1 answer
103 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++...
user avatar
0 votes
1 answer
68 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 ...
user avatar
0 votes
2 answers
154 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: // ...
user avatar
  • 5
0 votes
2 answers
40 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, ...
user avatar
  • 11
1 vote
1 answer
376 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 ...
user avatar
0 votes
1 answer
98 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 ...
user avatar
1 vote
1 answer
1k 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 ...
user avatar
1 vote
1 answer
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[...
user avatar
  • 35
0 votes
1 answer
123 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 ...
user avatar
  • 153
1 vote
1 answer
793 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[...
user avatar
2 votes
1 answer
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 ...
user avatar
0 votes
2 answers
2k 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, ...
user avatar
0 votes
2 answers
726 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:...
user avatar