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, 03.07.2019 14:10
When at a point two solid phase changes to one solid phase on cooling then it is known as a) eutectoid point b) eutectic point c) peritectic point d) peritectoid point
Answers: 3
question
Engineering, 03.07.2019 14:10
Amass of m 1.5 kg of steam is contained in a closed rigid container. initially the pressure and temperature of the steam are: p 1.5 mpa and t 240°c (superheated state), respectively. then the temperature drops to t2= 100°c as the result of heat transfer to the surroundings. determine: a) quality of the steam at the end of the process, b) heat transfer with the surroundings. for: p1.5 mpa and t 240°c: enthalpy of superheated vapour is 2900 kj/kg, specific volume of superheated vapour is 0. 1483 m/kg, while for t 100°c: enthalpy of saturated liquid water is 419kj/kg, specific volume of saturated liquid water is 0.001043m/kg, enthalpy of saturated vapour is 2676 kj/kg, specific volume of saturated vapour is 1.672 m/kg and pressure is 0.1 mpa.
Answers: 3
question
Engineering, 04.07.2019 18:10
Apump is used to circulate hot water in a home heating system. water enters the well-insulated pump operating at steady state at a rate of 0.42 gal/min. the inlet pressure and temperature are 14.7 lbf/in.2, and 180°f, respectively; at the exit the pressure is 60 lbf/in.2 the pump requires 1/15 hp of power input. water can be modeled as an incompressible substance with constant density of 60.58 lb/ft3 and constant specific heat of 1 btu/lb or. neglecting kinetic and potential energy effects, determine the temperature change, in °r, as the water flows through the pump.
Answers: 1
question
Engineering, 04.07.2019 18:10
Determine whether or not it is possible to compress air adiabatically from k to 140 kpa and 400 k. what is the entropy change during this process?
Answers: 3
You know the right answer?
Implement
int energy(Pixel** image, int x, int y, int width, int height);

This fun...
Questions
question
Spanish, 23.07.2019 15:00
question
Mathematics, 23.07.2019 15:00
Questions on the website: 13722363