3 #include "filejpeglist.h"
7 #include "jpegwrapper.h"
16 FileJPEGList::FileJPEGList(Asset *asset, File *file)
17 : FileList(asset, file)
19 asset->format = FILE_JPEG_LIST;
22 FileJPEGList::~FileJPEGList()
27 char* FileJPEGList::list_title()
32 char* FileJPEGList::extension()
37 void FileJPEGList::get_parameters(BC_WindowBase *parent_window,
39 BC_WindowBase* &format_window,
45 JPEGConfigVideo *window = new JPEGConfigVideo(parent_window, asset);
46 format_window = window;
47 window->create_objects();
53 int FileJPEGList::can_copy_from(Asset *asset)
55 if(asset->format == FILE_JPEG_LIST)
58 if(asset->format == FILE_MOV && match4(asset->vcodec, QUICKTIME_JPEG))
64 int FileJPEGList::get_best_colormodel(int driver, int colormodel)
84 int FileJPEGList::read_frame(VFrame *frame, VFrame *data)
86 mjpeg_t *mjpeg = mjpeg_new(asset->width,
89 mjpeg_decompress(mjpeg,
91 data->get_compressed_size(),
97 frame->get_color_model(),
103 int FileJPEGList::write_frame(VFrame *frame, VFrame *data)
105 mjpeg_t *mjpeg = mjpeg_new(asset->width,
108 mjpeg_compress(mjpeg,
113 frame->get_color_model(),
115 data->allocate_compressed_data(mjpeg_output_size(mjpeg));
116 bcopy(mjpeg_output_buffer(mjpeg), frame->get_data(), mjpeg_output_size(mjpeg));
131 JPEGConfigVideo::JPEGConfigVideo(BC_WindowBase *parent_window, Asset *asset)
132 : BC_Window(PROGRAM_NAME ": Video Compression",
133 parent_window->get_abs_cursor_x(),
134 parent_window->get_abs_cursor_y(),
138 this->parent_window = parent_window;
142 JPEGConfigVideo::~JPEGConfigVideo()
146 int JPEGConfigVideo::create_objects()
150 add_subwindow(new BC_Title(x, y, _("Quality:")));
151 add_subwindow(new BC_ISlider(x + 80,
163 add_subwindow(new BC_OKButton(this));
167 int JPEGConfigVideo::close_event()