OpenJPEG 2.3.1

image.h
Go to the documentation of this file.
1 /*
2 * The copyright in this software is being made available under the 2-clauses
3 * BSD License, included below. This software may be subject to other third
4 * party and contributor rights, including patent rights, and no such rights
5 * are granted under this license.
6 *
7 * Copyright (c) 2005, Herve Drolon, FreeImage Team
8 * All rights reserved.
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS `AS IS'
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31 #ifndef OPJ_IMAGE_H
32 #define OPJ_IMAGE_H
33
40 struct opj_image;
41 struct opj_cp;
42
45
51 opj_image_t* opj_image_create0(void);
52
53
54
61 void opj_image_comp_header_update(opj_image_t * p_image,
62 const struct opj_cp* p_cp);
63
64 void opj_copy_image_header(const opj_image_t* p_image_src,
65 opj_image_t* p_image_dest);
66
69 #endif /* OPJ_IMAGE_H */
70
opj_image::x1
OPJ_UINT32 x1
Xsiz: width of the reference grid.
Definition: openjpeg.h:709
OPJ_BYTE
unsigned char OPJ_BYTE
Definition: openjpeg.h:117
opj_calloc
void * opj_calloc(size_t num, size_t size)
Allocate a memory block with elements initialized to 0.
Definition: opj_malloc.c:198
opj_image_comp::dy
OPJ_UINT32 dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:675
opj_image::y1
OPJ_UINT32 y1
Ysiz: height of the reference grid.
Definition: openjpeg.h:711
opj_image::numcomps
OPJ_UINT32 numcomps
number of components in the image
Definition: openjpeg.h:713
opj_uint_ceildiv
static INLINE OPJ_UINT32 opj_uint_ceildiv(OPJ_UINT32 a, OPJ_UINT32 b)
Divide an integer and round upwards.
Definition: opj_intmath.h:170
SIZE_MAX
#define SIZE_MAX
Definition: opj_malloc.c:40
opj_image_comp::data
OPJ_INT32 * data
image component data
Definition: openjpeg.h:695
opj_image_comp_header_update
void opj_image_comp_header_update(opj_image_t *p_image, const struct opj_cp *p_cp)
Updates the components characteristics of the image from the coding parameters.
Definition: image.c:122
opj_image_data_alloc
void *OPJ_CALLCONV opj_image_data_alloc(OPJ_SIZE_T size)
Allocator for opj_image_t->comps[].data To be paired with opj_image_data_free.
Definition: openjpeg.c:1091
opj_image_comptparm
Component parameters structure used by the opj_image_create function.
Definition: openjpeg.h:728
opj_image_comptparm::bpp
OPJ_UINT32 bpp
image depth in bits
Definition: openjpeg.h:744
opj_image::color_space
OPJ_COLOR_SPACE color_space
color space: sRGB, Greyscale or YUV
Definition: openjpeg.h:715
opj_image_comptparm::y0
OPJ_UINT32 y0
y component offset compared to the whole image
Definition: openjpeg.h:740
opj_copy_image_header
void opj_copy_image_header(const opj_image_t *p_image_src, opj_image_t *p_image_dest)
Copy only header of image and its component header (no data are copied) if dest image have data,...
Definition: image.c:165
opj_image_comp
Defines a single image component.
Definition: openjpeg.h:671
opj_cp
Coding parameters.
Definition: j2k.h:347
opj_image::icc_profile_buf
OPJ_BYTE * icc_profile_buf
'restricted' ICC profile
Definition: openjpeg.h:719
opj_cp::tdy
OPJ_UINT32 tdy
YTsiz.
Definition: j2k.h:359
opj_cp::tx0
OPJ_UINT32 tx0
XTOsiz.
Definition: j2k.h:353
opj_cp::tdx
OPJ_UINT32 tdx
XTsiz.
Definition: j2k.h:357
opj_image_create
opj_image_t *OPJ_CALLCONV opj_image_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc)
Create an image.
Definition: image.c:40
opj_uint_adds
static INLINE OPJ_UINT32 opj_uint_adds(OPJ_UINT32 a, OPJ_UINT32 b)
Get the saturated sum of two unsigned integers.
Definition: opj_intmath.h:92
OPJ_SIZE_T
size_t OPJ_SIZE_T
Definition: openjpeg.h:133
opj_includes.h
opj_image_comp::x0
OPJ_UINT32 x0
x component offset compared to the whole image
Definition: openjpeg.h:681
opj_image_destroy
void OPJ_CALLCONV opj_image_destroy(opj_image_t *image)
Deallocate any resources associated with an image.
Definition: image.c:92
opj_image_comptparm::x0
OPJ_UINT32 x0
x component offset compared to the whole image
Definition: openjpeg.h:738
opj_image_comp::sgnd
OPJ_UINT32 sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:689
OPJ_INT32
int32_t OPJ_INT32
Definition: openjpeg.h:125
opj_cp::th
OPJ_UINT32 th
number of tiles in height
Definition: j2k.h:365
opj_image_comp::h
OPJ_UINT32 h
data height
Definition: openjpeg.h:679
opj_image_create0
opj_image_t * opj_image_create0(void)
Create an empty image.
Definition: image.c:34
opj_image_comp::prec
OPJ_UINT32 prec
precision
Definition: openjpeg.h:685
opj_image::y0
OPJ_UINT32 y0
YOsiz: vertical offset from the origin of the reference grid to the top side of the image area.
Definition: openjpeg.h:707
opj_image_comp::y0
OPJ_UINT32 y0
y component offset compared to the whole image
Definition: openjpeg.h:683
opj_uint_min
static INLINE OPJ_UINT32 opj_uint_min(OPJ_UINT32 a, OPJ_UINT32 b)
Get the minimum of two integers.
Definition: opj_intmath.h:65
opj_uint_max
static INLINE OPJ_UINT32 opj_uint_max(OPJ_UINT32 a, OPJ_UINT32 b)
Get the maximum of two integers.
Definition: opj_intmath.h:83
opj_malloc
void * opj_malloc(size_t size)
Allocate an uninitialized memory block.
Definition: opj_malloc.c:191
opj_image_data_free
void OPJ_CALLCONV opj_image_data_free(void *ptr)
Destructor for opj_image_t->comps[].data To be paired with opj_image_data_alloc.
Definition: openjpeg.c:1098
opj_image_comptparm::sgnd
OPJ_UINT32 sgnd
signed (1) / unsigned (0)
Definition: openjpeg.h:746
opj_free
void opj_free(void *ptr)
Deallocates or frees a memory block.
Definition: opj_malloc.c:246
opj_image_comptparm::w
OPJ_UINT32 w
data width
Definition: openjpeg.h:734
opj_image_comp::w
OPJ_UINT32 w
data width
Definition: openjpeg.h:677
OPJ_COLOR_SPACE
enum COLOR_SPACE OPJ_COLOR_SPACE
Supported image color spaces.
opj_image::x0
OPJ_UINT32 x0
XOsiz: horizontal offset from the origin of the reference grid to the left side of the image area.
Definition: openjpeg.h:705
opj_uint_ceildivpow2
static INLINE OPJ_UINT32 opj_uint_ceildivpow2(OPJ_UINT32 a, OPJ_UINT32 b)
Divide an integer by a power of 2 and round upwards.
Definition: opj_intmath.h:198
opj_image::comps
opj_image_comp_t * comps
image components
Definition: openjpeg.h:717
opj_image::icc_profile_len
OPJ_UINT32 icc_profile_len
size of ICC profile
Definition: openjpeg.h:721
opj_image_tile_create
opj_image_t *OPJ_CALLCONV opj_image_tile_create(OPJ_UINT32 numcmpts, opj_image_cmptparm_t *cmptparms, OPJ_COLOR_SPACE clrspc)
Creates an image without allocating memory for the image (used in the new version of the library).
Definition: image.c:228
opj_image_comp::bpp
OPJ_UINT32 bpp
image depth in bits
Definition: openjpeg.h:687
opj_cp::tw
OPJ_UINT32 tw
number of tiles in width
Definition: j2k.h:363
OPJ_UINT32
uint32_t OPJ_UINT32
Definition: openjpeg.h:126
opj_image_comp::factor
OPJ_UINT32 factor
number of division by 2 of the out image compared to the original size of image
Definition: openjpeg.h:693
opj_image_comp::dx
OPJ_UINT32 dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:673
opj_cp::ty0
OPJ_UINT32 ty0
YTOsiz.
Definition: j2k.h:355
opj_image_comptparm::dx
OPJ_UINT32 dx
XRsiz: horizontal separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:730
opj_image_comptparm::h
OPJ_UINT32 h
data height
Definition: openjpeg.h:736
opj_copy_image_header
void opj_copy_image_header(const opj_image_t *p_image_src, opj_image_t *p_image_dest)
Copy only header of image and its component header (no data are copied) if dest image have data,...
Definition: image.c:165
opj_image_comp_header_update
void opj_image_comp_header_update(opj_image_t *p_image_header, const struct opj_cp *p_cp)
Updates the components characteristics of the image from the coding parameters.
Definition: image.c:122
opj_image_comptparm::prec
OPJ_UINT32 prec
precision
Definition: openjpeg.h:742
opj_image_create0
opj_image_t * opj_image_create0(void)
Create an empty image.
Definition: image.c:34
OPJ_CALLCONV
#define OPJ_CALLCONV
Definition: openjpeg.h:92
opj_image_comptparm::dy
OPJ_UINT32 dy
YRsiz: vertical separation of a sample of ith component with respect to the reference grid.
Definition: openjpeg.h:732
opj_image
Defines image data and characteristics.
Definition: openjpeg.h:703