Do I have to loop through every pixel when I want to mask one 2D Dataset with another?

           float[] dataRead = (float[]) data.read();
           float[] maskRead = (float[]) mask.read();
for (int i = 0; i < dims[0] * dims[1] ; ++i) {
               if (maskRead[i] == 1) {
                 /* 1 * dataRead[i] */
               }
               else {
                   dataRead[i] = fillvalue;
                   /* ...or 0 * dataRead[i] */
               }
           }
           data.write(dataRead);
Or is there some sort of function/technique which will multiply all of the corresponding pixels together?



_______________________________________________
Hdf-forum is for HDF software users discussion.
[email protected]
http://mail.hdfgroup.org/mailman/listinfo/hdf-forum_hdfgroup.org

Reply via email to