~ubuntu-branches/ubuntu/karmic/photoprint/karmic

« back to all changes in this revision

Viewing changes to imagesource/imagesource.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Milan Zamazal
  • Date: 2007-05-01 16:32:13 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20070501163213-ni1933khtg9fdvn5
Tags: 0.3.5-2
Move to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#include "../profilemanager/lcmswrapper.h"
 
2
#include "imagesource.h"
 
3
 
 
4
ImageSource::ImageSource() : embeddedprofile(NULL), rowbuffer(NULL)
 
5
{
 
6
}
 
7
 
 
8
 
 
9
ImageSource::ImageSource(ImageSource *src) : rowbuffer(NULL)
 
10
{
 
11
        width=src->width;
 
12
        height=src->height;
 
13
        type=src->type;
 
14
        samplesperpixel=src->samplesperpixel;
 
15
        xres=src->xres;
 
16
        yres=src->yres;
 
17
        randomaccess=src->randomaccess;
 
18
        embeddedprofile=src->embeddedprofile;
 
19
        currentrow=-1;
 
20
}
 
21
 
 
22
 
 
23
ImageSource::~ImageSource()
 
24
{
 
25
        if(rowbuffer)
 
26
                free(rowbuffer);
 
27
}
 
28
 
 
29
 
 
30
void ImageSource::MakeRowBuffer()
 
31
{
 
32
        rowbuffer=(ISDataType *)malloc(sizeof(ISDataType)*width*samplesperpixel);
 
33
        currentrow=-1;
 
34
}
 
35
 
 
36
 
 
37
void ImageSource::SetResolution(double xr,double yr)
 
38
{
 
39
        xres=xr;
 
40
        yres=yr;
 
41
}
 
42
 
 
43
 
 
44
CMSProfile *ImageSource::GetEmbeddedProfile()
 
45
{
 
46
        return(embeddedprofile);
 
47
}
 
48
 
 
49
 
 
50
void ImageSource::SetEmbeddedProfile(CMSProfile *profile)
 
51
{
 
52
        if(embeddedprofile)
 
53
                delete embeddedprofile;
 
54
        embeddedprofile=profile;
 
55
}