------------------------------------------------------------------------------
| 1203 | |
| 1204 | //------------------------------------------------------------------------------ |
| 1205 | void vtkImagePlaneWidget::InvertTable() |
| 1206 | { |
| 1207 | int index = this->LookupTable->GetNumberOfTableValues(); |
| 1208 | unsigned char swap[4]; |
| 1209 | size_t num = 4 * sizeof(unsigned char); |
| 1210 | vtkUnsignedCharArray* table = this->LookupTable->GetTable(); |
| 1211 | for (int count = 0; count < --index; count++) |
| 1212 | { |
| 1213 | unsigned char* rgba1 = table->GetPointer(4 * count); |
| 1214 | unsigned char* rgba2 = table->GetPointer(4 * index); |
| 1215 | memcpy(swap, rgba1, num); |
| 1216 | memcpy(rgba1, rgba2, num); |
| 1217 | memcpy(rgba2, swap, num); |
| 1218 | } |
| 1219 | |
| 1220 | // force the lookuptable to update its InsertTime to avoid |
| 1221 | // rebuilding the array |
| 1222 | double temp[4]; |
| 1223 | this->LookupTable->GetTableValue(0, temp); |
| 1224 | this->LookupTable->SetTableValue(0, temp); |
| 1225 | } |
| 1226 | |
| 1227 | //------------------------------------------------------------------------------ |
| 1228 | void vtkImagePlaneWidget::SetWindowLevel(double window, double level, int copy) |
no test coverage detected