Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » Draw, Display, Images, Bitmaps, Icons » TIFF wrapper: to access lib methods
TIFF wrapper: to access lib methods [message #32278] Thu, 05 May 2011 21:11 Go to next message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello All,

I propose to add in <plugin/tif/tif.h>


#define HAVE_INT8
#define HAVE_INT16
#define HAVE_INT32
#define HAVE_UINT8
#define HAVE_UINT16
#define HAVE_UINT32
#define	int8 signed char
#define	uint8 unsigned char
#define	int16 short
#define	uint16 unsigned short
#if !defined(PLATFORM_WIN32)
	#define	int32 int
	#define	uint32 unsigned int
#else
	#define	int32 long
	#define	uint32 unsigned long

#endif

#include <plugin/tif/lib/tiff.h>
#include <plugin/tif/lib/tiffio.h>
#include <plugin/tif/lib/tiffiop.h>
/*
#undef int8
#undef uint8
#undef int16
#undef uint16
#undef int32
#undef uint32
*/
#undef HAVE_INT8
#undef HAVE_INT16
#undef HAVE_INT32
#undef HAVE_UINT8
#undef HAVE_UINT16
#undef HAVE_UINT32


in tifupp.cpp to remove include files of library and add:
#define tif_int32 int32
#define tif_uint32 uint32


in file <plugin/tif/lib/tif.h> to change the code in:

#ifndef HAVE_INT8
typedef	signed char int8;	/* NB: non-ANSI compilers may not grok */
#endif
#ifndef HAVE_UINT8
typedef	unsigned char uint8;
#endif
#ifndef HAVE_INT16
typedef	short int16;
#endif
#ifndef HAVE_UINT16
typedef	unsigned short uint16;	/* sizeof (uint16) must == 2 */
#endif
#if SIZEOF_INT == 4
#ifndef HAVE_INT32
typedef	int int32;
#endif
#ifndef HAVE_UINT32
typedef	unsigned int uint32;	/* sizeof (uint32) must == 4 */
#endif
#elif SIZEOF_LONG == 4
#ifndef HAVE_INT32
typedef	long int32;
#endif
#ifndef HAVE_UINT32
typedef	unsigned long uint32;	/* sizeof (uint32) must == 4 */
#endif
#endif


This realization gives the possibility to access core tif functions.

Motivation: I used this to access 16 bit image.

Any advice are welcome.
Re: TIFF wrapper: to access lib methods [message #32298 is a reply to message #32278] Fri, 06 May 2011 19:21 Go to previous message
mirek is currently offline  mirek
Messages: 12098
Registered: November 2005
Ultimate Member
tojocky wrote on Thu, 05 May 2011 15:11

Hello All,

I propose to add in <plugin/tif/tif.h>


#define HAVE_INT8
#define HAVE_INT16
#define HAVE_INT32
#define HAVE_UINT8
#define HAVE_UINT16
#define HAVE_UINT32
#define	int8 signed char
#define	uint8 unsigned char
#define	int16 short
#define	uint16 unsigned short
#if !defined(PLATFORM_WIN32)
	#define	int32 int
	#define	uint32 unsigned int
#else
	#define	int32 long
	#define	uint32 unsigned long

#endif

#include <plugin/tif/lib/tiff.h>
#include <plugin/tif/lib/tiffio.h>
#include <plugin/tif/lib/tiffiop.h>
/*
#undef int8
#undef uint8
#undef int16
#undef uint16
#undef int32
#undef uint32
*/
#undef HAVE_INT8
#undef HAVE_INT16
#undef HAVE_INT32
#undef HAVE_UINT8
#undef HAVE_UINT16
#undef HAVE_UINT32


in tifupp.cpp to remove include files of library and add:
#define tif_int32 int32
#define tif_uint32 uint32


in file <plugin/tif/lib/tif.h> to change the code in:

#ifndef HAVE_INT8
typedef	signed char int8;	/* NB: non-ANSI compilers may not grok */
#endif
#ifndef HAVE_UINT8
typedef	unsigned char uint8;
#endif
#ifndef HAVE_INT16
typedef	short int16;
#endif
#ifndef HAVE_UINT16
typedef	unsigned short uint16;	/* sizeof (uint16) must == 2 */
#endif
#if SIZEOF_INT == 4
#ifndef HAVE_INT32
typedef	int int32;
#endif
#ifndef HAVE_UINT32
typedef	unsigned int uint32;	/* sizeof (uint32) must == 4 */
#endif
#elif SIZEOF_LONG == 4
#ifndef HAVE_INT32
typedef	long int32;
#endif
#ifndef HAVE_UINT32
typedef	unsigned long uint32;	/* sizeof (uint32) must == 4 */
#endif
#endif


This realization gives the possibility to access core tif functions.

Motivation: I used this to access 16 bit image.

Any advice are welcome.



OK. I please somebody do this while opdating plugin/tiff... Smile

Mirek
Previous Topic: RGBA and ImageBuffer classes improve
Next Topic: SetSurface, shrink, stretch?
Goto Forum:
  


Current Time: Wed Nov 13 13:05:13 CET 2019

Total time taken to generate the page: 0.01695 seconds