17f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* 27f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * Copyright (C) 2008 The Android Open Source Project 37f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * 47f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * Licensed under the Apache License, Version 2.0 (the "License"); 57f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * you may not use this file except in compliance with the License. 67f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * You may obtain a copy of the License at 77f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * 87f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * http://www.apache.org/licenses/LICENSE-2.0 97f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * 107f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * Unless required by applicable law or agreed to in writing, software 117f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * distributed under the License is distributed on an "AS IS" BASIS, 127f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 137f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * See the License for the specific language governing permissions and 147f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project * limitations under the License. 157f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project */ 167f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 177f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#ifndef bim_FLT16_IMAGE_EM_H 187f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#define bim_FLT16_IMAGE_EM_H 197f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 207f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- includes ----------------------------------------------------------- */ 217f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 227f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#include "b_BasicEm/Context.h" 237f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#include "b_BasicEm/Int16Arr.h" 247f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#include "b_TensorEm/Int16Rect.h" 257f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#include "b_TensorEm/Flt16Alt2D.h" 267f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 277f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- related objects --------------------------------------------------- */ 287f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 297f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectstruct bim_ComplexImage; 307f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 317f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- typedefs ----------------------------------------------------------- */ 327f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 337f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- constants ---------------------------------------------------------- */ 347f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 357f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* data format version number */ 367f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#define bim_FLT16_IMAGE_VERSION 100 377f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 387f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- object definition -------------------------------------------------- */ 397f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 407f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** image of int16 with floating point */ 417f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectstruct bim_Flt16Image 427f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project{ 437f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 447f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /* ---- private data --------------------------------------------------- */ 457f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 467f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /** allocated array of bytes */ 477f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bbs_Int16Arr allocArrE; 487f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 497f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /* ---- public data ---------------------------------------------------- */ 507f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 517f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /** width of image */ 527f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 widthE; 537f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 547f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /** height of image */ 557f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 heightE; 567f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 577f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /** point position */ 587f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project int32 bbpE; 597f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 607f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project /** array of bytes */ 617f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bbs_Int16Arr arrE; 627f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project}; 637f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 647f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- associated objects ------------------------------------------------- */ 657f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 667f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- external functions ------------------------------------------------- */ 677f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 687f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ constructor/destructor } ------------------------------------- */ 697f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 707f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** initializes bim_Flt16Image */ 717f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_init( struct bbs_Context* cpA, 727f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA ); 737f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 747f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** destroys bim_Flt16Image */ 757f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_exit( struct bbs_Context* cpA, 767f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA ); 777f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 787f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ operators } -------------------------------------------------- */ 797f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 807f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** copy operator */ 817f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_copy( struct bbs_Context* cpA, 827f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 837f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* srcPtrA ); 847f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 857f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** equal operator */ 867f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectflag bim_Flt16Image_equal( struct bbs_Context* cpA, 877f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* ptrA, 887f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* srcPtrA ); 897f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 907f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ query functions } -------------------------------------------- */ 917f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 927f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ modify functions } ------------------------------------------- */ 937f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 947f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** allocates memory for bim_Flt16Image */ 957f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_create( struct bbs_Context* cpA, 967f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 977f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 widthA, 987f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 heightA, 997f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bbs_MemSeg* mspA ); 1007f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1017f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** assigns external image to array (no allocation, deallocation or copying of data) */ 1027f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/*void bim_Flt16Image_assignExternalImage( struct bbs_Context* cpA, 1037f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 1047f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* srcPtrA ); 1057f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project*/ 1067f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** sets image size */ 1077f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_size( struct bbs_Context* cpA, 1087f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 1097f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 widthA, 1107f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint32 heightA ); 1117f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1127f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ memory I/O } ------------------------------------------------- */ 1137f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1147f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** word size (16-bit) needs when written to memory */ 1157f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectuint32 bim_Flt16Image_memSize( struct bbs_Context* cpA, 1167f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* ptrA ); 1177f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1187f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** writes object to memory; returns number of words (16-bit) written */ 1197f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectuint32 bim_Flt16Image_memWrite( struct bbs_Context* cpA, 1207f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* ptrA, 1217f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project uint16* memPtrA ); 1227f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1237f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** reads object from memory; returns number of words (16-bit) read */ 1247f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectuint32 bim_Flt16Image_memRead( struct bbs_Context* cpA, 1257f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 1267f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const uint16* memPtrA, 1277f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bbs_MemSeg* mspA ); 1287f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1297f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/* ---- \ghd{ exec functions } --------------------------------------------- */ 1307f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1317f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** sets all pixels to one value */ 1327f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_setAllPixels( struct bbs_Context* cpA, 1337f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 1347f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project int16 valueA, int32 bbpA ); 1357f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1367f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** copies a section of given image */ 1377f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_copySection( struct bbs_Context* cpA, 1387f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* ptrA, 1397f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_Flt16Image* srcPtrA, 1407f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bts_Int16Rect* sectionPtrA ); 1417f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1427f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** imports real values from complex image */ 1437f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_importReal( struct bbs_Context* cpA, 1447f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* dstPtrA, 1457f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_ComplexImage* srcPtrA ); 1467f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1477f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** imports imaginary values from complex image */ 1487f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_importImag( struct bbs_Context* cpA, 1497f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* dstPtrA, 1507f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_ComplexImage* srcPtrA ); 1517f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1527f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** imports magnitudes from complex image */ 1537f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_importAbs( struct bbs_Context* cpA, 1547f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* dstPtrA, 1557f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_ComplexImage* srcPtrA ); 1567f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1577f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project/** imports phases from complex image */ 1587f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Projectvoid bim_Flt16Image_importPhase( struct bbs_Context* cpA, 1597f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project struct bim_Flt16Image* dstPtrA, 1607f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project const struct bim_ComplexImage* srcPtrA ); 1617f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1627f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 1637f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project#endif /* bim_FLT16_IMAGE_EM_H */ 1647f81d9b6fa7f2ec161b682622db577a28c90b49fThe Android Open Source Project 165