subject
Engineering, 26.03.2020 23:18 Masielovebug

Implement
int energy(Pixel** image, int x, int y, int width, int height);

This function will return the dual-gradient energy of the pixel.

The first parameter is a pointer to a pointer to a Pixel. With this structure we can access our array with the [][] notation. Since we are using dynamic arrays, the width is not standard, so we cannot use [][] in the function signature since we would have to specify the array dimensions at compile time, but we get the dimensions (e. g. width) a run time.

The second parameter x is the column which is the first value in the
coordinate (x, y).

The third parameter y is the row which is the second value in the
coordinate (x, y).

Note you can write a function that prints out a table of the energy for each pixel coordinate. This is a great debugging tool for seeing if your energies are correct.

Implement
int* createSeam(int length);

This function will return a pointer to an array of ints allocated on the heap. The array must be initialized so that all elements have a value of zero in them.

The parameter indicates how many elements must be in the returned array. You can also think of this as the size of the array

Implement (after implementing createSeam)
void deleteSeam(int* seam)

This function will deallocate the memory for the indicated array, returning its memory to the heap.

The parameter is a pointer to an array of ints on the heap.

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:20
Ahe-xe mixture containing a 0.75 mole fraction of helium is used for cooling electronics in an avionics application. at a temperature of 300 k and atmospheric pressure, calculate the mass fraction of helium and the mass density, molar concentration and molecular weight of the mixture. if the cooling capacity is 10 l, what is the mass of the coolant?
Answers: 3
question
Engineering, 04.07.2019 19:10
Plan an experiment to measure the surface tension of a liquid similar to water. if necessary, review the ncfmf video surface tension for ideas. which method would be most suitable for use in an undergraduate laboratory? what experimental precision could be expected?
Answers: 2
question
Engineering, 04.07.2019 19:20
Apiping systems consists of 6 m of 6-std type k and 12 m of 4-std type k, both drawn copper tubing. the system conveys ethylene glycol at a rate of 0.013 m3/s. the pressure drop across the system is to be calculated. there are two 90° elbows in the 6-in pipe, a reduction from the 6-in pipe to the 4-in pipe and four 90° elbows in the 4-in pipe. all fittings are soldered (same as flanged) and regular. the inlet and outlet of the system are at the same height.
Answers: 1
question
Engineering, 04.07.2019 19:20
List 3 options on how to reduce knocking problens during engine process,
Answers: 2
You know the right answer?
Implement
int energy(Pixel** image, int x, int y, int width, int height);

This fun...
Questions
question
Mathematics, 18.09.2019 09:00
question
World Languages, 18.09.2019 09:00
question
Mathematics, 18.09.2019 09:00
question
History, 18.09.2019 09:00
question
Mathematics, 18.09.2019 09:00
Questions on the website: 13722361