⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mcraw_image_writer_local.h

📁 JPEG2000实现的源码
💻 H
字号:
/*****************************************************************************/
/* Copyright 1999, Eastman Kodak Company                                     */
/* All rights reserved                                                       */
/* File: "mcraw_image_writer_local.h"                                        */
/* Description: Private definitions for "mcraw_image_writer.c"               */
/* Author: Austin Lan                                                        */
/* Affiliation: Eastman Kodak Company                                        */
/* Version: VM8.5                                                            */
/* Last Revised: 11 September, 2000                                          */
/*****************************************************************************/
#ifndef MCRAW_IMAGE_WRITER_LOCAL_H
#define MCRAW_IMAGE_WRITER_LOCAL_H
#include <image_io.h>

/*****************************************************************************
  NOTE:

  All memory allocations are registered with the main compression program to
  assist in evaluating the cost associated with decompressing a large multi-
  component image (e.g., hyperspectral).  Memory usage in this module 
  consists of a buffered "page" of the data, defined to be one image line,
  all bands and all pixels, file name, and object.

  Internally, the I/O functions write a "page" of data using the BIL (band-
  interleaved-by-line) organization.  The output image file can be organized
  as BSQ (band-sequential), BIL, or BIP (band-interleaved-by-pixel), but 
  processing will be the fastest when organized as BIL.  Processing will be
  the slowest when organized as BSQ.

  It is assumed that the compression program will output data in a line
  interleaved format.  This means that data will be presented to the 
  output routine in order from the first image line to the last; for each
  line, the components will be presented from the first to the last; for
  each component, all pixels will be read from an input buffer (`line_buf'
  in the `push_line' function) from the first to the last.  If data is
  "pushed" from the compressor in a different manner, then functions 
  in mcraw_image_writer.c should be re-written!
  
  Refer to "mcraw_common.h" for more information on data organization.
 *****************************************************************************/

/*****************************************************************************/
/*                           mcraw_image_writer_obj                          */
/*****************************************************************************/

typedef
  struct mcraw_image_writer_obj {
    image_writer_obj base;
    int num_components;
    int rows, cols;
    int current_row_idx;
    FILE *fp;                          /* File pointer for buffered I/O */
    char *filename;
    int *bitdepths;                    /* Array of bit depths for each component */
    int *is_signed;                    /* Array of signs for each component */
    int pack_bytes;                    /* File storage byte depth */
    int reverse_byte_order;            /* Flag to indicate byte swapping */
    int data_org;                      /* File organization; BIP, BSQ, or BIL */
    int skip_bytes;                    /* Header bytes to skip */

    void **line_buf;                   /* Buffer for storing a page of data */
    int comp_written_so_far;           /* Number of components that have accessed
					  the `line_buf' for the current line */
  } mcraw_image_writer_obj, *mcraw_image_writer_ref;
  /* Manages state for the externally visible `image_writer' object.
     The output image will have multiple components stored in a 
     single file as raw bytes.  Each component is expected to have
     the same dimensions.  Each component may have different bit-depths,
     and may be represented by signed two's complement values or 
     unsigned values.  The bit-depths for each component is given by the 
     `bitdepths' field, while `is_signed' indicates whether or not the 
     sample values contain signed two's complement data.  `pack_bytes' 
     indicates the number of whole bytes into which each sample value is 
     packed.  This should be a power of 2, i.e. 1,2 or 4, and cannot change 
     from component to component.  The `bitdepths[a_component]' bits of each 
     sample value are the least significant bits within the (8*`pack_bits')-bit 
     words which are read in.  `data_org' describes how the data is interleaved 
     in the file.  BSQ, BIP, and BIL are valid values (look mcraw_common.h).
     The `line_buf' field buffers a "page" of data with byte depth specified
     by `pack_bytes', which is defined to be all components in the row direction 
     and all pixels in the column direction.  `comp_written_so_far' keeps track of 
     accesses to `line_buf'.  It is used to determine when a page of data 
     should be written to disk */

#endif /* MCRAW_IMAGE_WRITER_LOCAL_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -