sub_image(face, level, x, y, wd, ht, data);
}
-void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool srgb)
+void TextureCube::image(TextureCubeFace face, const Graphics::Image &img)
{
unsigned w = img.get_width();
unsigned h = img.get_height();
if(w!=h)
throw incompatible_data("TextureCube::image");
- storage(make_pixelformat(get_components(fmt), get_component_type(fmt), srgb), w);
+ storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w);
}
else if(w!=size || h!=size)
throw incompatible_data("TextureCube::image");
PixelStore pstore = PixelStore::from_image(img);
BindRestore _bind_ps(pstore);
- image(face, 0, img.get_data());
+ image(face, 0, img.get_pixels());
}
-void TextureCube::image(const Graphics::Image &img, unsigned lv, bool srgb)
+void TextureCube::image(TextureCubeFace face, const Graphics::Image &img, bool)
+{
+ image(face, img);
+}
+
+void TextureCube::image(const Graphics::Image &img, unsigned lv)
{
unsigned w = img.get_width();
unsigned h = img.get_height();
PixelFormat fmt = pixelformat_from_image(img);
if(size==0)
- storage(make_pixelformat(get_components(fmt), get_component_type(fmt), srgb), w, lv);
+ storage(make_pixelformat(get_components(fmt), get_component_type(fmt), use_srgb_format), w, lv);
else if(w!=size || h!=size)
throw incompatible_data("TextureCube::image");
PixelStore pstore = PixelStore::from_image(img);
BindRestore _bind_ps(pstore);
- const char *cdata = reinterpret_cast<const char *>(img.get_data());
+ const char *pixels = reinterpret_cast<const char *>(img.get_pixels());
unsigned face_size = img.get_stride()*size;
for(unsigned i=0; i<6; ++i)
- image(enumerate_faces(i), 0, cdata+i*face_size);
+ image(enumerate_faces(i), 0, pixels+i*face_size);
}
unsigned TextureCube::get_n_levels() const
RefPtr<IO::Seekable> io = get_collection().open_raw(fn);
img.load_io(*io);
- obj.image(face, img, srgb);
+ obj.image(face, img);
}
void TextureCube::Loader::image_data(TextureCubeFace face, const string &data)
IO::Memory mem(data.data(), data.size());
img.load_io(mem);
- obj.image(face, img, srgb);
+ obj.image(face, img);
}
void TextureCube::Loader::raw_data(TextureCubeFace face, const string &data)