Пример #1
0
static int
TIFFWriteFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v)
{
	TIFFCvtNativeToIEEEFloat(tif, dir->tdir_count, v);
	if (dir->tdir_count == 1) {
		dir->tdir_offset = *(uint32*) &v[0];
		return (1);
	} else
		return (TIFFWriteData(tif, dir, (char*) v));
}
Пример #2
0
static int
TIFFWriteFloatArray(TIFF* tif, TIFFDirEntry* dir, float* v)
{
	TIFFCvtNativeToIEEEFloat(tif, dir->s.tdir_count, v);
	if (TDIRGetEntryCount(tif,dir) <= TDIREntryOffLen(tif) / sizeof(float)) {
		_TIFFmemcpy(TDIRAddrEntryOff(tif,dir), v, 
			TDIRGetEntryCount(tif,dir) * sizeof(float));
		return (1);
	}
	return (TIFFWriteData(tif, dir, (char*) v));
}
Пример #3
0
static int
TIFFWriteFloatArray(TIFF* tif,
    TIFFDataType type, ttag_t tag, TIFFDirEntry* dir, uint32 n, float* v)
{
	dir->tdir_tag = (uint16) tag;
	dir->tdir_type = (short) type;
	dir->tdir_count = n;
	TIFFCvtNativeToIEEEFloat(tif, n, v);
	if (n == 1) {
		dir->tdir_offset = *(uint32*) &v[0];
		return (1);
	} else
		return (TIFFWriteData(tif, dir, (char*) v));
}