Questions tagged [reflect]
The reflect tag has no usage guidance.
32
questions
0
votes
1
answer
16
views
pset4 filter-more All functions work when I test it but check50 gives error
I struggled a long time with this problem, and I saw other people had almost the same question and got answers but I didn't get to solve the problem.
All four functions seems to work but when I test ...
0
votes
1
answer
16
views
Pset4 filter-less reflect function not passing check50
So i came up with this solution to the reflect function. It seems to properly reflect all the images but i'm getting all errors on check50. Trying to figure out what went wrong. We are encouraged to ...
0
votes
1
answer
49
views
Why does my Reflect function for pset4 filter (less) "correctly filter an image that is its own mirror image" but fail all other checks?
My reflect function correctly filters an image that is its own mirror image but for every other check fails. Here is the terminal output of submit50:
:( reflect correctly filters 1x2 image
...
0
votes
1
answer
214
views
Pset4 (Filter-Less) Reflection: Not getting correct values on Check50
Image seems to be reflected correctly but the program doesn't pass check50.
Code:
void swap(RGBTRIPLE *a, RGBTRIPLE *b);
void reflect(int height, int width, RGBTRIPLE image[height][width])
{
for (...
0
votes
1
answer
21
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++)
...
1
vote
1
answer
58
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
1
answer
115
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
0
answers
23
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
1
answer
102
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
1
answer
180
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
1
answer
223
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
1
answer
75
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
2
answers
203
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
2
answers
201
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
1
answer
62
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 ...
2
votes
2
answers
344
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
1
answer
388
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
1
answer
219
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
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,...
0
votes
1
answer
110
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
1
answer
73
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
2
answers
162
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
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, ...
1
vote
1
answer
405
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 ...
0
votes
1
answer
103
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 ...
1
vote
1
answer
3k
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
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[...
0
votes
1
answer
145
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 ...
1
vote
1
answer
801
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[...
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 ...
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, ...
0
votes
2
answers
738
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:...