PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
v2u_save.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * $Id: v2u_save.h 10816 2010-09-02 07:58:50Z monich $
4  *
5  * Copyright (C) 2003-2010 Epiphan Systems Inc. All rights reserved.
6  *
7  * Functions for saving image into a file
8  *
9  ****************************************************************************/
10 
11 #ifndef _V2U_SAVE_H_
12 #define _V2U_SAVE_H_ 1
13 
14 #include "v2u_defs.h"
15 #include <stdio.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif /* __cplusplus */
20 
21 /* Palettes entry, compatible with RGBQUAD type on Windows */
22 typedef struct _BmpPalEntry {
27 } BmpPalEntry;
28 
29 /* VGA2USB palettes */
30 extern const BmpPalEntry v2u_palette_4bpp[16];
31 extern const BmpPalEntry v2u_palette_8bpp[256];
32 extern const BmpPalEntry v2u_palette_y8[256];
33 
34 /* And 16bpp RGB masks */
35 extern const V2U_UINT32 v2u_mask_bgr16[3];
36 extern const V2U_UINT32 v2u_mask_rgb16[3];
37 
38 /*
39  * Writes the image file to the specified stream. Returns V2U_FALSE on failure,
40  * V2U_TRUE on success. The fmt parameter defined the input pixel format.
41  * The following formats are supported:
42  *
43  * V2U_GRABFRAME_FORMAT_Y8
44  * V2U_GRABFRAME_FORMAT_RGB4
45  * V2U_GRABFRAME_FORMAT_RGB8
46  * V2U_GRABFRAME_FORMAT_RGB16
47  * V2U_GRABFRAME_FORMAT_BGR16
48  * V2U_GRABFRAME_FORMAT_RGB24
49  * V2U_GRABFRAME_FORMAT_BGR24
50  * V2U_GRABFRAME_FORMAT_ARGB32
51  * V2U_GRABFRAME_FORMAT_YUY2
52  * V2U_GRABFRAME_FORMAT_2VUY
53  * V2U_GRABFRAME_FORMAT_YV12
54  * V2U_GRABFRAME_FORMAT_I420
55  *
56  * possibly, with V2U_GRABFRAME_BOTTOM_UP_FLAG bit set. The pixels are assumed
57  * to be tightly packed, i.e. the line size is NOT aligned at 32-bit boundary.
58  */
59 typedef V2U_BOOL (*V2U_SAVE_PROC)(FILE* f,int w,int h,int fmt, const void* b);
60 extern V2U_BOOL v2u_write_bmp(FILE* f, int w, int h, int fmt, const void* b);
61 extern V2U_BOOL v2u_write_jpeg(FILE* f, int w, int h, int fmt, const void* b);
62 extern V2U_BOOL v2u_write_png(FILE* f, int w, int h, int fmt, const void* b);
63 
64 #ifdef __cplusplus
65 } /* end of extern "C" */
66 #endif /* __cplusplus */
67 
68 #endif /* _V2U_SAVE_H_ */
V2U_UINT8 rgbRed
Definition: v2u_save.h:25
V2U_BOOL(* V2U_SAVE_PROC)(FILE *f, int w, int h, int fmt, const void *b)
Definition: v2u_save.h:59
V2U_UINT8 rgbBlue
Definition: v2u_save.h:23
V2U_UINT8 rgbGreen
Definition: v2u_save.h:24
V2U_INT32 V2U_BOOL
Definition: v2u_defs.h:71
const BmpPalEntry v2u_palette_4bpp[16]
Initial rotation matrix b
Definition: algo3.m:25
uint32_t V2U_UINT32
Definition: v2u_defs.h:64
const V2U_UINT32 v2u_mask_rgb16[3]
V2U_BOOL v2u_write_png(FILE *f, int w, int h, int fmt, const void *b)
const V2U_UINT32 v2u_mask_bgr16[3]
const BmpPalEntry v2u_palette_8bpp[256]
V2U_BOOL v2u_write_bmp(FILE *f, int w, int h, int fmt, const void *b)
V2U_UINT8 rgbReserved
Definition: v2u_save.h:26
V2U_BOOL v2u_write_jpeg(FILE *f, int w, int h, int fmt, const void *b)
const BmpPalEntry v2u_palette_y8[256]
struct _BmpPalEntry BmpPalEntry
uint8_t V2U_UINT8
Definition: v2u_defs.h:60