/* * Setup a directory entry that references a samples/pixel array of ``type'' * values and (potentially) write the associated indirect values. The source * data from TIFFGetField() for the specified tag must be returned as double. */ static int TIFFWritePerSampleAnys(TIFF* tif, TIFFDataType type, ttag_t tag, TIFFDirEntry* dir) { double buf[10], v; double* w = buf; int i, status; int samples = (int) tif->tif_dir.td_samplesperpixel; if (samples > NITEMS(buf)) { w = (double*) _TIFFmalloc(samples * sizeof (double)); if (w == NULL) { TIFFError(tif->tif_name, "No space to write per-sample values"); return (0); } } TIFFGetField(tif, tag, &v); for (i = 0; i < samples; i++) w[i] = v; status = TIFFWriteAnyArray(tif, type, tag, dir, samples, w); if (w != buf) _TIFFfree(w); return (status); }
/* * Setup a directory entry that references a samples/pixel array of ``type'' * values and (potentially) write the associated indirect values. The source * data from TIFFGetField() for the specified tag must be returned as double. */ static int TIFFWritePerSampleAnys(TIFF* tif, TIFFDataType type, ttag_t tag, TIFFDirEntry* dir) { double buf[10], v; double* w = buf; int i, status; int samples = (int) tif->tif_dir.td_samplesperpixel; if (samples > NITEMS(buf)) w = (double*) _TIFFmalloc(samples * sizeof (double)); TIFFGetField(tif, tag, &v); #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for (i = 0; i < samples; i++) w[i] = v; status = TIFFWriteAnyArray(tif, type, tag, dir, samples, w); if (w != buf) _TIFFfree(w); return (status); }