ImageProvider::ImageProvider(std::string const& color_space,
                             std::string const& filter) :
    width(400),
    stripe_height(80),
    color_space(color_space),
    filter(filter),
    n_stripes(6),
    j_color_space(JCS_UNKNOWN)
{
    if (color_space == "/DeviceCMYK")
    {
        j_color_space = JCS_CMYK;
        stripes.push_back(std::string("\xff\x00\x00\x00", 4));
        stripes.push_back(std::string("\x00\xff\x00\x00", 4));
        stripes.push_back(std::string("\x00\x00\xff\x00", 4));
        stripes.push_back(std::string("\xff\x00\xff\x00", 4));
        stripes.push_back(std::string("\xff\xff\x00\x00", 4));
        stripes.push_back(std::string("\x00\x00\x00\xff", 4));
    }
    else if (color_space == "/DeviceRGB")
    {
        j_color_space = JCS_RGB;
        stripes.push_back(std::string("\xff\x00\x00", 3));
        stripes.push_back(std::string("\x00\xff\x00", 3));
        stripes.push_back(std::string("\x00\x00\xff", 3));
        stripes.push_back(std::string("\xff\x00\xff", 3));
        stripes.push_back(std::string("\xff\xff\x00", 3));
        stripes.push_back(std::string("\x00\x00\x00", 3));
    }
    else if (color_space == "/DeviceGray")
    {
        j_color_space = JCS_GRAYSCALE;
        stripes.push_back(std::string("\xee", 1));
        stripes.push_back(std::string("\xcc", 1));
        stripes.push_back(std::string("\x99", 1));
        stripes.push_back(std::string("\x66", 1));
        stripes.push_back(std::string("\x33", 1));
        stripes.push_back(std::string("\x00", 1));
    }
}
ImageProvider::ImageProvider(std::string const& color_space,
                             std::string const& filter) :
    width(400),
    stripe_height(80),
    color_space(color_space),
    filter(filter),
    n_stripes(6),
    j_color_space(JCS_UNKNOWN)
{
    if (color_space == "/DeviceCMYK")
    {
        j_color_space = JCS_CMYK;
        stripes.push_back(std::string("\xff\x00\x00\x00", 4));
        stripes.push_back(std::string("\x00\xff\x00\x00", 4));
        stripes.push_back(std::string("\x00\x00\xff\x00", 4));
        stripes.push_back(std::string("\xff\x00\xff\x00", 4));
        stripes.push_back(std::string("\xff\xff\x00\x00", 4));
        stripes.push_back(std::string("\x00\x00\x00\xff", 4));
    }
    else if (color_space == "/DeviceRGB")
    {
        j_color_space = JCS_RGB;
        stripes.push_back(std::string("\xff\x00\x00", 3));
        stripes.push_back(std::string("\x00\xff\x00", 3));
        stripes.push_back(std::string("\x00\x00\xff", 3));
        stripes.push_back(std::string("\xff\x00\xff", 3));
        stripes.push_back(std::string("\xff\xff\x00", 3));
        stripes.push_back(std::string("\x00\x00\x00", 3));
    }
    else if (color_space == "/DeviceGray")
    {
        j_color_space = JCS_GRAYSCALE;
        stripes.push_back(std::string("\xee", 1));
        stripes.push_back(std::string("\xcc", 1));
        stripes.push_back(std::string("\x99", 1));
        stripes.push_back(std::string("\x66", 1));
        stripes.push_back(std::string("\x33", 1));
        stripes.push_back(std::string("\x00", 1));
    }
}