File: invert.cpp

package info (click to toggle)
vips 8.18.0-3
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 54,344 kB
  • sloc: ansic: 172,638; cpp: 12,257; python: 5,077; sh: 773; perl: 40; makefile: 25; javascript: 6
file content (36 lines) | stat: -rw-r--r-- 626 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
/*
 * compile with:
 *
 *      g++ -g -Wall invert.cpp `pkg-config vips-cpp --cflags --libs`
 *
 */

#define DEBUG

#include <vips/vips8>

using namespace vips;

int
main(int argc, char **argv)
{
	if (vips_init(argv[0]))
		vips_error_exit(NULL);

	printf("these should match if VImage is compile-time-only\n");
	printf("sizeof(VipsImage *) = %zd\n", sizeof(VipsImage *));
	printf("sizeof(VImage) = %zd\n", sizeof(VImage));

	VImage in = VImage::new_from_file(argv[1],
		VImage::option()->set("access", VIPS_ACCESS_SEQUENTIAL));

	VImage out;

	out = in.invert();

	out.write_to_file(argv[2]);

	vips_shutdown();

	return 0;
}