forked from blackfiveimaging/library
-
Notifications
You must be signed in to change notification settings - Fork 0
/
imgsinktest.cpp
42 lines (37 loc) · 770 Bytes
/
imgsinktest.cpp
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
37
38
39
40
41
#include <iostream>
#include "imagesource.h"
#include "imagesource_util.h"
#include "debug.h"
#include "imagesink.h"
#include "refcountptr.h"
#include "cachedimage.h"
#include "tiffsaver.h"
#include "jpegsaver.h"
int main(int argc, char **argv)
{
Debug.SetLevel(TRACE);
try
{
if(argc>1)
{
char *outfn(BuildFilename(argv[1],"rcptest","jpg"));
RefCountPtr<ImageSource> is(ISLoadImage(argv[1]));
CachedImage_Deferred sink1(is);
CachedImage_Deferred sink2(is);
JPEGSaver saver(&*outfn,is);
CachedImage_Deferred sink4(is);
for(int i=0;i<is->height;++i)
{
sink1.ProcessRow(i);
sink2.ProcessRow(i);
saver.ProcessRow(i);
}
free(outfn);
}
}
catch (const char *err)
{
Debug[ERROR] << err << std::endl;
}
return(0);
}