r125: This commit was manufactured by cvs2svn to create tag 'r1_1_7-last'.
[cinelerra_cv/mob.git] / hvirtual / cinelerra / filetga.h
blobde99b8239b5c829aed25116cf720356f540b279a
1 #ifndef FILETGA_H
2 #define FILETGA_H
4 #include "filelist.h"
5 #include "guicast.h"
7 class FileTGA : public FileList
9 public:
10 FileTGA(Asset *asset, File *file);
11 ~FileTGA();
13 static int check_sig(Asset *asset);
14 static void get_parameters(BC_WindowBase *parent_window,
15 Asset *asset,
16 BC_WindowBase* &format_window,
17 int audio_options,
18 int video_options);
19 int read_frame_header(char *path);
20 static char* compression_to_str(char *compression);
21 static char* str_to_compression(char *string);
23 // To be used in single frame FileTGA
24 static void read_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp);
25 static void write_tga(Asset *asset, VFrame *frame, VFrame *data, VFrame* &temp);
27 int can_copy_from(Edit *edit, int64_t position);
28 static int get_best_colormodel(Asset *asset, int driver);
29 int colormodel_supported(int colormodel);
30 int read_frame(VFrame *frame, VFrame *data);
31 int write_frame(VFrame *frame, VFrame *data, FrameWriterUnit *unit);
32 FrameWriterUnit* new_writer_unit(FrameWriter *writer);
34 // For decoding only
35 VFrame *temp;
37 private:
38 static void write_data(unsigned char *buffer,
39 VFrame *data,
40 int64_t &file_offset,
41 int64_t len);
42 static void read_line(unsigned char *row,
43 unsigned char *data,
44 int64_t &file_offset,
45 int image_type,
46 int bpp,
47 int image_compression,
48 int bytes,
49 int width,
50 int fliphoriz,
51 int alphabits,
52 int data_size);
53 static void flip_line(unsigned char *row, int bytes, int width);
54 static void rle_read(unsigned char *row,
55 unsigned char *data,
56 int64_t &file_offset,
57 int bytes,
58 int width);
59 static void rle_write(unsigned char *buffer,
60 int width,
61 int bytes,
62 VFrame *frame,
63 int64_t &file_offset);
64 static void bgr2rgb(unsigned char *dest,
65 unsigned char *src,
66 int width,
67 int bytes,
68 int alpha);
69 static void upsample(unsigned char *dest,
70 unsigned char *src,
71 int width,
72 int bytes);
75 class TGAUnit : public FrameWriterUnit
77 public:
78 TGAUnit(FileTGA *file, FrameWriter *writer);
79 ~TGAUnit();
80 VFrame *temp;
81 FileTGA *file;
84 class TGAConfigVideo : public BC_Window
86 public:
87 TGAConfigVideo(BC_WindowBase *gui, Asset *asset);
88 ~TGAConfigVideo();
89 int create_objects();
90 int close_event();
92 ArrayList<BC_ListBoxItem*> compression_items;
93 BC_WindowBase *gui;
94 Asset *asset;
97 class TGACompression : public BC_PopupTextBox
99 public:
100 TGACompression(TGAConfigVideo *gui,
101 int x,
102 int y,
103 Asset *asset,
104 ArrayList<BC_ListBoxItem*> *compression_items);
105 int handle_event();
106 Asset *asset;
109 #endif